├── .depend ├── .gitattributes ├── .gitignore ├── .gitmodules ├── .mailmap ├── .merlin ├── .ocp-indent ├── .travis-ci.sh ├── .travis.yml ├── CONTRIBUTING.md ├── Changes ├── INSTALL.adoc ├── LICENSE ├── Makefile ├── Makefile.nt ├── Makefile.shared ├── Makefile.tools ├── README.adoc ├── README.win32.adoc ├── VERSION ├── appveyor.yml ├── appveyor_build.sh ├── asmcomp ├── CSEgen.ml ├── CSEgen.mli ├── amd64 │ ├── CSE.ml │ ├── NOTES.md │ ├── arch.ml │ ├── emit.mlp │ ├── proc.ml │ ├── reload.ml │ ├── scheduling.ml │ └── selection.ml ├── arm │ ├── CSE.ml │ ├── NOTES.md │ ├── arch.ml │ ├── emit.mlp │ ├── proc.ml │ ├── reload.ml │ ├── scheduling.ml │ └── selection.ml ├── arm64 │ ├── CSE.ml │ ├── NOTES.md │ ├── arch.ml │ ├── emit.mlp │ ├── proc.ml │ ├── reload.ml │ ├── scheduling.ml │ └── selection.ml ├── asmgen.ml ├── asmgen.mli ├── asmlibrarian.ml ├── asmlibrarian.mli ├── asmlink.ml ├── asmlink.mli ├── asmpackager.ml ├── asmpackager.mli ├── branch_relaxation.ml ├── branch_relaxation.mli ├── branch_relaxation_intf.ml ├── build_export_info.ml ├── build_export_info.mli ├── clambda.ml ├── clambda.mli ├── closure.ml ├── closure.mli ├── closure_offsets.ml ├── closure_offsets.mli ├── cmm.ml ├── cmm.mli ├── cmmgen.ml ├── cmmgen.mli ├── cmx_format.mli ├── coloring.ml ├── coloring.mli ├── comballoc.ml ├── comballoc.mli ├── compilenv.ml ├── compilenv.mli ├── deadcode.ml ├── deadcode.mli ├── emit.mli ├── emitaux.ml ├── emitaux.mli ├── export_info.ml ├── export_info.mli ├── export_info_for_pack.ml ├── export_info_for_pack.mli ├── flambda_to_clambda.ml ├── flambda_to_clambda.mli ├── i386 │ ├── CSE.ml │ ├── NOTES.md │ ├── arch.ml │ ├── emit.mlp │ ├── proc.ml │ ├── reload.ml │ ├── scheduling.ml │ └── selection.ml ├── import_approx.ml ├── import_approx.mli ├── interf.ml ├── interf.mli ├── linearize.ml ├── linearize.mli ├── liveness.ml ├── liveness.mli ├── mach.ml ├── mach.mli ├── power │ ├── CSE.ml │ ├── NOTES.md │ ├── arch.ml │ ├── emit.mlp │ ├── proc.ml │ ├── reload.ml │ ├── scheduling.ml │ └── selection.ml ├── printclambda.ml ├── printclambda.mli ├── printcmm.ml ├── printcmm.mli ├── printlinear.ml ├── printlinear.mli ├── printmach.ml ├── printmach.mli ├── proc.mli ├── reg.ml ├── reg.mli ├── reload.mli ├── reloadgen.ml ├── reloadgen.mli ├── s390x │ ├── CSE.ml │ ├── NOTES.md │ ├── arch.ml │ ├── emit.mlp │ ├── proc.ml │ ├── reload.ml │ ├── scheduling.ml │ └── selection.ml ├── schedgen.ml ├── schedgen.mli ├── scheduling.mli ├── selectgen.ml ├── selectgen.mli ├── selection.mli ├── spacetime_profiling.ml ├── spacetime_profiling.mli ├── sparc │ ├── CSE.ml │ ├── NOTES.md │ ├── arch.ml │ ├── emit.mlp │ ├── proc.ml │ ├── reload.ml │ ├── scheduling.ml │ └── selection.ml ├── spill.ml ├── spill.mli ├── split.ml ├── split.mli ├── strmatch.ml ├── strmatch.mli ├── un_anf.ml ├── un_anf.mli ├── x86_ast.mli ├── x86_dsl.ml ├── x86_dsl.mli ├── x86_gas.ml ├── x86_gas.mli ├── x86_masm.ml ├── x86_masm.mli ├── x86_proc.ml └── x86_proc.mli ├── asmrun ├── .depend ├── Makefile ├── Makefile.nt ├── amd64.S ├── amd64nt.asm ├── arm.S ├── arm64.S ├── backtrace_prim.c ├── clambda_checks.c ├── fail.c ├── i386.S ├── i386nt.asm ├── natdynlink.c ├── power.S ├── roots.c ├── s390x.S ├── signals_asm.c ├── signals_osdep.h ├── spacetime.c ├── spacetime.h ├── spacetime_offline.c ├── spacetime_snapshot.c ├── sparc.S └── startup.c ├── boot ├── ocamlc ├── ocamldep └── ocamllex ├── bytecomp ├── bytegen.ml ├── bytegen.mli ├── bytelibrarian.ml ├── bytelibrarian.mli ├── bytelink.ml ├── bytelink.mli ├── bytepackager.ml ├── bytepackager.mli ├── bytesections.ml ├── bytesections.mli ├── cmo_format.mli ├── cmo_load.ml ├── cmo_load.mli ├── dll.ml ├── dll.mli ├── emitcode.ml ├── emitcode.mli ├── instruct.ml ├── instruct.mli ├── lambda.ml ├── lambda.mli ├── matching.ml ├── matching.mli ├── meta.ml ├── meta.mli ├── printinstr.ml ├── printinstr.mli ├── printlambda.ml ├── printlambda.mli ├── runstatic.ml ├── runstatic.mli ├── runtimedef.mli ├── simplif.ml ├── simplif.mli ├── switch.ml ├── switch.mli ├── symtable.ml ├── symtable.mli ├── translattribute.ml ├── translattribute.mli ├── translclass.ml ├── translclass.mli ├── translcore.ml ├── translcore.mli ├── translmod.ml ├── translmod.mli ├── translobj.ml ├── translobj.mli ├── translquote.ml ├── translquote.mli ├── typeopt.ml └── typeopt.mli ├── byterun ├── .depend ├── Makefile ├── Makefile.common ├── Makefile.nt ├── alloc.c ├── array.c ├── backtrace.c ├── backtrace_prim.c ├── callback.c ├── caml │ ├── address_class.h │ ├── alloc.h │ ├── backtrace.h │ ├── backtrace_prim.h │ ├── callback.h │ ├── compact.h │ ├── compare.h │ ├── compatibility.h │ ├── config.h │ ├── custom.h │ ├── debugger.h │ ├── dynlink.h │ ├── exec.h │ ├── fail.h │ ├── finalise.h │ ├── fix_code.h │ ├── freelist.h │ ├── gc.h │ ├── gc_ctrl.h │ ├── globroots.h │ ├── hash.h │ ├── hooks.h │ ├── instrtrace.h │ ├── instruct.h │ ├── int64_emul.h │ ├── int64_format.h │ ├── int64_native.h │ ├── interp.h │ ├── intext.h │ ├── io.h │ ├── major_gc.h │ ├── md5.h │ ├── memory.h │ ├── minor_gc.h │ ├── misc.h │ ├── mlvalues.h │ ├── osdeps.h │ ├── prims.h │ ├── printexc.h │ ├── reverse.h │ ├── roots.h │ ├── signals.h │ ├── signals_machdep.h │ ├── stack.h │ ├── stacks.h │ ├── startup.h │ ├── startup_aux.h │ ├── sys.h │ ├── ui.h │ └── weak.h ├── compact.c ├── compare.c ├── custom.c ├── debugger.c ├── dynlink.c ├── extern.c ├── fail.c ├── finalise.c ├── fix_code.c ├── floats.c ├── freelist.c ├── gc_ctrl.c ├── globroots.c ├── hash.c ├── instrtrace.c ├── intern.c ├── interp.c ├── ints.c ├── io.c ├── lexing.c ├── main.c ├── major_gc.c ├── md5.c ├── memory.c ├── meta.c ├── minor_gc.c ├── misc.c ├── obj.c ├── parsing.c ├── printexc.c ├── roots.c ├── signals.c ├── signals_byt.c ├── spacetime.c ├── spacetime.h ├── stacks.c ├── startup.c ├── startup_aux.c ├── str.c ├── sys.c ├── terminfo.c ├── unix.c ├── weak.c └── win32.c ├── compilerlibs └── .gitignore ├── config ├── Makefile-templ ├── Makefile.mingw ├── Makefile.mingw64 ├── Makefile.msvc ├── Makefile.msvc64 ├── auto-aux │ ├── align.c │ ├── ansi.c │ ├── async_io.c │ ├── cckind.c │ ├── cfi.S │ ├── dblalign.c │ ├── elf.c │ ├── endian.c │ ├── getgroups.c │ ├── gethostbyaddr.c │ ├── gethostbyname.c │ ├── hasgot │ ├── hasgot2 │ ├── hashbang │ ├── hashbang2 │ ├── ia32sse2.c │ ├── initgroups.c │ ├── int64align.c │ ├── mmap-huge.c │ ├── nanosecond_stat.c │ ├── runtest │ ├── searchpath │ ├── setgroups.c │ ├── signals.c │ ├── sizes.c │ ├── solaris-ld │ ├── tryassemble │ └── trycompile ├── gnu │ ├── config.guess │ └── config.sub ├── m-nt.h ├── m-templ.h ├── s-nt.h └── s-templ.h ├── configure ├── debugger ├── .depend ├── Makefile ├── Makefile.nt ├── Makefile.shared ├── breakpoints.ml ├── breakpoints.mli ├── checkpoints.ml ├── checkpoints.mli ├── command_line.ml ├── command_line.mli ├── debugcom.ml ├── debugcom.mli ├── debugger_config.ml ├── debugger_config.mli ├── eval.ml ├── eval.mli ├── events.ml ├── events.mli ├── exec.ml ├── exec.mli ├── frames.ml ├── frames.mli ├── history.ml ├── history.mli ├── input_handling.ml ├── input_handling.mli ├── int64ops.ml ├── int64ops.mli ├── lexer.mli ├── lexer.mll ├── loadprinter.ml ├── loadprinter.mli ├── main.ml ├── parameters.ml ├── parameters.mli ├── parser.mly ├── parser_aux.mli ├── pattern_matching.ml ├── pattern_matching.mli ├── pos.ml ├── pos.mli ├── primitives.ml ├── primitives.mli ├── printval.ml ├── printval.mli ├── program_loading.ml ├── program_loading.mli ├── program_management.ml ├── program_management.mli ├── question.ml ├── question.mli ├── show_information.ml ├── show_information.mli ├── show_source.ml ├── show_source.mli ├── source.ml ├── source.mli ├── symbols.ml ├── symbols.mli ├── time_travel.ml ├── time_travel.mli ├── trap_barrier.ml ├── trap_barrier.mli ├── unix_tools.ml └── unix_tools.mli ├── driver ├── compdynlink.mlno ├── compenv.ml ├── compenv.mli ├── compile.ml ├── compile.mli ├── compmisc.ml ├── compmisc.mli ├── compplugin.ml ├── compplugin.mli ├── errors.ml ├── errors.mli ├── main.ml ├── main.mli ├── main_args.ml ├── main_args.mli ├── ocamlcomp.sh.in ├── optcompile.ml ├── optcompile.mli ├── opterrors.ml ├── opterrors.mli ├── optmain.ml ├── optmain.mli ├── pparse.ml └── pparse.mli ├── emacs ├── COPYING ├── Makefile ├── README ├── README.itz ├── caml-compat.el ├── caml-emacs.el ├── caml-font-old.el ├── caml-font.el ├── caml-help.el ├── caml-hilit.el ├── caml-types.el ├── caml-xemacs.el ├── caml.el ├── camldebug.el ├── inf-caml.el └── ocamltags.in ├── experimental ├── doligez │ ├── check-bounds.diff │ └── checkheaders ├── frisch │ ├── Makefile │ ├── copy_typedef.ml │ ├── eval.ml │ ├── extension_points.txt │ ├── ifdef.ml │ ├── js_syntax.ml │ ├── metaquot_test.ml │ ├── minidoc.ml │ ├── nomli.ml │ ├── ppx_builder.ml │ ├── ppx_matches.ml │ ├── test_builder.ml │ ├── test_copy_typedef.ml │ ├── test_copy_typedef.mli │ ├── test_eval.ml │ ├── test_ifdef.ml │ ├── test_js.ml │ ├── test_matches.ml │ ├── test_nomli.ml │ ├── testdoc.mli │ └── unused_exported_values.ml └── garrigue │ ├── .cvsignore │ ├── caml_set_oid.diff │ ├── coerce.diff │ ├── countchars.ml │ ├── dirs_multimatch │ ├── dirs_poly │ ├── fixedtypes.ml │ ├── gadt-escape-check.diff │ ├── generative-functors.diff │ ├── impure-functors.diff │ ├── marshal_objects.diff │ ├── module-errors.diff │ ├── multimatch.diff │ ├── multimatch.ml │ ├── newlabels.ps │ ├── nongeneral-let.diff │ ├── objvariant.diff │ ├── objvariant.ml │ ├── parser-lessminus.diff │ ├── pattern-local-types.diff │ ├── printers.ml │ ├── propagation-to-patterns.diff │ ├── show_types.diff │ ├── tests.ml │ ├── valvirt.diff │ ├── variable-names-Tvar.diff │ ├── variable-names.ml │ ├── varunion.ml │ └── with-module-type.diff ├── lex ├── .depend ├── Makefile ├── Makefile.nt ├── common.ml ├── common.mli ├── compact.ml ├── compact.mli ├── cset.ml ├── cset.mli ├── lexer.mli ├── lexer.mll ├── lexgen.ml ├── lexgen.mli ├── main.ml ├── output.ml ├── output.mli ├── outputbis.ml ├── outputbis.mli ├── parser.mly ├── syntax.ml ├── syntax.mli ├── table.ml └── table.mli ├── man ├── Makefile ├── ocaml.m ├── ocamlc.m ├── ocamlcp.m ├── ocamldebug.m ├── ocamldep.m ├── ocamldoc.m ├── ocamllex.m ├── ocamlmktop.m ├── ocamlopt.m ├── ocamlprof.m ├── ocamlrun.m └── ocamlyacc.m ├── manual ├── LICENSE-for-the-manual ├── Makefile ├── README.md ├── manual │ ├── .gitignore │ ├── Makefile │ ├── allfiles.etex │ ├── biblio.etex │ ├── cmds │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── browser.etex │ │ ├── comp.etex │ │ ├── debugger.etex │ │ ├── depend.etex │ │ ├── flambda.etex │ │ ├── intf-c.etex │ │ ├── lexyacc.etex │ │ ├── native.etex │ │ ├── ocamlbuild.etex │ │ ├── ocamldoc.etex │ │ ├── profil.etex │ │ ├── runtime.etex │ │ └── top.etex │ ├── foreword.etex │ ├── htmlman │ │ ├── .gitignore │ │ ├── contents_motif.gif │ │ ├── libgraph.gif │ │ ├── next_motif.gif │ │ └── previous_motif.gif │ ├── index.tex │ ├── infoman │ │ └── .gitignore │ ├── labltk.tex │ ├── library │ │ ├── .cvsignore │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── builtin.etex │ │ ├── check-stdlib-modules │ │ ├── compilerlibs.etex │ │ ├── core.etex │ │ ├── libbigarray.etex │ │ ├── libdynlink.etex │ │ ├── libgraph.etex │ │ ├── libgraph.fig │ │ ├── libgraph.png │ │ ├── liblabltk.etex │ │ ├── libnum.etex │ │ ├── libstr.etex │ │ ├── libthreads.etex │ │ ├── libunix.etex │ │ ├── stdlib.etex │ │ └── tk.mli │ ├── macros.hva │ ├── macros.tex │ ├── manual.hva │ ├── manual.inf │ ├── manual.info.header │ ├── manual.tex │ ├── pdfmanual.tex │ ├── plaintext.tex │ ├── refman │ │ ├── .cvsignore │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── classes.etex │ │ ├── compunit.etex │ │ ├── const.etex │ │ ├── directive.etex │ │ ├── expr.etex │ │ ├── exten.etex │ │ ├── impl.etex │ │ ├── intf.etex │ │ ├── lex.etex │ │ ├── modtypes.etex │ │ ├── modules.etex │ │ ├── names.etex │ │ ├── patterns.etex │ │ ├── refman.etex │ │ ├── typedecl.etex │ │ ├── types.etex │ │ └── values.etex │ ├── style.css │ ├── texstuff │ │ ├── .cvsignore │ │ └── .gitignore │ ├── textman │ │ ├── .cvsignore │ │ └── .gitignore │ └── tutorials │ │ ├── .cvsignore │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── advexamples.etex │ │ ├── coreexamples.etex │ │ ├── lablexamples.etex │ │ ├── moduleexamples.etex │ │ └── objectexamples.etex ├── styles │ ├── altindex.sty │ ├── caml-sl.sty │ ├── caml.sty │ ├── doc.tfm │ ├── docbf.tfm │ ├── docit.tfm │ ├── docmi.tfm │ ├── docrm.tfm │ ├── doctt.tfm │ ├── fullpage.sty │ ├── html.sty │ ├── isolatin.sty │ ├── multicols.sty │ ├── multind.sty │ ├── ocamldoc.hva │ ├── ocamldoc.sty │ ├── plaintext.sty │ ├── scroll.sty │ ├── syntaxdef.hva │ ├── syntaxdef.sty │ └── syntaxdeftxt.sty └── tools │ ├── .gitignore │ ├── .ignore │ ├── Makefile │ ├── caml-tex │ ├── caml_tex2.ml │ ├── dvi_to_txt │ ├── Makefile │ ├── dvi.h │ ├── interp.c │ ├── io.c │ ├── io.h │ ├── main.c │ ├── output.c │ ├── output.h │ ├── print.c │ ├── print_rtf.c │ └── print_styl.c │ ├── fix_index.sh │ ├── format-intf │ ├── htmlcut │ ├── htmlquote.c │ ├── htmltbl │ ├── htmlthread │ ├── htmltransf.mll │ ├── latexmacros.ml │ ├── latexmacros.mli │ ├── latexmain.ml │ ├── latexscan.mll │ ├── texexpand │ ├── texquote2.c │ ├── transf.mll │ └── transfmain.ml ├── middle_end ├── alias_analysis.ml ├── alias_analysis.mli ├── allocated_const.ml ├── allocated_const.mli ├── augment_specialised_args.ml ├── augment_specialised_args.mli ├── backend_intf.mli ├── base_types │ ├── closure_element.ml │ ├── closure_element.mli │ ├── closure_id.ml │ ├── closure_id.mli │ ├── compilation_unit.ml │ ├── compilation_unit.mli │ ├── export_id.ml │ ├── export_id.mli │ ├── id_types.ml │ ├── id_types.mli │ ├── linkage_name.ml │ ├── linkage_name.mli │ ├── mutable_variable.ml │ ├── mutable_variable.mli │ ├── set_of_closures_id.ml │ ├── set_of_closures_id.mli │ ├── set_of_closures_origin.ml │ ├── set_of_closures_origin.mli │ ├── static_exception.ml │ ├── static_exception.mli │ ├── symbol.ml │ ├── symbol.mli │ ├── tag.ml │ ├── tag.mli │ ├── var_within_closure.ml │ ├── var_within_closure.mli │ ├── variable.ml │ └── variable.mli ├── closure_conversion.ml ├── closure_conversion.mli ├── closure_conversion_aux.ml ├── closure_conversion_aux.mli ├── debuginfo.ml ├── debuginfo.mli ├── effect_analysis.ml ├── effect_analysis.mli ├── extract_projections.ml ├── extract_projections.mli ├── find_recursive_functions.ml ├── find_recursive_functions.mli ├── flambda.ml ├── flambda.mli ├── flambda_invariants.ml ├── flambda_invariants.mli ├── flambda_iterators.ml ├── flambda_iterators.mli ├── flambda_utils.ml ├── flambda_utils.mli ├── freshening.ml ├── freshening.mli ├── inconstant_idents.ml ├── inconstant_idents.mli ├── initialize_symbol_to_let_symbol.ml ├── initialize_symbol_to_let_symbol.mli ├── inline_and_simplify.ml ├── inline_and_simplify.mli ├── inline_and_simplify_aux.ml ├── inline_and_simplify_aux.mli ├── inlining_cost.ml ├── inlining_cost.mli ├── inlining_decision.ml ├── inlining_decision.mli ├── inlining_decision_intf.mli ├── inlining_stats.ml ├── inlining_stats.mli ├── inlining_stats_types.ml ├── inlining_stats_types.mli ├── inlining_transforms.ml ├── inlining_transforms.mli ├── invariant_params.ml ├── invariant_params.mli ├── lift_code.ml ├── lift_code.mli ├── lift_constants.ml ├── lift_constants.mli ├── lift_let_to_initialize_symbol.ml ├── lift_let_to_initialize_symbol.mli ├── middle_end.ml ├── middle_end.mli ├── pass_wrapper.ml ├── pass_wrapper.mli ├── projection.ml ├── projection.mli ├── ref_to_variables.ml ├── ref_to_variables.mli ├── remove_free_vars_equal_to_args.ml ├── remove_free_vars_equal_to_args.mli ├── remove_unused_arguments.ml ├── remove_unused_arguments.mli ├── remove_unused_closure_vars.ml ├── remove_unused_closure_vars.mli ├── remove_unused_program_constructs.ml ├── remove_unused_program_constructs.mli ├── semantics_of_primitives.ml ├── semantics_of_primitives.mli ├── share_constants.ml ├── share_constants.mli ├── simple_value_approx.ml ├── simple_value_approx.mli ├── simplify_boxed_integer_ops.ml ├── simplify_boxed_integer_ops.mli ├── simplify_boxed_integer_ops_intf.mli ├── simplify_common.ml ├── simplify_common.mli ├── simplify_primitives.ml ├── simplify_primitives.mli ├── unbox_closures.ml ├── unbox_closures.mli ├── unbox_free_vars_of_closures.ml ├── unbox_free_vars_of_closures.mli ├── unbox_specialised_args.ml └── unbox_specialised_args.mli ├── ocamldoc ├── .depend ├── Changes.txt ├── Makefile ├── Makefile.nt ├── generators │ ├── odoc_literate.ml │ └── odoc_todo.ml ├── ocamldoc.hva ├── ocamldoc.sty ├── odoc.ml ├── odoc_analyse.ml ├── odoc_analyse.mli ├── odoc_args.ml ├── odoc_args.mli ├── odoc_ast.ml ├── odoc_ast.mli ├── odoc_class.ml ├── odoc_comments.ml ├── odoc_comments.mli ├── odoc_comments_global.ml ├── odoc_comments_global.mli ├── odoc_config.ml ├── odoc_config.mli ├── odoc_control.ml ├── odoc_cross.ml ├── odoc_cross.mli ├── odoc_dag2html.ml ├── odoc_dag2html.mli ├── odoc_dep.ml ├── odoc_dot.ml ├── odoc_env.ml ├── odoc_env.mli ├── odoc_exception.ml ├── odoc_extension.ml ├── odoc_gen.ml ├── odoc_gen.mli ├── odoc_global.ml ├── odoc_global.mli ├── odoc_html.ml ├── odoc_info.ml ├── odoc_info.mli ├── odoc_inherit.ml ├── odoc_latex.ml ├── odoc_latex_style.ml ├── odoc_lexer.mll ├── odoc_man.ml ├── odoc_merge.ml ├── odoc_merge.mli ├── odoc_messages.ml ├── odoc_misc.ml ├── odoc_misc.mli ├── odoc_module.ml ├── odoc_name.ml ├── odoc_name.mli ├── odoc_ocamlhtml.mll ├── odoc_parameter.ml ├── odoc_parser.mly ├── odoc_print.ml ├── odoc_print.mli ├── odoc_scan.ml ├── odoc_search.ml ├── odoc_search.mli ├── odoc_see_lexer.mll ├── odoc_sig.ml ├── odoc_sig.mli ├── odoc_str.ml ├── odoc_str.mli ├── odoc_test.ml ├── odoc_texi.ml ├── odoc_text.ml ├── odoc_text.mli ├── odoc_text_lexer.mll ├── odoc_text_parser.mly ├── odoc_to_text.ml ├── odoc_type.ml ├── odoc_types.ml ├── odoc_types.mli ├── odoc_value.ml └── remove_DEBUG ├── otherlibs ├── Makefile ├── bigarray │ ├── .depend │ ├── Makefile │ ├── Makefile.nt │ ├── Makefile.shared │ ├── bigarray.h │ ├── bigarray.ml │ ├── bigarray.mli │ ├── bigarray_stubs.c │ ├── mmap_unix.c │ └── mmap_win32.c ├── dynlink │ ├── Makefile │ ├── Makefile.nt │ ├── dynlink.ml │ ├── dynlink.mli │ ├── extract_crc.ml │ └── natdynlink.ml ├── graph │ ├── .depend │ ├── Makefile │ ├── color.c │ ├── draw.c │ ├── dump_img.c │ ├── events.c │ ├── fill.c │ ├── graphics.ml │ ├── graphics.mli │ ├── graphicsX11.ml │ ├── graphicsX11.mli │ ├── image.c │ ├── image.h │ ├── libgraph.h │ ├── make_img.c │ ├── open.c │ ├── point_col.c │ ├── sound.c │ ├── subwindow.c │ └── text.c ├── num │ ├── .depend │ ├── .depend.nt │ ├── Makefile │ ├── Makefile.nt │ ├── Makefile.shared │ ├── README │ ├── arith_flags.ml │ ├── arith_flags.mli │ ├── arith_status.ml │ ├── arith_status.mli │ ├── big_int.ml │ ├── big_int.mli │ ├── bng.c │ ├── bng.h │ ├── bng_amd64.c │ ├── bng_arm64.c │ ├── bng_digit.c │ ├── bng_ia32.c │ ├── bng_ppc.c │ ├── bng_sparc.c │ ├── int_misc.ml │ ├── int_misc.mli │ ├── nat.h │ ├── nat.ml │ ├── nat.mli │ ├── nat_stubs.c │ ├── num.ml │ ├── num.mli │ ├── ratio.ml │ └── ratio.mli ├── raw_spacetime_lib │ ├── .depend │ ├── Makefile │ ├── Makefile.nt │ ├── Makefile.shared │ ├── raw_spacetime_lib.ml │ └── raw_spacetime_lib.mli ├── str │ ├── .depend │ ├── Makefile │ ├── Makefile.nt │ ├── Makefile.shared │ ├── str.ml │ ├── str.mli │ └── strstubs.c ├── systhreads │ ├── .depend │ ├── Makefile │ ├── Makefile.nt │ ├── condition.ml │ ├── condition.mli │ ├── event.ml │ ├── event.mli │ ├── mutex.ml │ ├── mutex.mli │ ├── st_posix.h │ ├── st_stubs.c │ ├── st_win32.h │ ├── thread.ml │ ├── thread.mli │ ├── threadUnix.ml │ ├── threadUnix.mli │ └── threads.h ├── threads │ ├── .depend │ ├── Makefile │ ├── condition.ml │ ├── condition.mli │ ├── event.ml │ ├── event.mli │ ├── marshal.ml │ ├── mutex.ml │ ├── mutex.mli │ ├── pervasives.ml │ ├── scheduler.c │ ├── thread.ml │ ├── thread.mli │ ├── threadUnix.ml │ ├── threadUnix.mli │ └── unix.ml ├── unix │ ├── .depend │ ├── Makefile │ ├── accept.c │ ├── access.c │ ├── addrofstr.c │ ├── alarm.c │ ├── bind.c │ ├── chdir.c │ ├── chmod.c │ ├── chown.c │ ├── chroot.c │ ├── close.c │ ├── closedir.c │ ├── connect.c │ ├── cst2constr.c │ ├── cst2constr.h │ ├── cstringv.c │ ├── dup.c │ ├── dup2.c │ ├── envir.c │ ├── errmsg.c │ ├── execv.c │ ├── execve.c │ ├── execvp.c │ ├── exit.c │ ├── fchmod.c │ ├── fchown.c │ ├── fcntl.c │ ├── fork.c │ ├── ftruncate.c │ ├── getaddrinfo.c │ ├── getcwd.c │ ├── getegid.c │ ├── geteuid.c │ ├── getgid.c │ ├── getgr.c │ ├── getgroups.c │ ├── gethost.c │ ├── gethostname.c │ ├── getlogin.c │ ├── getnameinfo.c │ ├── getpeername.c │ ├── getpid.c │ ├── getppid.c │ ├── getproto.c │ ├── getpw.c │ ├── getserv.c │ ├── getsockname.c │ ├── gettimeofday.c │ ├── getuid.c │ ├── gmtime.c │ ├── initgroups.c │ ├── isatty.c │ ├── itimer.c │ ├── kill.c │ ├── link.c │ ├── listen.c │ ├── lockf.c │ ├── lseek.c │ ├── mkdir.c │ ├── mkfifo.c │ ├── nanosecond_stat.h │ ├── nice.c │ ├── open.c │ ├── opendir.c │ ├── pipe.c │ ├── putenv.c │ ├── read.c │ ├── readdir.c │ ├── readlink.c │ ├── rename.c │ ├── rewinddir.c │ ├── rmdir.c │ ├── select.c │ ├── sendrecv.c │ ├── setgid.c │ ├── setgroups.c │ ├── setsid.c │ ├── setuid.c │ ├── shutdown.c │ ├── signals.c │ ├── sleep.c │ ├── socket.c │ ├── socketaddr.c │ ├── socketaddr.h │ ├── socketpair.c │ ├── sockopt.c │ ├── stat.c │ ├── strofaddr.c │ ├── symlink.c │ ├── termios.c │ ├── time.c │ ├── times.c │ ├── truncate.c │ ├── umask.c │ ├── unix.ml │ ├── unix.mli │ ├── unixLabels.ml │ ├── unixLabels.mli │ ├── unixsupport.c │ ├── unixsupport.h │ ├── unlink.c │ ├── utimes.c │ ├── wait.c │ └── write.c ├── win32graph │ ├── Makefile.nt │ ├── dib.c │ ├── draw.c │ ├── events.c │ ├── libgraph.h │ └── open.c └── win32unix │ ├── .depend │ ├── Makefile.nt │ ├── accept.c │ ├── bind.c │ ├── channels.c │ ├── close.c │ ├── close_on.c │ ├── connect.c │ ├── createprocess.c │ ├── dup.c │ ├── dup2.c │ ├── errmsg.c │ ├── getpeername.c │ ├── getpid.c │ ├── getsockname.c │ ├── gettimeofday.c │ ├── link.c │ ├── listen.c │ ├── lockf.c │ ├── lseek.c │ ├── mkdir.c │ ├── nonblock.c │ ├── open.c │ ├── pipe.c │ ├── read.c │ ├── readlink.c │ ├── rename.c │ ├── select.c │ ├── sendrecv.c │ ├── shutdown.c │ ├── sleep.c │ ├── socket.c │ ├── socketaddr.h │ ├── sockopt.c │ ├── startup.c │ ├── stat.c │ ├── symlink.c │ ├── system.c │ ├── times.c │ ├── unix.ml │ ├── unixsupport.c │ ├── unixsupport.h │ ├── windbug.c │ ├── windbug.h │ ├── windir.c │ ├── winlist.c │ ├── winlist.h │ ├── winwait.c │ ├── winworker.c │ ├── winworker.h │ └── write.c ├── parsing ├── ast_helper.ml ├── ast_helper.mli ├── ast_invariants.ml ├── ast_invariants.mli ├── ast_iterator.ml ├── ast_iterator.mli ├── ast_mapper.ml ├── ast_mapper.mli ├── asttypes.mli ├── attr_helper.ml ├── attr_helper.mli ├── builtin_attributes.ml ├── builtin_attributes.mli ├── depend.ml ├── depend.mli ├── docstrings.ml ├── docstrings.mli ├── lexer.mli ├── lexer.mll ├── location.ml ├── location.mli ├── longident.ml ├── longident.mli ├── parse.ml ├── parse.mli ├── parser.mly ├── parsetree.mli ├── pprintast.ml ├── pprintast.mli ├── printast.ml ├── printast.mli ├── syntaxerr.ml └── syntaxerr.mli ├── stdlib ├── .depend ├── Compflags ├── Makefile ├── Makefile.nt ├── Makefile.shared ├── StdlibModules ├── arg.ml ├── arg.mli ├── array.ml ├── array.mli ├── arrayLabels.ml ├── arrayLabels.mli ├── buffer.ml ├── buffer.mli ├── bytes.ml ├── bytes.mli ├── bytesLabels.ml ├── bytesLabels.mli ├── callback.ml ├── callback.mli ├── camlinternalAST.mli ├── camlinternalFormat.ml ├── camlinternalFormat.mli ├── camlinternalFormatBasics.ml ├── camlinternalFormatBasics.mli ├── camlinternalLazy.ml ├── camlinternalLazy.mli ├── camlinternalMod.ml ├── camlinternalMod.mli ├── camlinternalOO.ml ├── camlinternalOO.mli ├── camlinternalQuote.ml ├── camlinternalQuote.mli ├── char.ml ├── char.mli ├── complex.ml ├── complex.mli ├── digest.ml ├── digest.mli ├── ephemeron.ml ├── ephemeron.mli ├── expr.ml ├── expr.mli ├── filename.ml ├── filename.mli ├── format.ml ├── format.mli ├── gc.ml ├── gc.mli ├── genlex.ml ├── genlex.mli ├── hashbang ├── hashtbl.ml ├── hashtbl.mli ├── header.c ├── headernt.c ├── int32.ml ├── int32.mli ├── int64.ml ├── int64.mli ├── lazy.ml ├── lazy.mli ├── lexing.ml ├── lexing.mli ├── list.ml ├── list.mli ├── listLabels.ml ├── listLabels.mli ├── map.ml ├── map.mli ├── marshal.ml ├── marshal.mli ├── moreLabels.ml ├── moreLabels.mli ├── nativeint.ml ├── nativeint.mli ├── obj.ml ├── obj.mli ├── oo.ml ├── oo.mli ├── parsing.ml ├── parsing.mli ├── pervasives.ml ├── pervasives.mli ├── printexc.ml ├── printexc.mli ├── printf.ml ├── printf.mli ├── queue.ml ├── queue.mli ├── random.ml ├── random.mli ├── scanf.ml ├── scanf.mli ├── set.ml ├── set.mli ├── sort.ml ├── sort.mli ├── spacetime.ml ├── spacetime.mli ├── stack.ml ├── stack.mli ├── stdLabels.ml ├── stdLabels.mli ├── std_exit.ml ├── stream.ml ├── stream.mli ├── string.ml ├── string.mli ├── stringLabels.ml ├── stringLabels.mli ├── sys.mli ├── sys.mlp ├── uchar.ml ├── uchar.mli ├── weak.ml └── weak.mli ├── testsuite ├── Makefile ├── interactive │ ├── lib-gc │ │ ├── Makefile │ │ └── alloc.ml │ ├── lib-graph-2 │ │ ├── Makefile │ │ ├── graph_test.ml │ │ └── graph_test.reference │ ├── lib-graph-3 │ │ ├── Makefile │ │ ├── sorts.ml │ │ └── sorts.reference │ ├── lib-graph │ │ ├── Makefile │ │ ├── graph_example.ml │ │ └── graph_example.reference │ └── lib-signals │ │ ├── Makefile │ │ └── signals.ml ├── lib │ ├── Makefile │ ├── testing.ml │ └── testing.mli ├── makefiles │ ├── Makefile.common │ ├── Makefile.dlambda │ ├── Makefile.dparsetree │ ├── Makefile.expect │ ├── Makefile.okbad │ ├── Makefile.one │ ├── Makefile.several │ ├── Makefile.toplevel │ └── summarize.awk ├── tests │ ├── array-functions │ │ ├── Makefile │ │ ├── test.ml │ │ └── test.reference │ ├── asmcomp │ │ ├── Makefile │ │ ├── alpha.S │ │ ├── amd64.S │ │ ├── arith.cmm │ │ ├── arm.S │ │ ├── arm64.S │ │ ├── bind_tuples.ml │ │ ├── checkbound.cmm │ │ ├── fib.cmm │ │ ├── hppa.S │ │ ├── i386.S │ │ ├── i386nt.asm │ │ ├── ia64.S │ │ ├── integr.cmm │ │ ├── is_in_static_data.c │ │ ├── is_static.ml │ │ ├── is_static_flambda.ml │ │ ├── is_static_flambda_dep.ml │ │ ├── lexcmm.mli │ │ ├── lexcmm.mll │ │ ├── m68k.S │ │ ├── main.c │ │ ├── main.ml │ │ ├── mainarith.c │ │ ├── mips.s │ │ ├── optargs.ml │ │ ├── parsecmm.mly │ │ ├── parsecmmaux.ml │ │ ├── parsecmmaux.mli │ │ ├── power.S │ │ ├── quicksort.cmm │ │ ├── quicksort2.cmm │ │ ├── register_typing.ml │ │ ├── register_typing_switch.ml │ │ ├── s390x.S │ │ ├── soli.cmm │ │ ├── sparc.S │ │ ├── staticalloc.ml │ │ ├── tagged-fib.cmm │ │ ├── tagged-integr.cmm │ │ ├── tagged-quicksort.cmm │ │ ├── tagged-tak.cmm │ │ ├── tak.cmm │ │ ├── unrolling_flambda.ml │ │ └── unrolling_flambda2.ml │ ├── ast-invariants │ │ ├── Makefile │ │ ├── test.ml │ │ └── test.reference │ ├── backtrace │ │ ├── Makefile │ │ ├── backtrace..byte.reference │ │ ├── backtrace..native.reference │ │ ├── backtrace.a.byte.reference │ │ ├── backtrace.a.native.reference │ │ ├── backtrace.b.byte.reference │ │ ├── backtrace.b.native.reference │ │ ├── backtrace.c.byte.reference │ │ ├── backtrace.c.native.reference │ │ ├── backtrace.d.byte.reference │ │ ├── backtrace.d.native.reference │ │ ├── backtrace.ml │ │ ├── backtrace2.byte.reference │ │ ├── backtrace2.ml │ │ ├── backtrace2.native.reference │ │ ├── backtrace3.byte.reference │ │ ├── backtrace3.ml │ │ ├── backtrace3.native.reference │ │ ├── backtrace_deprecated.byte.reference │ │ ├── backtrace_deprecated.ml │ │ ├── backtrace_deprecated.native.reference │ │ ├── backtrace_slots.byte.reference │ │ ├── backtrace_slots.ml │ │ ├── backtrace_slots.native.reference │ │ ├── backtraces_and_finalizers.ml │ │ ├── backtraces_and_finalizers.native.reference │ │ ├── inline_test.byte.reference │ │ ├── inline_test.ml │ │ ├── inline_test.native.reference │ │ ├── inline_traversal_test.byte.reference │ │ ├── inline_traversal_test.ml │ │ ├── inline_traversal_test.native.reference │ │ ├── pr6920_why_at.byte.reference │ │ ├── pr6920_why_at.ml │ │ ├── pr6920_why_at.native.reference │ │ ├── pr6920_why_swallow.byte.reference │ │ ├── pr6920_why_swallow.ml │ │ ├── pr6920_why_swallow.native.reference │ │ ├── raw_backtrace.byte.reference │ │ ├── raw_backtrace.ml │ │ └── raw_backtrace.native.reference │ ├── basic-float │ │ ├── Makefile │ │ ├── tfloat_hex.ml │ │ ├── tfloat_hex.reference │ │ ├── tfloat_record.ml │ │ └── tfloat_record.reference │ ├── basic-io-2 │ │ ├── Makefile │ │ ├── io.ml │ │ ├── io.reference │ │ └── test-file-short-lines │ ├── basic-io │ │ ├── Makefile │ │ ├── wc.ml │ │ └── wc.reference │ ├── basic-manyargs │ │ ├── Makefile │ │ ├── manyargs.ml │ │ ├── manyargs.reference │ │ └── manyargsprim.c │ ├── basic-modules │ │ ├── Makefile │ │ ├── main.ml │ │ ├── main.mli │ │ ├── main.reference │ │ ├── offset.ml │ │ └── pr6726.ml │ ├── basic-more │ │ ├── Makefile │ │ ├── bounds.ml │ │ ├── bounds.reference │ │ ├── function_in_ref.ml │ │ ├── function_in_ref.reference │ │ ├── if_in_if.ml │ │ ├── if_in_if.reference │ │ ├── morematch.ml │ │ ├── morematch.reference │ │ ├── opaque_prim.ml │ │ ├── opaque_prim.reference │ │ ├── pr2719.ml │ │ ├── pr2719.reference │ │ ├── pr6216.ml │ │ ├── pr6216.reference │ │ ├── record_evaluation_order.ml │ │ ├── record_evaluation_order.reference │ │ ├── sequential_and_or.ml │ │ ├── sequential_and_or.reference │ │ ├── tbuffer.ml │ │ ├── tbuffer.reference │ │ ├── testrandom.ml │ │ ├── testrandom.reference │ │ ├── tformat.ml │ │ ├── tformat.reference │ │ ├── top_level_patterns.ml │ │ ├── top_level_patterns.reference │ │ ├── tprintf.ml │ │ └── tprintf.reference │ ├── basic-multdef │ │ ├── Makefile │ │ ├── multdef.ml │ │ ├── multdef.mli │ │ ├── usemultdef.ml │ │ └── usemultdef.reference │ ├── basic-private │ │ ├── Makefile │ │ ├── length.ml │ │ ├── length.mli │ │ ├── tlength.ml │ │ └── tlength.reference │ ├── basic │ │ ├── Makefile │ │ ├── arrays.ml │ │ ├── arrays.reference │ │ ├── bigints.ml │ │ ├── bigints.reference │ │ ├── boxedints.ml │ │ ├── boxedints.reference │ │ ├── constprop.ml │ │ ├── constprop.mlp │ │ ├── constprop.reference │ │ ├── divint.ml │ │ ├── divint.reference │ │ ├── equality.ml │ │ ├── equality.reference │ │ ├── float.ml │ │ ├── float.reference │ │ ├── float_physical_equality.ml │ │ ├── float_physical_equality.reference │ │ ├── includestruct.ml │ │ ├── includestruct.reference │ │ ├── localexn.ml │ │ ├── localexn.reference │ │ ├── maps.ml │ │ ├── maps.reference │ │ ├── min_int.ml │ │ ├── min_int.reference │ │ ├── patmatch.ml │ │ ├── patmatch.reference │ │ ├── recvalues.ml │ │ ├── recvalues.reference │ │ ├── sets.ml │ │ ├── sets.reference │ │ ├── stringmatch.ml │ │ ├── stringmatch.reference │ │ ├── tailcalls.ml │ │ └── tailcalls.reference │ ├── callback │ │ ├── Makefile │ │ ├── callbackprim.c │ │ ├── reference │ │ └── tcallback.ml │ ├── docstrings │ │ ├── Makefile │ │ ├── empty.ml │ │ └── empty.ml.reference │ ├── embedded │ │ ├── Makefile │ │ ├── cmcaml.ml │ │ ├── cmmain.c │ │ ├── cmstub.c │ │ └── program.reference │ ├── exotic-syntax │ │ ├── Makefile │ │ ├── exotic.ml │ │ └── exotic.reference │ ├── extension-constructor │ │ ├── Makefile │ │ ├── test.ml │ │ └── test.reference │ ├── float-unboxing │ │ ├── Makefile │ │ ├── float_subst_boxed_number.ml │ │ └── float_subst_boxed_number.reference │ ├── formats-transition │ │ ├── Makefile │ │ ├── deprecated_unsigned_printers.ml │ │ ├── deprecated_unsigned_printers.ml.reference │ │ ├── ignored_scan_counters.ml │ │ ├── ignored_scan_counters.ml.reference │ │ ├── legacy_incompatible_flags.ml │ │ ├── legacy_incompatible_flags.ml.reference │ │ ├── legacy_unfinished_modifiers.ml │ │ └── legacy_unfinished_modifiers.ml.reference │ ├── formatting │ │ ├── Makefile │ │ ├── margins.ml │ │ └── margins.ml.reference │ ├── gc-roots │ │ ├── Makefile │ │ ├── globroots.ml │ │ ├── globroots.reference │ │ └── globrootsprim.c │ ├── int64-unboxing │ │ ├── Makefile │ │ ├── stubs.c │ │ ├── test.ml │ │ └── test.reference │ ├── lazy │ │ ├── Makefile │ │ ├── lazy1.ml │ │ └── lazy1.reference │ ├── letrec │ │ ├── Makefile │ │ ├── backreferences.ml │ │ ├── backreferences.reference │ │ ├── class_1.ml │ │ ├── class_1.reference │ │ ├── class_2.ml │ │ ├── class_2.reference │ │ ├── evaluation_order_1.ml │ │ ├── evaluation_order_1.reference │ │ ├── evaluation_order_2.ml │ │ ├── evaluation_order_2.reference │ │ ├── evaluation_order_3.ml │ │ ├── evaluation_order_3.reference │ │ ├── float_block_1.ml │ │ ├── float_block_1.reference │ │ ├── float_block_2.ml │ │ ├── float_block_2.reference │ │ ├── lists.ml │ │ ├── lists.reference │ │ ├── mixing_value_closures_1.ml │ │ ├── mixing_value_closures_1.reference │ │ ├── mixing_value_closures_2.ml │ │ ├── mixing_value_closures_2.reference │ │ ├── mutual_functions.ml │ │ ├── mutual_functions.reference │ │ ├── record_with.ml │ │ └── record_with.reference │ ├── lib-arg │ │ ├── Makefile │ │ ├── testarg.ml │ │ └── testarg.reference │ ├── lib-bigarray-2 │ │ ├── Makefile │ │ ├── bigarrf.f │ │ ├── bigarrfml.ml │ │ ├── bigarrfml.reference │ │ └── bigarrfstub.c │ ├── lib-bigarray │ │ ├── Makefile │ │ ├── bigarrays.ml │ │ ├── bigarrays.reference │ │ ├── fftba.ml │ │ ├── fftba.reference │ │ ├── pr5115.ml │ │ └── pr5115.reference │ ├── lib-digest │ │ ├── Makefile │ │ ├── md5.ml │ │ └── md5.reference │ ├── lib-dynlink-bytecode │ │ ├── Makefile │ │ ├── custom.reference │ │ ├── main.ml │ │ ├── main.reference │ │ ├── plug1.ml │ │ ├── plug2.ml │ │ ├── registry.ml │ │ ├── static.reference │ │ ├── stub1.c │ │ └── stub2.c │ ├── lib-dynlink-csharp │ │ ├── Makefile │ │ ├── bytecode.reference │ │ ├── entry.c │ │ ├── main.cs │ │ ├── main.ml │ │ ├── native.reference │ │ └── plugin.ml │ ├── lib-dynlink-native │ │ ├── Makefile │ │ ├── a.ml │ │ ├── api.ml │ │ ├── b.ml │ │ ├── bug.ml │ │ ├── c.ml │ │ ├── factorial.c │ │ ├── main.ml │ │ ├── pack_client.ml │ │ ├── packed1.ml │ │ ├── packed1_client.ml │ │ ├── plugin.ml │ │ ├── plugin.mli │ │ ├── plugin2.ml │ │ ├── plugin4.ml │ │ ├── plugin_ext.ml │ │ ├── plugin_high_arity.ml │ │ ├── plugin_ref.ml │ │ ├── plugin_simple.ml │ │ ├── plugin_thread.ml │ │ ├── reference │ │ └── sub │ │ │ ├── api.ml │ │ │ ├── api.mli │ │ │ ├── plugin.ml │ │ │ └── plugin3.ml │ ├── lib-filename │ │ ├── Makefile │ │ ├── extension.ml │ │ └── extension.reference │ ├── lib-format │ │ ├── Makefile │ │ ├── pr6824.ml │ │ ├── pr6824.reference │ │ ├── tformat.ml │ │ └── tformat.reference │ ├── lib-hashtbl │ │ ├── Makefile │ │ ├── hfun.ml │ │ ├── hfun.reference │ │ ├── htbl.ml │ │ └── htbl.reference │ ├── lib-marshal │ │ ├── Makefile │ │ ├── intext.ml │ │ ├── intext.reference │ │ └── intextaux.c │ ├── lib-num-2 │ │ ├── Makefile │ │ ├── pi_big_int.ml │ │ ├── pi_big_int.reference │ │ ├── pi_num.ml │ │ └── pi_num.reference │ ├── lib-num │ │ ├── Makefile │ │ ├── end_test.ml │ │ ├── end_test.reference │ │ ├── test.ml │ │ ├── test_big_ints.ml │ │ ├── test_io.ml │ │ ├── test_nats.ml │ │ ├── test_nums.ml │ │ └── test_ratios.ml │ ├── lib-obj │ │ ├── Makefile │ │ ├── reachable_words.ml │ │ └── reachable_words.reference │ ├── lib-printf │ │ ├── Makefile │ │ ├── pr6534.ml │ │ ├── pr6534.reference │ │ ├── pr6938.ml │ │ ├── pr6938.reference │ │ ├── tprintf.ml │ │ └── tprintf.reference │ ├── lib-queue │ │ ├── Makefile │ │ ├── test.ml │ │ └── test.reference │ ├── lib-random │ │ ├── Makefile │ │ ├── rand.ml │ │ └── rand.reference │ ├── lib-scanf-2 │ │ ├── Makefile │ │ ├── reference │ │ ├── tscanf2_io.ml │ │ ├── tscanf2_master.ml │ │ └── tscanf2_slave.ml │ ├── lib-scanf │ │ ├── Makefile │ │ ├── tscanf.ml │ │ └── tscanf.reference │ ├── lib-set │ │ ├── Makefile │ │ ├── testmap.ml │ │ ├── testmap.reference │ │ ├── testset.ml │ │ └── testset.reference │ ├── lib-stack │ │ ├── Makefile │ │ ├── test.ml │ │ └── test.reference │ ├── lib-str │ │ ├── Makefile │ │ ├── t01.ml │ │ └── t01.reference │ ├── lib-stream │ │ ├── Makefile │ │ ├── count_concat_bug.ml │ │ └── count_concat_bug.reference │ ├── lib-string │ │ ├── Makefile │ │ ├── test_string.ml │ │ └── test_string.reference │ ├── lib-systhreads │ │ ├── Makefile │ │ ├── testfork.ml │ │ ├── testfork.precheck │ │ └── testfork.reference │ ├── lib-threads │ │ ├── Makefile │ │ ├── bank.ml │ │ ├── bank.reference │ │ ├── beat.ml │ │ ├── beat.reference │ │ ├── bufchan.ml │ │ ├── bufchan.reference │ │ ├── close.ml │ │ ├── close.reference │ │ ├── fileio.ml │ │ ├── fileio.reference │ │ ├── pr4466.ml │ │ ├── pr4466.reference │ │ ├── pr5325.ml │ │ ├── pr5325.reference │ │ ├── prodcons.ml │ │ ├── prodcons.reference │ │ ├── prodcons2.ml │ │ ├── prodcons2.reference │ │ ├── sieve.ml │ │ ├── sieve.reference │ │ ├── sigint.c │ │ ├── signal.checker │ │ ├── signal.ml │ │ ├── signal.precheck │ │ ├── signal.runner │ │ ├── signal2.checker │ │ ├── signal2.ml │ │ ├── signal2.precheck │ │ ├── signal2.runner │ │ ├── sockets.ml │ │ ├── sockets.reference │ │ ├── socketsbuf.ml │ │ ├── socketsbuf.reference │ │ ├── swapchan.checker │ │ ├── swapchan.ml │ │ ├── swapchan.reference │ │ ├── tls.checker │ │ ├── tls.ml │ │ ├── tls.reference │ │ ├── token1.reference │ │ ├── token2.reference │ │ ├── torture.ml │ │ └── torture.reference │ ├── lib-uchar │ │ ├── Makefile │ │ ├── test.ml │ │ └── test.reference │ ├── link-test │ │ ├── Makefile │ │ ├── aliases.ml │ │ ├── external.ml │ │ ├── external.mli │ │ ├── external_for_pack.ml │ │ ├── external_for_pack.mli │ │ ├── submodule.ml │ │ ├── test.ml │ │ ├── test.reference │ │ └── use_in_pack.ml │ ├── macros │ │ ├── Makefile │ │ ├── higher_order_funct.ml │ │ ├── higher_order_funct.ml.reference │ │ ├── multiple_splices.ml │ │ ├── multiple_splices.ml.reference │ │ ├── splice_argument_order.ml │ │ ├── splice_argument_order.ml.reference │ │ ├── splice_order.ml │ │ ├── splice_order.ml.reference │ │ ├── splicing_shadowed_global.ml │ │ ├── splicing_shadowed_global.ml.reference │ │ ├── static_modules.ml │ │ ├── static_modules.ml.reference │ │ ├── static_values.ml │ │ ├── static_values.ml.reference │ │ └── tmp.ml │ ├── manual-intf-c │ │ ├── Makefile │ │ ├── curses.ml │ │ ├── curses_stubs.c │ │ ├── prog.ml │ │ └── prog2.reference │ ├── match-exception-warnings │ │ ├── Makefile │ │ ├── exhaustiveness_warnings.ml │ │ └── exhaustiveness_warnings.ml.reference │ ├── match-exception │ │ ├── Makefile │ │ ├── allocation.ml │ │ ├── allocation.reference │ │ ├── exception_propagation.ml │ │ ├── exception_propagation.reference │ │ ├── match_failure.ml │ │ ├── match_failure.reference │ │ ├── nested_handlers.ml │ │ ├── nested_handlers.reference │ │ ├── raise_from_success_continuation.ml │ │ ├── raise_from_success_continuation.reference │ │ ├── streams.ml │ │ ├── streams.reference │ │ ├── tail_calls.ml │ │ └── tail_calls.reference │ ├── misc-kb │ │ ├── Makefile │ │ ├── equations.ml │ │ ├── equations.mli │ │ ├── kb.ml │ │ ├── kb.mli │ │ ├── kbmain.ml │ │ ├── kbmain.reference │ │ ├── orderings.ml │ │ ├── orderings.mli │ │ ├── terms.ml │ │ └── terms.mli │ ├── misc-unsafe │ │ ├── Makefile │ │ ├── almabench.ml │ │ ├── almabench.reference │ │ ├── fft.ml │ │ ├── fft.reference │ │ ├── quicksort.ml │ │ ├── quicksort.reference │ │ ├── soli.ml │ │ └── soli.reference │ ├── misc │ │ ├── Makefile │ │ ├── bdd.ml │ │ ├── bdd.reference │ │ ├── boyer.ml │ │ ├── boyer.reference │ │ ├── ephetest.ml │ │ ├── ephetest.reference │ │ ├── ephetest2.ml │ │ ├── ephetest2.reference │ │ ├── ephetest3.ml │ │ ├── ephetest3.reference │ │ ├── fib.ml │ │ ├── fib.reference │ │ ├── finaliser.ml │ │ ├── finaliser.reference │ │ ├── hamming.ml │ │ ├── hamming.reference │ │ ├── nucleic.ml │ │ ├── nucleic.reference │ │ ├── pr7168.ml │ │ ├── pr7168.reference │ │ ├── sieve.ml │ │ ├── sieve.reference │ │ ├── sorts.ml │ │ ├── sorts.reference │ │ ├── takc.ml │ │ ├── takc.reference │ │ ├── taku.ml │ │ ├── taku.reference │ │ ├── weaklifetime.ml │ │ ├── weaklifetime.reference │ │ ├── weaklifetime2.ml │ │ ├── weaklifetime2.reference │ │ ├── weaktest.ml │ │ └── weaktest.reference │ ├── no-alias-deps │ │ ├── Makefile │ │ ├── aliases.cmo.reference │ │ ├── aliases.ml │ │ ├── aliases.ml.reference │ │ ├── b.cmi.pre │ │ ├── c.mli │ │ └── d.mli │ ├── opaque │ │ ├── Makefile │ │ ├── fst │ │ │ ├── opaque_impl.ml │ │ │ ├── opaque_intf.ml │ │ │ └── regular.ml │ │ ├── intf │ │ │ ├── opaque_impl.mli │ │ │ ├── opaque_intf.mli │ │ │ └── regular.mli │ │ ├── snd │ │ │ ├── opaque_impl.ml │ │ │ ├── opaque_intf.ml │ │ │ └── regular.ml │ │ └── test.ml │ ├── parsetree │ │ ├── Makefile │ │ ├── source.ml │ │ ├── test.ml │ │ └── test.reference │ ├── parsing │ │ ├── Makefile │ │ ├── attributes.ml │ │ ├── attributes.ml.reference │ │ ├── docstrings.ml │ │ ├── docstrings.ml.reference │ │ ├── extensions.ml │ │ ├── extensions.ml.reference │ │ ├── int_and_float_with_modifier.ml │ │ ├── int_and_float_with_modifier.ml.reference │ │ ├── pr6865.ml │ │ ├── pr6865.ml.reference │ │ ├── pr7165.ml │ │ ├── pr7165.ml.reference │ │ ├── shortcut_ext_attr.ml │ │ └── shortcut_ext_attr.ml.reference │ ├── ppx-attributes │ │ ├── Makefile │ │ ├── warning.ml │ │ └── warning.reference │ ├── prim-bigstring │ │ ├── Makefile │ │ ├── bigstring_access.ml │ │ ├── bigstring_access.reference │ │ ├── string_access.ml │ │ └── string_access.reference │ ├── prim-bswap │ │ ├── Makefile │ │ ├── bswap.ml │ │ └── bswap.reference │ ├── prim-revapply │ │ ├── Makefile │ │ ├── apply.ml │ │ ├── apply.reference │ │ ├── revapply.ml │ │ └── revapply.reference │ ├── regression │ │ ├── pr3612 │ │ │ ├── Makefile │ │ │ ├── custom_finalize.c │ │ │ ├── pr3612.ml │ │ │ └── pr3612.reference │ │ ├── pr5080-notes │ │ │ ├── Makefile │ │ │ └── pr5080_notes_ok.ml │ │ ├── pr5233 │ │ │ ├── Makefile │ │ │ ├── pr5233.ml │ │ │ └── pr5233.reference │ │ ├── pr5757 │ │ │ ├── Makefile │ │ │ ├── pr5757.ml │ │ │ └── pr5757.reference │ │ ├── pr6024 │ │ │ ├── Makefile │ │ │ ├── pr6024.ml │ │ │ └── pr6024.reference │ │ └── pr7042 │ │ │ ├── Makefile │ │ │ ├── pr7042.ml │ │ │ └── pr7042.reference │ ├── required-external │ │ ├── Makefile │ │ ├── file.ml │ │ ├── main.ml │ │ └── main.reference │ ├── runtime-errors │ │ ├── Makefile │ │ ├── stackoverflow.bytecode.checker │ │ ├── stackoverflow.bytecode.reference │ │ ├── stackoverflow.ml │ │ ├── stackoverflow.native.checker │ │ ├── stackoverflow.native.reference │ │ ├── syserror.bytecode.checker │ │ ├── syserror.bytecode.reference │ │ ├── syserror.ml │ │ ├── syserror.native.checker │ │ └── syserror.native.reference │ ├── self-contained-toplevel │ │ ├── Makefile │ │ ├── foo.ml │ │ ├── gen_cached_cmi.ml │ │ ├── input.ml │ │ ├── main.ml │ │ └── main.reference │ ├── tool-debugger │ │ ├── basic │ │ │ ├── Makefile │ │ │ ├── debuggee.ml │ │ │ ├── debuggee.reference │ │ │ └── input_script │ │ ├── find-artifacts │ │ │ ├── Makefile │ │ │ ├── debuggee.reference │ │ │ ├── in │ │ │ │ ├── blah.ml │ │ │ │ └── foo.ml │ │ │ └── input_script │ │ └── no_debug_event │ │ │ ├── Makefile │ │ │ ├── a.ml │ │ │ ├── b.ml │ │ │ ├── input_script │ │ │ └── noev.reference │ ├── tool-lexyacc │ │ ├── Makefile │ │ ├── gram_aux.ml │ │ ├── grammar.mly │ │ ├── input │ │ ├── lexgen.ml │ │ ├── main.ml │ │ ├── main.reference │ │ ├── output.ml │ │ ├── scan_aux.ml │ │ ├── scanner.mll │ │ └── syntax.ml │ ├── tool-ocaml │ │ ├── Makefile │ │ ├── lib.ml │ │ ├── t000.ml │ │ ├── t010-const0.ml │ │ ├── t010-const1.ml │ │ ├── t010-const2.ml │ │ ├── t010-const3.ml │ │ ├── t011-constint.ml │ │ ├── t020.ml │ │ ├── t021-pushconst1.ml │ │ ├── t021-pushconst2.ml │ │ ├── t021-pushconst3.ml │ │ ├── t022-pushconstint.ml │ │ ├── t040-makeblock1.ml │ │ ├── t040-makeblock2.ml │ │ ├── t040-makeblock3.ml │ │ ├── t041-makeblock.ml │ │ ├── t050-getglobal.ml │ │ ├── t050-pushgetglobal.ml │ │ ├── t051-getglobalfield.ml │ │ ├── t051-pushgetglobalfield.ml │ │ ├── t060-raise.ml │ │ ├── t070-branch.ml │ │ ├── t070-branchif.ml │ │ ├── t070-branchifnot.ml │ │ ├── t071-boolnot.ml │ │ ├── t080-eq.ml │ │ ├── t080-geint.ml │ │ ├── t080-gtint.ml │ │ ├── t080-leint.ml │ │ ├── t080-ltint.ml │ │ ├── t080-neq.ml │ │ ├── t090-acc0.ml │ │ ├── t090-acc1.ml │ │ ├── t090-acc2.ml │ │ ├── t090-acc3.ml │ │ ├── t090-acc4.ml │ │ ├── t090-acc5.ml │ │ ├── t090-acc6.ml │ │ ├── t090-acc7.ml │ │ ├── t091-acc.ml │ │ ├── t092-pushacc.ml │ │ ├── t092-pushacc0.ml │ │ ├── t092-pushacc1.ml │ │ ├── t092-pushacc2.ml │ │ ├── t092-pushacc3.ml │ │ ├── t092-pushacc4.ml │ │ ├── t092-pushacc5.ml │ │ ├── t092-pushacc6.ml │ │ ├── t092-pushacc7.ml │ │ ├── t093-pushacc.ml │ │ ├── t100-pushtrap.ml │ │ ├── t101-poptrap.ml │ │ ├── t110-addint.ml │ │ ├── t110-andint.ml │ │ ├── t110-asrint-1.ml │ │ ├── t110-asrint-2.ml │ │ ├── t110-divint-1.ml │ │ ├── t110-divint-2.ml │ │ ├── t110-divint-3.ml │ │ ├── t110-lslint.ml │ │ ├── t110-lsrint.ml │ │ ├── t110-modint-1.ml │ │ ├── t110-modint-2.ml │ │ ├── t110-mulint.ml │ │ ├── t110-negint.ml │ │ ├── t110-offsetint.ml │ │ ├── t110-orint.ml │ │ ├── t110-subint.ml │ │ ├── t110-xorint.ml │ │ ├── t120-getstringchar.ml │ │ ├── t121-setstringchar.ml │ │ ├── t130-getvectitem.ml │ │ ├── t130-vectlength.ml │ │ ├── t131-setvectitem.ml │ │ ├── t140-switch-1.ml │ │ ├── t140-switch-2.ml │ │ ├── t140-switch-3.ml │ │ ├── t140-switch-4.ml │ │ ├── t141-switch-5.ml │ │ ├── t141-switch-6.ml │ │ ├── t141-switch-7.ml │ │ ├── t142-switch-8.ml │ │ ├── t142-switch-9.ml │ │ ├── t142-switch-A.ml │ │ ├── t150-push-1.ml │ │ ├── t150-push-2.ml │ │ ├── t160-closure.ml │ │ ├── t161-apply1.ml │ │ ├── t162-return.ml │ │ ├── t163.ml │ │ ├── t164-apply2.ml │ │ ├── t164-apply3.ml │ │ ├── t165-apply.ml │ │ ├── t170-envacc2.ml │ │ ├── t170-envacc3.ml │ │ ├── t170-envacc4.ml │ │ ├── t171-envacc.ml │ │ ├── t172-pushenvacc1.ml │ │ ├── t172-pushenvacc2.ml │ │ ├── t172-pushenvacc3.ml │ │ ├── t172-pushenvacc4.ml │ │ ├── t173-pushenvacc.ml │ │ ├── t180-appterm1.ml │ │ ├── t180-appterm2.ml │ │ ├── t180-appterm3.ml │ │ ├── t181-appterm.ml │ │ ├── t190-makefloatblock-1.ml │ │ ├── t190-makefloatblock-2.ml │ │ ├── t190-makefloatblock-3.ml │ │ ├── t191-vectlength.ml │ │ ├── t192-getfloatfield-1.ml │ │ ├── t192-getfloatfield-2.ml │ │ ├── t193-setfloatfield-1.ml │ │ ├── t193-setfloatfield-2.ml │ │ ├── t200-getfield0.ml │ │ ├── t200-getfield1.ml │ │ ├── t200-getfield2.ml │ │ ├── t200-getfield3.ml │ │ ├── t201-getfield.ml │ │ ├── t210-setfield0.ml │ │ ├── t210-setfield1.ml │ │ ├── t210-setfield2.ml │ │ ├── t210-setfield3.ml │ │ ├── t211-setfield.ml │ │ ├── t220-assign.ml │ │ ├── t230-check_signals.ml │ │ ├── t240-c_call1.ml │ │ ├── t240-c_call2.ml │ │ ├── t240-c_call3.ml │ │ ├── t240-c_call4.ml │ │ ├── t240-c_call5.ml │ │ ├── t250-closurerec-1.ml │ │ ├── t250-closurerec-2.ml │ │ ├── t251-pushoffsetclosure0.ml │ │ ├── t251-pushoffsetclosure2.ml │ │ ├── t251-pushoffsetclosurem2.ml │ │ ├── t252-pushoffsetclosure.ml │ │ ├── t253-offsetclosure0.ml │ │ ├── t253-offsetclosure2.ml │ │ ├── t253-offsetclosurem2.ml │ │ ├── t254-offsetclosure.ml │ │ ├── t260-offsetref.ml │ │ ├── t270-push_retaddr.ml │ │ ├── t300-getmethod.ml │ │ ├── t301-object.ml │ │ ├── t310-alloc-1.ml │ │ ├── t310-alloc-2.ml │ │ ├── t320-gc-1.ml │ │ ├── t320-gc-2.ml │ │ ├── t320-gc-3.ml │ │ ├── t330-compact-1.ml │ │ ├── t330-compact-2.ml │ │ ├── t330-compact-3.ml │ │ ├── t330-compact-4.ml │ │ ├── t340-weak.ml │ │ ├── t350-heapcheck.ml │ │ ├── t360-stacks-1.ml │ │ └── t360-stacks-2.ml │ ├── tool-ocamldep-modalias │ │ ├── A.ml │ │ ├── B.ml │ │ ├── C.ml │ │ ├── D.ml │ │ ├── Makefile │ │ ├── Makefile.build │ │ ├── Makefile.build2 │ │ ├── depend.mk.reference │ │ ├── depend.mk2.reference │ │ ├── depend.mod.reference │ │ ├── depend.mod2.reference │ │ ├── depend.mod3.reference │ │ ├── lib.mli │ │ ├── lib_impl.ml │ │ └── main.ml │ ├── tool-ocamldoc-2 │ │ ├── Makefile │ │ ├── extensible_variant.ml │ │ ├── extensible_variant.reference │ │ ├── inline_records.mli │ │ ├── inline_records.reference │ │ ├── inline_records_bis.ml │ │ ├── inline_records_bis.reference │ │ ├── test.mli │ │ └── test.reference │ ├── tool-ocamldoc-html │ │ ├── Inline_records.mli │ │ ├── Inline_records.reference │ │ ├── Linebreaks.mli │ │ ├── Linebreaks.reference │ │ ├── Makefile │ │ └── type_Linebreaks.reference │ ├── tool-ocamldoc-man │ │ ├── Inline_records.mli │ │ ├── Inline_records.reference │ │ └── Makefile │ ├── tool-ocamldoc-open │ │ ├── Makefile │ │ ├── Readme │ │ ├── alias.ml │ │ ├── doc.reference │ │ ├── inner.ml │ │ └── main.ml │ ├── tool-ocamldoc │ │ ├── Makefile │ │ ├── odoc_test.ml │ │ ├── t01.ml │ │ ├── t01.reference │ │ ├── t02.ml │ │ ├── t02.reference │ │ ├── t03.ml │ │ ├── t03.reference │ │ ├── t04.ml │ │ └── t04.reference │ ├── tool-toplevel │ │ ├── Makefile │ │ ├── tracing.ml │ │ └── tracing.ml.reference │ ├── translprim │ │ ├── Makefile │ │ ├── array_spec.ml │ │ ├── array_spec.ml.reference │ │ ├── comparison_table.ml │ │ ├── comparison_table.ml.reference │ │ ├── module_coercion.ml │ │ ├── module_coercion.ml.reference │ │ ├── ref_spec.ml │ │ └── ref_spec.ml.reference │ ├── typing-extension-constructor │ │ ├── Makefile │ │ ├── test.ml │ │ └── test.ml.reference │ ├── typing-extensions │ │ ├── Makefile │ │ ├── cast.ml │ │ ├── cast.ml.reference │ │ ├── extensions.ml │ │ ├── extensions.ml.reference │ │ ├── msg.ml │ │ ├── msg.ml.reference │ │ ├── open_types.ml │ │ └── open_types.ml.reference │ ├── typing-fstclassmod │ │ ├── Makefile │ │ ├── fstclassmod.ml │ │ └── fstclassmod.reference │ ├── typing-gadts │ │ ├── Makefile │ │ ├── didier.ml │ │ ├── dynamic_frisch.ml │ │ ├── nested_equations.ml │ │ ├── omega07.ml │ │ ├── pr5332.ml │ │ ├── pr5689.ml │ │ ├── pr5785.ml │ │ ├── pr5848.ml │ │ ├── pr5906.ml │ │ ├── pr5948.ml │ │ ├── pr5981.ml │ │ ├── pr5985.ml │ │ ├── pr5989.ml │ │ ├── pr5997.ml │ │ ├── pr6158.ml │ │ ├── pr6163.ml │ │ ├── pr6174.ml │ │ ├── pr6241.ml │ │ ├── pr6690.ml │ │ ├── pr6817.ml │ │ ├── pr6980.ml │ │ ├── pr6993_bad.ml │ │ ├── pr7016.ml │ │ ├── pr7160.ml │ │ ├── pr7214.ml │ │ ├── pr7222.ml │ │ ├── pr7230.ml │ │ ├── pr7234.ml │ │ ├── pr7260.ml │ │ ├── pr7269.ml │ │ ├── pr7298.ml │ │ ├── pr7374.ml │ │ ├── pr7378.ml │ │ ├── pr7381.ml │ │ ├── pr7390.ml │ │ ├── pr7391.ml │ │ ├── term-conv.ml │ │ ├── test.ml │ │ ├── unify_mb.ml │ │ └── yallop_bugs.ml │ ├── typing-immediate │ │ ├── Makefile │ │ └── immediate.ml │ ├── typing-implicit_unpack │ │ ├── Makefile │ │ ├── implicit_unpack.ml │ │ └── implicit_unpack.ml.reference │ ├── typing-labels │ │ ├── Makefile │ │ ├── mixin.ml │ │ ├── mixin.reference │ │ ├── mixin2.ml │ │ ├── mixin2.reference │ │ ├── mixin3.ml │ │ └── mixin3.reference │ ├── typing-misc-bugs │ │ ├── Makefile │ │ ├── core_array_reduced_ok.ml │ │ ├── pr6303_bad.ml │ │ └── pr6946_bad.ml │ ├── typing-misc │ │ ├── Makefile │ │ ├── constraints.ml │ │ ├── labels.ml │ │ ├── occur_check.ml │ │ ├── polyvars.ml │ │ ├── pr6939.ml │ │ ├── pr7103.ml │ │ ├── pr7228.ml │ │ ├── printing.ml │ │ ├── records.ml │ │ ├── variant.ml │ │ └── wellfounded.ml │ ├── typing-missing-cmi │ │ ├── Makefile │ │ ├── a.ml │ │ ├── b.ml │ │ ├── c.ml │ │ ├── main.ml │ │ ├── main.ml.reference │ │ ├── main_ok.ml │ │ └── subdir │ │ │ └── m.ml │ ├── typing-modules-bugs │ │ ├── Makefile │ │ ├── gatien_baron_20131019_ok.ml │ │ ├── pr5164_ok.ml │ │ ├── pr51_ok.ml │ │ ├── pr5663_ok.ml │ │ ├── pr5914_ok.ml │ │ ├── pr6240_ok.ml │ │ ├── pr6293_bad.ml │ │ ├── pr6427_bad.ml │ │ ├── pr6513_ok.ml │ │ ├── pr6572_ok.ml │ │ ├── pr6651_ok.ml │ │ ├── pr6752_bad.ml │ │ ├── pr6752_ok.ml │ │ ├── pr6899_first_bad.ml │ │ ├── pr6899_ok.ml │ │ ├── pr6899_second_bad.ml │ │ ├── pr6944_ok.ml │ │ ├── pr6954_ok.ml │ │ ├── pr6981_ok.ml │ │ ├── pr6982_ok.ml │ │ ├── pr6985_ok.ml │ │ ├── pr6992_bad.ml │ │ ├── pr7036_ok.ml │ │ ├── pr7082_ok.ml │ │ ├── pr7112_bad.ml │ │ ├── pr7112_ok.ml │ │ ├── pr7152_ok.ml │ │ ├── pr7182_ok.ml │ │ └── pr7305_principal.ml │ ├── typing-modules │ │ ├── Makefile │ │ ├── Test.ml │ │ ├── aliases.ml │ │ ├── firstclass.ml │ │ ├── generative.ml │ │ ├── pr5911.ml │ │ ├── pr7207.ml │ │ ├── printing.ml │ │ └── recursive.ml │ ├── typing-multifile │ │ └── Makefile │ ├── typing-objects-bugs │ │ ├── Makefile │ │ ├── pr3968_bad.ml │ │ ├── pr4018_bad.ml │ │ ├── pr4435_bad.ml │ │ ├── pr4766_ok.ml │ │ ├── pr4824_ok.ml │ │ ├── pr4824a_bad.ml │ │ ├── pr5156_ok.ml │ │ ├── pr7284_bad.ml │ │ ├── pr7293_ok.ml │ │ ├── woodyatt_ok.ml │ │ └── yamagata021012_ok.ml │ ├── typing-objects │ │ ├── Exemples.ml │ │ ├── Exemples.ml.principal.reference │ │ ├── Exemples.ml.reference │ │ ├── Makefile │ │ ├── Tests.ml │ │ ├── Tests.ml.principal.reference │ │ ├── Tests.ml.reference │ │ ├── pr5545.ml │ │ ├── pr5545.ml.principal.reference │ │ ├── pr5545.ml.reference │ │ ├── pr5619_bad.ml │ │ ├── pr5619_bad.ml.principal.reference │ │ ├── pr5619_bad.ml.reference │ │ ├── pr5858.ml │ │ ├── pr5858.ml.reference │ │ ├── pr6123_bad.ml │ │ ├── pr6123_bad.ml.principal.reference │ │ ├── pr6123_bad.ml.reference │ │ ├── pr6383.ml │ │ ├── pr6383.ml.reference │ │ ├── pr6907_bad.ml │ │ └── pr6907_bad.ml.reference │ ├── typing-pattern_open │ │ ├── Makefile │ │ ├── pattern_open.ml │ │ └── pattern_open.ml.reference │ ├── typing-poly-bugs │ │ ├── Makefile │ │ ├── pr5322_ok.ml │ │ ├── pr5673_bad.ml │ │ └── pr5673_ok.ml │ ├── typing-poly │ │ ├── Makefile │ │ └── poly.ml │ ├── typing-polyvariants-bugs-2 │ │ ├── Makefile │ │ ├── pr3918a.mli │ │ ├── pr3918b.mli │ │ └── pr3918c.ml │ ├── typing-polyvariants-bugs │ │ ├── Makefile │ │ ├── pr4775_ok.ml │ │ ├── pr4933_ok.ml │ │ ├── pr5057_ok.ml │ │ ├── pr5057a_bad.ml │ │ ├── pr7199_ok.ml │ │ └── privrowsabate_ok.ml │ ├── typing-private-bugs │ │ ├── Makefile │ │ ├── pr5026_bad.ml │ │ └── pr5469_ok.ml │ ├── typing-private │ │ ├── Makefile │ │ ├── private.ml │ │ ├── private.ml.principal.reference │ │ └── private.ml.reference │ ├── typing-recmod │ │ ├── Makefile │ │ ├── t01bad.ml │ │ ├── t02bad.ml │ │ ├── t03ok.ml │ │ ├── t04bad.ml │ │ ├── t05bad.ml │ │ ├── t06ok.ml │ │ ├── t07bad.ml │ │ ├── t08bad.ml │ │ ├── t09bad.ml │ │ ├── t10ok.ml │ │ ├── t11bad.ml │ │ ├── t12bad.ml │ │ ├── t13ok.ml │ │ ├── t14bad.ml │ │ ├── t15bad.ml │ │ ├── t16ok.ml │ │ ├── t17ok.ml │ │ ├── t18ok.ml │ │ ├── t19ok.ml │ │ ├── t20ok.ml │ │ ├── t21ok.ml │ │ ├── t22ok.ml │ │ └── t22ok.mli │ ├── typing-recordarg │ │ ├── Makefile │ │ ├── recordarg.ml │ │ └── recordarg.ml.reference │ ├── typing-rectypes-bugs │ │ ├── Makefile │ │ ├── pr5343_bad.ml │ │ ├── pr6174_bad.ml │ │ └── pr6870_bad.ml │ ├── typing-safe-linking │ │ ├── Makefile │ │ ├── a.ml │ │ └── b_bad.ml │ ├── typing-short-paths │ │ ├── Makefile │ │ ├── pr5918.ml │ │ ├── pr5918.ml.reference │ │ ├── pr6836.ml │ │ ├── pr6836.ml.reference │ │ ├── short-paths.ml │ │ └── short-paths.ml.reference │ ├── typing-signatures │ │ ├── Makefile │ │ ├── els.ml │ │ ├── els.ml.reference │ │ ├── pr6371.ml │ │ ├── pr6371.ml.reference │ │ ├── pr6672.ml │ │ └── pr6672.ml.reference │ ├── typing-sigsubst │ │ ├── Makefile │ │ ├── sigsubst.ml │ │ └── sigsubst.ml.reference │ ├── typing-typeparam │ │ ├── Makefile │ │ ├── newtype.ml │ │ └── newtype.ml.reference │ ├── typing-unboxed-types │ │ ├── Makefile │ │ ├── test.ml │ │ └── test.ml.reference │ ├── typing-unboxed │ │ ├── Makefile │ │ ├── test.ml │ │ └── test.ml.reference │ ├── typing-warnings │ │ ├── Makefile │ │ ├── ambiguous_guarded_disjunction.ml │ │ ├── ambiguous_guarded_disjunction.ml.reference │ │ ├── application.ml │ │ ├── application.ml.reference │ │ ├── coercions.ml │ │ ├── coercions.ml.principal.reference │ │ ├── coercions.ml.reference │ │ ├── exhaustiveness.ml │ │ ├── exhaustiveness.ml.reference │ │ ├── pr5892.ml │ │ ├── pr5892.ml.reference │ │ ├── pr6872.ml │ │ ├── pr6872.ml.principal.reference │ │ ├── pr6872.ml.reference │ │ ├── pr7085.ml │ │ ├── pr7085.ml.reference │ │ ├── pr7115.ml │ │ ├── pr7115.ml.reference │ │ ├── pr7297.ml │ │ ├── pr7297.ml.reference │ │ ├── records.ml │ │ ├── records.ml.principal.reference │ │ ├── records.ml.reference │ │ ├── unused_types.ml │ │ └── unused_types.ml.reference │ ├── unboxed-primitive-args │ │ ├── Makefile │ │ ├── README │ │ ├── common.ml │ │ ├── common.mli │ │ ├── gen_test.ml │ │ ├── main.reference │ │ ├── test_common.c │ │ └── test_common.h │ ├── unwind │ │ ├── Makefile │ │ ├── README │ │ ├── driver.ml │ │ ├── mylib.ml │ │ ├── mylib.mli │ │ └── stack_walker.c │ ├── utils │ │ ├── Makefile │ │ ├── edit_distance.ml │ │ ├── edit_distance.reference │ │ ├── test_strongly_connected_components.ml │ │ └── test_strongly_connected_components.reference │ └── warnings │ │ ├── Makefile │ │ ├── deprecated_module.ml │ │ ├── deprecated_module.mli │ │ ├── deprecated_module.reference │ │ ├── deprecated_module_use.ml │ │ ├── deprecated_module_use.reference │ │ ├── module_without_cmx.mli │ │ ├── w01.ml │ │ ├── w01.reference │ │ ├── w06.ml │ │ ├── w06.reference │ │ ├── w45.ml │ │ ├── w45.reference │ │ ├── w47_inline.ml │ │ ├── w47_inline.reference │ │ ├── w50.ml │ │ ├── w50.reference │ │ ├── w51.ml │ │ ├── w51.reference │ │ ├── w51_bis.ml │ │ ├── w51_bis.reference │ │ ├── w53.ml │ │ ├── w53.reference │ │ ├── w54.ml │ │ ├── w54.reference │ │ ├── w55.opt_backend.clambda.opt_reference │ │ ├── w55.opt_backend.flambda.opt_reference │ │ ├── w55.opt_backend.ml │ │ ├── w55.opt_backend.reference │ │ ├── w58.opt.ml │ │ ├── w58.opt.opt_reference │ │ ├── w58.opt.reference │ │ ├── w59.opt_backend.clambda.opt_reference │ │ ├── w59.opt_backend.flambda.opt_reference │ │ ├── w59.opt_backend.ml │ │ └── w59.opt_backend.reference ├── tools │ ├── Makefile │ └── expect_test.ml └── typing ├── tools ├── .depend ├── Makefile ├── Makefile.nt ├── Makefile.shared ├── addlabels.ml ├── check-typo ├── checkstack.c ├── ci-build ├── cleanup-header ├── cmpbyt.ml ├── cmt2annot.ml ├── cvt_emit.mll ├── dumpobj.ml ├── eqparsetree.ml ├── gdb-macros ├── lexer299.mll ├── lexer301.mll ├── magic ├── make-opcodes ├── make-package-macosx ├── make-version-header.sh ├── msvs-promote-path ├── objinfo.ml ├── objinfo_helper.c ├── ocaml-instr-graph ├── ocaml-instr-report ├── ocaml-objcopy-macosx ├── ocaml299to3.ml ├── ocamlcp.ml ├── ocamldep.ml ├── ocamlmklib.ml ├── ocamlmktop.ml ├── ocamloptp.ml ├── ocamlprof.ml ├── ocamlsize ├── primreq.ml ├── profiling.ml ├── profiling.mli ├── read_cmt.ml ├── scrapelabels.ml ├── stripdebug.ml ├── tast_iter.ml └── untypeast.ml ├── toplevel ├── expunge.ml ├── genprintval.ml ├── genprintval.mli ├── opttopdirs.ml ├── opttopdirs.mli ├── opttoploop.ml ├── opttoploop.mli ├── opttopmain.ml ├── opttopmain.mli ├── opttopstart.ml ├── topdirs.ml ├── topdirs.mli ├── toploop.ml ├── toploop.mli ├── topmain.ml ├── topmain.mli ├── topstart.ml ├── trace.ml └── trace.mli ├── typing ├── annot.mli ├── btype.ml ├── btype.mli ├── cmi_format.ml ├── cmi_format.mli ├── cmt_format.ml ├── cmt_format.mli ├── ctype.ml ├── ctype.mli ├── datarepr.ml ├── datarepr.mli ├── env.ml ├── env.mli ├── envaux.ml ├── envaux.mli ├── ident.ml ├── ident.mli ├── includeclass.ml ├── includeclass.mli ├── includecore.ml ├── includecore.mli ├── includemod.ml ├── includemod.mli ├── mtype.ml ├── mtype.mli ├── oprint.ml ├── oprint.mli ├── outcometree.mli ├── parmatch.ml ├── parmatch.mli ├── path.ml ├── path.mli ├── predef.ml ├── predef.mli ├── primitive.ml ├── primitive.mli ├── printtyp.ml ├── printtyp.mli ├── printtyped.ml ├── printtyped.mli ├── stypes.ml ├── stypes.mli ├── subst.ml ├── subst.mli ├── tast_mapper.ml ├── tast_mapper.mli ├── typeclass.ml ├── typeclass.mli ├── typecore.ml ├── typecore.mli ├── typedecl.ml ├── typedecl.mli ├── typedtree.ml ├── typedtree.mli ├── typedtreeIter.ml ├── typedtreeIter.mli ├── typedtreeMap.ml ├── typedtreeMap.mli ├── typemod.ml ├── typemod.mli ├── types.ml ├── types.mli ├── typetexp.ml ├── typetexp.mli ├── untypeast.ml └── untypeast.mli ├── utils ├── arg_helper.ml ├── arg_helper.mli ├── ccomp.ml ├── ccomp.mli ├── clflags.ml ├── clflags.mli ├── config.mli ├── config.mlp ├── consistbl.ml ├── consistbl.mli ├── identifiable.ml ├── identifiable.mli ├── misc.ml ├── misc.mli ├── numbers.ml ├── numbers.mli ├── strongly_connected_components.ml ├── strongly_connected_components.mli ├── tbl.ml ├── tbl.mli ├── terminfo.ml ├── terminfo.mli ├── timings.ml ├── timings.mli ├── warnings.ml └── warnings.mli └── yacc ├── Makefile ├── Makefile.nt ├── closure.c ├── defs.h ├── error.c ├── lalr.c ├── lr0.c ├── main.c ├── mkpar.c ├── output.c ├── reader.c ├── skeleton.c ├── symtab.c ├── verbose.c └── warshall.c /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "flexdll"] 2 | path = flexdll 3 | url = https://github.com/alainfrisch/flexdll.git 4 | -------------------------------------------------------------------------------- /.ocp-indent: -------------------------------------------------------------------------------- 1 | match_clause=4 2 | strict_with=auto 3 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 4.04.0+dev9-2015-09-05 2 | 3 | # The version string is the first line of this file. 4 | # It must be in the format described in stdlib/sys.mli 5 | -------------------------------------------------------------------------------- /asmcomp/arm64/NOTES.md: -------------------------------------------------------------------------------- 1 | # Supported platforms 2 | 3 | ARMv8 in 64-bit mode (AArch64). 4 | 5 | Debian architecture name: `arm64`. 6 | 7 | # Reference documents 8 | 9 | * Instruction set architecture: 10 | _ARM Architecture Reference Manual, ARMv8_, restricted to the AArch64 subset. 11 | * Application binary interface: 12 | _Procedure Call Standard for the ARM 64-bit Architecture (AArch64)_ 13 | -------------------------------------------------------------------------------- /boot/ocamlc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/boot/ocamlc -------------------------------------------------------------------------------- /boot/ocamldep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/boot/ocamldep -------------------------------------------------------------------------------- /boot/ocamllex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/boot/ocamllex -------------------------------------------------------------------------------- /compilerlibs/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore is here to force git to create the compilerlibs directory 2 | # because git doesn't create empty directories. 3 | # The lines tell git to ignore everything in this directory except 4 | # the .gitignore file itself. 5 | 6 | * 7 | !.gitignore 8 | -------------------------------------------------------------------------------- /config/auto-aux/cfi.S: -------------------------------------------------------------------------------- 1 | camlPervasives__loop_1128: 2 | .file 1 "pervasives.ml" 3 | .loc 1 193 4 | .cfi_startproc 5 | .cfi_adjust_cfa_offset 8 6 | .cfi_endproc 7 | -------------------------------------------------------------------------------- /config/auto-aux/hashbang: -------------------------------------------------------------------------------- 1 | #! /bin/cat 2 | exit 1 3 | -------------------------------------------------------------------------------- /config/auto-aux/hashbang2: -------------------------------------------------------------------------------- 1 | #! /usr/bin/cat 2 | exit 1 3 | -------------------------------------------------------------------------------- /experimental/frisch/test_builder.ml: -------------------------------------------------------------------------------- 1 | type t = 2 | { 3 | x: int; 4 | y [@label foo]: int; 5 | z [@default 3]: int; 6 | } [@@builder] 7 | 8 | and s = 9 | { 10 | a: string; 11 | b [@opt]: int option; 12 | c: int [@default 2]; 13 | } [@@builder] 14 | 15 | and sum = 16 | | A of int 17 | | B of string * (string [@label str]) 18 | | C of (int [@label i] [@default 0]) * (string [@label s] [@default ""]) 19 | [@@builder] 20 | -------------------------------------------------------------------------------- /experimental/frisch/test_copy_typedef.ml: -------------------------------------------------------------------------------- 1 | module type S = [%copy_typedef] 2 | 3 | module type T = sig 4 | type t 5 | 6 | module type M = [%copy_typedef] 7 | end 8 | 9 | module M = struct 10 | type t = [%copy_typedef] 11 | end 12 | 13 | type t = [%copy_typedef] 14 | 15 | let _x = M.A 16 | let _y : t = [1; 2] 17 | 18 | 19 | type _loc = [%copy_typedef "../../parsing/location.mli" t] 20 | -------------------------------------------------------------------------------- /experimental/frisch/test_copy_typedef.mli: -------------------------------------------------------------------------------- 1 | module type S = sig 2 | type t 3 | val x: int 4 | end 5 | 6 | module type T = sig 7 | type t 8 | 9 | module type M = sig 10 | type t = A | B of t 11 | end 12 | end 13 | 14 | module M : sig 15 | type t = 16 | | A 17 | | B of string 18 | end 19 | 20 | type t = int list 21 | -------------------------------------------------------------------------------- /experimental/frisch/test_matches.ml: -------------------------------------------------------------------------------- 1 | let l = List.filter [%matches ? 'a'..'z'] ['a';'A';'X';'x'] 2 | 3 | let f = [%matches ? Some i when i >= 0] 4 | -------------------------------------------------------------------------------- /experimental/garrigue/.cvsignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.out2 3 | -------------------------------------------------------------------------------- /experimental/garrigue/countchars.ml: -------------------------------------------------------------------------------- 1 | let rec long_lines name n ic = 2 | let l = input_line ic in 3 | if String.length l > 80 then Printf.printf "%s: %d\n%!" name n; 4 | long_lines name (n+1) ic 5 | 6 | let process_file name = 7 | try 8 | let ic = open_in name in 9 | try long_lines name 1 ic 10 | with End_of_file -> close_in ic 11 | with _ ->() 12 | 13 | let () = 14 | for i = 1 to Array.length Sys.argv - 1 do 15 | process_file Sys.argv.(i) 16 | done 17 | -------------------------------------------------------------------------------- /experimental/garrigue/dirs_multimatch: -------------------------------------------------------------------------------- 1 | parsing typing bytecomp driver toplevel 2 | -------------------------------------------------------------------------------- /experimental/garrigue/dirs_poly: -------------------------------------------------------------------------------- 1 | bytecomp byterun driver parsing stdlib tools toplevel typing utils 2 | -------------------------------------------------------------------------------- /experimental/garrigue/printers.ml: -------------------------------------------------------------------------------- 1 | (* $Id$ *) 2 | 3 | open Types 4 | 5 | let ignore_abbrevs ppf ab = 6 | let s = match ab with 7 | Mnil -> "Mnil" 8 | | Mlink _ -> "Mlink _" 9 | | Mcons _ -> "Mcons _" 10 | in 11 | Format.pp_print_string ppf s 12 | -------------------------------------------------------------------------------- /experimental/garrigue/variable-names.ml: -------------------------------------------------------------------------------- 1 | let f (x : < a:int; .. > as 'me1) = (x : < b:bool; .. > as 'me2);; 2 | let f (x : < a:int; .. > as 'me1) = (x : < a:int; b:bool; .. > as 'me2);; 3 | let f (x : [> `A of int] as 'me1) = (x : [> `B of bool] as 'me2);; 4 | let f (x : [> `A of int] as 'me1) = (x : [`A of int | `B of 'me2] as 'me2);; 5 | -------------------------------------------------------------------------------- /manual/Makefile: -------------------------------------------------------------------------------- 1 | all: tools 2 | cd manual; ${MAKE} all 3 | # cd fpcl; ${MAKE} all 4 | 5 | clean: 6 | cd manual; ${MAKE} clean 7 | cd tools; ${MAKE} clean 8 | # cd fpcl; ${MAKE} clean 9 | 10 | release: 11 | cd manual; ${MAKE} release 12 | # cd fpcl; ${MAKE} release 13 | 14 | .PHONY: tools 15 | tools: 16 | cd tools; ${MAKE} clean; ${MAKE} all 17 | -------------------------------------------------------------------------------- /manual/manual/.gitignore: -------------------------------------------------------------------------------- 1 | allfiles.tex 2 | biblio.tex 3 | foreword.tex 4 | version.tex 5 | warnings.etex 6 | warnings.tex 7 | foreword.htex 8 | manual.html 9 | -------------------------------------------------------------------------------- /manual/manual/allfiles.etex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/allfiles.etex -------------------------------------------------------------------------------- /manual/manual/biblio.etex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/biblio.etex -------------------------------------------------------------------------------- /manual/manual/cmds/.gitignore: -------------------------------------------------------------------------------- 1 | *.tex 2 | *.htex 3 | warnings.etex 4 | -------------------------------------------------------------------------------- /manual/manual/cmds/browser.etex: -------------------------------------------------------------------------------- 1 | \chapter{The browser/editor (ocamlbrowser)} \label{c:browser} 2 | \pdfchapter{The browser/editor (ocamlbrowser)} 3 | %HEVEA\cutname{browser.html} 4 | 5 | Since OCaml version 4.02, the OCamlBrowser tool and the Labltk library 6 | are distributed separately from the OCaml compiler. The project is now 7 | hosted at \url{https://forge.ocamlcore.org/projects/labltk/}. 8 | -------------------------------------------------------------------------------- /manual/manual/cmds/ocamlbuild.etex: -------------------------------------------------------------------------------- 1 | \chapter{The ocamlbuild compilation manager} \label{c:ocamlbuild} 2 | \pdfchapter{The ocamlbuild compilation manager} 3 | 4 | Since OCaml version 4.03, the ocamlbuild compilation manager is 5 | distributed separately from the OCaml compiler. The project is now 6 | hosted at \url{https://github.com/ocaml/ocamlbuild/}. 7 | -------------------------------------------------------------------------------- /manual/manual/htmlman/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.haux 3 | *.hind 4 | libref 5 | manual.hmanual 6 | manual.hmanual.kwd 7 | manual.css 8 | *.htoc 9 | -------------------------------------------------------------------------------- /manual/manual/htmlman/contents_motif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/htmlman/contents_motif.gif -------------------------------------------------------------------------------- /manual/manual/htmlman/libgraph.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/htmlman/libgraph.gif -------------------------------------------------------------------------------- /manual/manual/htmlman/next_motif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/htmlman/next_motif.gif -------------------------------------------------------------------------------- /manual/manual/htmlman/previous_motif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/htmlman/previous_motif.gif -------------------------------------------------------------------------------- /manual/manual/infoman/.gitignore: -------------------------------------------------------------------------------- 1 | *.haux 2 | *.hind 3 | *.info*.gz 4 | *.info.body* 5 | ocaml.hocaml.kwd 6 | -------------------------------------------------------------------------------- /manual/manual/library/.cvsignore: -------------------------------------------------------------------------------- 1 | *.tex 2 | *.htex 3 | arithstatus.mli 4 | ocamldoc.out 5 | ocamldoc.sty 6 | -------------------------------------------------------------------------------- /manual/manual/library/.gitignore: -------------------------------------------------------------------------------- 1 | *.tex 2 | *.htex 3 | arithstatus.mli 4 | ocamldoc.out 5 | ocamldoc.sty 6 | -------------------------------------------------------------------------------- /manual/manual/library/libgraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/library/libgraph.png -------------------------------------------------------------------------------- /manual/manual/library/libnum.etex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/library/libnum.etex -------------------------------------------------------------------------------- /manual/manual/macros.hva: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/macros.hva -------------------------------------------------------------------------------- /manual/manual/manual.hva: -------------------------------------------------------------------------------- 1 | \input{book.hva} 2 | \input{fancysection.hva} 3 | \input{macros.hva} 4 | \newif\ifouthtml\outhtmltrue -------------------------------------------------------------------------------- /manual/manual/manual.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/manual.inf -------------------------------------------------------------------------------- /manual/manual/manual.info.header: -------------------------------------------------------------------------------- 1 | INFO-DIR-SECTION OCaml Programming Language 2 | START-INFO-DIR-ENTRY 3 | * ocaml: (ocaml). OCaml Reference Manual 4 | END-INFO-DIR-ENTRY 5 | -------------------------------------------------------------------------------- /manual/manual/plaintext.tex: -------------------------------------------------------------------------------- 1 | \documentclass[11pt]{report} 2 | 3 | \usepackage{plaintext} 4 | \usepackage[latin1]{inputenc} 5 | \usepackage{alltt} 6 | \usepackage{fullpage} 7 | \usepackage{syntaxdef} 8 | \usepackage{multind} 9 | \usepackage{html} 10 | \usepackage{caml-sl} 11 | 12 | \newif\ifplaintext 13 | \plaintexttrue 14 | %\newif\ifpdf 15 | %\pdffalse 16 | \input macros.tex 17 | \input allfiles.tex 18 | -------------------------------------------------------------------------------- /manual/manual/refman/.cvsignore: -------------------------------------------------------------------------------- 1 | *.tex 2 | *.htex 3 | -------------------------------------------------------------------------------- /manual/manual/refman/.gitignore: -------------------------------------------------------------------------------- 1 | *.tex 2 | *.htex 3 | -------------------------------------------------------------------------------- /manual/manual/texstuff/.cvsignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.dvi 3 | *.idx 4 | *.ilg 5 | *.ind 6 | *.log 7 | *.toc 8 | *.ipr 9 | *.txt 10 | *.pdf 11 | *.ps 12 | pdfmanual.out 13 | manual.out 14 | -------------------------------------------------------------------------------- /manual/manual/texstuff/.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.dvi 3 | *.idx 4 | *.ilg 5 | *.ind 6 | *.log 7 | *.toc 8 | *.ipr 9 | *.txt 10 | *.pdf 11 | *.ps 12 | pdfmanual.out 13 | manual.out 14 | -------------------------------------------------------------------------------- /manual/manual/textman/.cvsignore: -------------------------------------------------------------------------------- 1 | manual.txt 2 | manual.hmanual.kwd 3 | *.haux 4 | *.hind 5 | *.htoc 6 | -------------------------------------------------------------------------------- /manual/manual/textman/.gitignore: -------------------------------------------------------------------------------- 1 | manual.txt 2 | manual.hmanual.kwd 3 | *.haux 4 | *.hind 5 | *.htoc 6 | -------------------------------------------------------------------------------- /manual/manual/tutorials/.cvsignore: -------------------------------------------------------------------------------- 1 | *.tex 2 | *.htex 3 | -------------------------------------------------------------------------------- /manual/manual/tutorials/.gitignore: -------------------------------------------------------------------------------- 1 | *.tex 2 | *.htex 3 | -------------------------------------------------------------------------------- /manual/manual/tutorials/advexamples.etex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/tutorials/advexamples.etex -------------------------------------------------------------------------------- /manual/manual/tutorials/objectexamples.etex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/manual/tutorials/objectexamples.etex -------------------------------------------------------------------------------- /manual/styles/doc.tfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/styles/doc.tfm -------------------------------------------------------------------------------- /manual/styles/docbf.tfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/styles/docbf.tfm -------------------------------------------------------------------------------- /manual/styles/docit.tfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/styles/docit.tfm -------------------------------------------------------------------------------- /manual/styles/docmi.tfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/styles/docmi.tfm -------------------------------------------------------------------------------- /manual/styles/docrm.tfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/styles/docrm.tfm -------------------------------------------------------------------------------- /manual/styles/doctt.tfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/styles/doctt.tfm -------------------------------------------------------------------------------- /manual/styles/fullpage.sty: -------------------------------------------------------------------------------- 1 | \marginparwidth 0pt \oddsidemargin 0pt \evensidemargin 0pt \marginparsep 0pt 2 | \topmargin 0pt \textwidth 6.5in \textheight 8.5 in 3 | -------------------------------------------------------------------------------- /manual/styles/isolatin.sty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/manual/styles/isolatin.sty -------------------------------------------------------------------------------- /manual/styles/scroll.sty: -------------------------------------------------------------------------------- 1 | % Modification to plaintext.sty to suppress page headings 2 | % and make pages contiguous when processed with dvi2txt 3 | 4 | \pagestyle{empty} 5 | \advance\voffset by -2\baselineskip 6 | -------------------------------------------------------------------------------- /manual/tools/.gitignore: -------------------------------------------------------------------------------- 1 | transf.ml 2 | texquote2 3 | htmltransf.ml 4 | transf 5 | htmlgen 6 | htmlquote 7 | latexscan.ml 8 | dvi2txt 9 | caml-tex2 10 | *.dSYM 11 | *.cm[io] 12 | *.o 13 | -------------------------------------------------------------------------------- /manual/tools/.ignore: -------------------------------------------------------------------------------- 1 | transf.ml 2 | texquote2 3 | htmltransf.ml 4 | transf 5 | htmlgen 6 | htmlquote 7 | latexscan.ml 8 | dvi2txt 9 | caml-tex2 10 | *.dSYM 11 | *.cm[io] 12 | -------------------------------------------------------------------------------- /manual/tools/dvi_to_txt/Makefile: -------------------------------------------------------------------------------- 1 | OBJS=io.o interp.o output.o main.o print.o print_rtf.o print_styl.o 2 | CFLAGS=-g 3 | 4 | ../dvi2txt: $(OBJS) 5 | $(CC) $(CFLAGS) -o ../dvi2txt $(OBJS) 6 | 7 | clean: 8 | rm -f ../dvi2txt *.o *~ #*# 9 | -------------------------------------------------------------------------------- /manual/tools/dvi_to_txt/dvi.h: -------------------------------------------------------------------------------- 1 | enum { 2 | SET_CHAR_0=0, SET_CHAR_127=127, SET1=128, SET2, SET3, SET4, SET_RULE, 3 | PUT1, PUT2, PUT3, PUT4, PUT_RULE, NOP, BOP, EOP, PUSH, POP, RIGHT1, 4 | RIGHT2, RIGHT3, RIGHT4, W0, W1, W2, W3, W4, X0, X1, X2, X3, X4, DOWN1, 5 | DOWN2, DOWN3, DOWN4, Y0, Y1, Y2, Y3, Y4, Z0, Z1, Z2, Z3, Z4, 6 | FNT_NUM_0=171, FNT_NUM_63=234, FNT1=235, FNT2, FNT3, FNT4, XXX1, XXX2, 7 | XXX3, XXX4, FNT_DEF1, FNT_DEF2, FNT_DEF3, FNT_DEF4, PRE, POST, POST_POST 8 | }; 9 | -------------------------------------------------------------------------------- /manual/tools/dvi_to_txt/io.h: -------------------------------------------------------------------------------- 1 | #ifdef __STDC__ 2 | typedef signed char schar; 3 | #else 4 | typedef char schar; 5 | #endif 6 | 7 | #define get8u(input) getc(input) 8 | #define get8s(input) (schar) getc(input) 9 | 10 | int get16u(), get16s(), get24u(), get24s(), get32u(), get32s(); 11 | -------------------------------------------------------------------------------- /manual/tools/dvi_to_txt/output.h: -------------------------------------------------------------------------------- 1 | #define SCALEX 404685 2 | #define SCALEY 786432 3 | 4 | int scalex; 5 | int scaley; 6 | 7 | #define PLAIN 0 8 | #define ITALICS 1 9 | #define BOLD 2 10 | #define MONOSPACED 3 11 | 12 | void begin_document(); 13 | void end_document(); 14 | void clear_page(); 15 | void output_page(); 16 | void out(); 17 | 18 | int output_device; 19 | int standout_tt; 20 | 21 | #define OUTPUT_PLAIN 0 22 | #define OUTPUT_PRINTER 1 23 | #define OUTPUT_RTF 2 24 | #define OUTPUT_STYL 3 25 | -------------------------------------------------------------------------------- /manual/tools/latexmacros.mli: -------------------------------------------------------------------------------- 1 | type action = 2 | Print of string 3 | | Print_arg 4 | | Skip_arg;; 5 | 6 | val find_macro: string -> action list;; 7 | 8 | val def_macro: string -> action list -> unit;; 9 | -------------------------------------------------------------------------------- /manual/tools/latexmain.ml: -------------------------------------------------------------------------------- 1 | let main () = 2 | Latexscan.main (Lexing.from_channel stdin);; 3 | 4 | Printexc.print main (); exit 0;; 5 | -------------------------------------------------------------------------------- /manual/tools/transfmain.ml: -------------------------------------------------------------------------------- 1 | let main() = 2 | let lexbuf = Lexing.from_channel stdin in 3 | if Array.length Sys.argv >= 2 && Sys.argv.(1) = "-html" 4 | then Htmltransf.main lexbuf 5 | else Transf.main lexbuf; 6 | exit 0;; 7 | 8 | Printexc.print main ();; 9 | -------------------------------------------------------------------------------- /otherlibs/str/.depend: -------------------------------------------------------------------------------- 1 | strstubs.o: strstubs.c ../../byterun/caml/mlvalues.h \ 2 | ../../byterun/caml/config.h ../../byterun/caml/../../config/m.h \ 3 | ../../byterun/caml/../../config/s.h ../../byterun/caml/misc.h \ 4 | ../../byterun/caml/alloc.h ../../byterun/caml/memory.h \ 5 | ../../byterun/caml/fail.h 6 | str.cmo : str.cmi 7 | str.cmx : str.cmi 8 | str.cmi : 9 | -------------------------------------------------------------------------------- /otherlibs/win32unix/.depend: -------------------------------------------------------------------------------- 1 | unix.cmo: unix.cmi 2 | unix.cmx: unix.cmi 3 | unixLabels.cmo: unix.cmi unixLabels.cmi 4 | unixLabels.cmx: unix.cmx unixLabels.cmi 5 | unixLabels.cmi: unix.cmi 6 | -------------------------------------------------------------------------------- /stdlib/expr.mli: -------------------------------------------------------------------------------- 1 | macro of_bool : bool -> bool expr 2 | macro of_int : int -> int expr 3 | macro of_float : float -> float expr 4 | macro of_char : char -> char expr 5 | macro of_string : string -> string expr 6 | macro of_list : ('a -> 'a expr) -> 'a list -> 'a list expr 7 | 8 | -------------------------------------------------------------------------------- /stdlib/hashbang: -------------------------------------------------------------------------------- 1 | #! -------------------------------------------------------------------------------- /testsuite/interactive/lib-graph-2/graph_test.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/interactive/lib-graph-2/graph_test.reference -------------------------------------------------------------------------------- /testsuite/interactive/lib-graph-3/sorts.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/interactive/lib-graph-3/sorts.reference -------------------------------------------------------------------------------- /testsuite/interactive/lib-graph/graph_example.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/interactive/lib-graph/graph_example.reference -------------------------------------------------------------------------------- /testsuite/tests/array-functions/test.reference: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /testsuite/tests/asmcomp/is_in_static_data.c: -------------------------------------------------------------------------------- 1 | #include "caml/address_class.h" 2 | 3 | value caml_is_in_static_data(value v) { 4 | return(Val_bool(Is_in_static_data(v))); 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/tests/asmcomp/is_static_flambda_dep.ml: -------------------------------------------------------------------------------- 1 | let pair = 1, 12 2 | -------------------------------------------------------------------------------- /testsuite/tests/asmcomp/lexcmm.mli: -------------------------------------------------------------------------------- 1 | val token: Lexing.lexbuf -> Parsecmm.token 2 | 3 | type error = 4 | Illegal_character 5 | | Unterminated_comment 6 | | Unterminated_string 7 | 8 | exception Error of error 9 | 10 | val report_error: Lexing.lexbuf -> error -> unit 11 | -------------------------------------------------------------------------------- /testsuite/tests/asmcomp/parsecmmaux.mli: -------------------------------------------------------------------------------- 1 | (* Auxiliary functions for parsing *) 2 | 3 | val bind_ident: string -> Ident.t 4 | val find_ident: string -> Ident.t 5 | val unbind_ident: Ident.t -> unit 6 | 7 | type error = 8 | Unbound of string 9 | 10 | exception Error of error 11 | 12 | val report_error: error -> unit 13 | -------------------------------------------------------------------------------- /testsuite/tests/asmcomp/unrolling_flambda.ml: -------------------------------------------------------------------------------- 1 | 2 | let rec f x = 3 | if x > 0 then f (x - 1) 4 | else 0 5 | [@@inline] 6 | 7 | let _ = f 0 8 | -------------------------------------------------------------------------------- /testsuite/tests/asmcomp/unrolling_flambda2.ml: -------------------------------------------------------------------------------- 1 | 2 | type t = { fn : t -> t -> int -> unit -> unit } 3 | 4 | let rec foo f b n x = 5 | if n < 0 then () 6 | else begin 7 | foo f b (n - 1) x; 8 | b.fn f b (n - 1) x 9 | end 10 | [@@specialise always] 11 | 12 | let rec bar f b n x = 13 | if n < 0 then () 14 | else begin 15 | bar f b (n - 1) x; 16 | f.fn f b (n - 1) x 17 | end 18 | [@@specialise always] 19 | 20 | let () = foo {fn = foo} {fn = bar} 10 () 21 | -------------------------------------------------------------------------------- /testsuite/tests/ast-invariants/test.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/ast-invariants/test.reference -------------------------------------------------------------------------------- /testsuite/tests/backtrace/backtrace..byte.reference: -------------------------------------------------------------------------------- 1 | Fatal error: exception Invalid_argument("index out of bounds") 2 | Raised by primitive operation at file "backtrace.ml", line 18, characters 12-24 3 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/backtrace..native.reference: -------------------------------------------------------------------------------- 1 | Fatal error: exception Invalid_argument("index out of bounds") 2 | Raised by primitive operation at file "backtrace.ml", line 18, characters 12-24 3 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/backtrace.a.byte.reference: -------------------------------------------------------------------------------- 1 | a 2 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/backtrace.a.native.reference: -------------------------------------------------------------------------------- 1 | a 2 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/backtrace.c.byte.reference: -------------------------------------------------------------------------------- 1 | Fatal error: exception Backtrace.Error("c") 2 | Raised at file "backtrace.ml", line 14, characters 26-37 3 | Called from file "backtrace.ml", line 18, characters 9-25 4 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/backtrace.c.native.reference: -------------------------------------------------------------------------------- 1 | Fatal error: exception Backtrace.Error("c") 2 | Raised at file "backtrace.ml", line 14, characters 20-37 3 | Called from file "backtrace.ml", line 18, characters 9-25 4 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/backtrace.ml: -------------------------------------------------------------------------------- 1 | 2 | (* A test for stack backtraces *) 3 | 4 | exception Error of string 5 | 6 | let rec f msg n = 7 | if n = 0 then raise(Error msg) else 1 + f msg (n-1) 8 | 9 | let g msg = 10 | try 11 | f msg 5 12 | with Error "a" -> print_string "a"; print_newline(); 0 13 | | Error "b" as exn -> print_string "b"; print_newline(); raise exn 14 | | Error "c" -> raise (Error "c") 15 | 16 | let _ = 17 | Printexc.record_backtrace true; 18 | ignore (g Sys.argv.(1)) 19 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/backtraces_and_finalizers.native.reference: -------------------------------------------------------------------------------- 1 | ok 2 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/inline_test.byte.reference: -------------------------------------------------------------------------------- 1 | inline_test.ml 2 | line 5 3 | characters 8-24 4 | inline_test.ml 5 | line 8 6 | characters 2-5 7 | inline_test.ml 8 | line 11 9 | characters 12-17 10 | inline_test.ml 11 | line 14 12 | characters 5-8 13 | inline_test.ml 14 | line 18 15 | characters 2-6 16 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/inline_test.ml: -------------------------------------------------------------------------------- 1 | 2 | (* A test for inlined stack backtraces *) 3 | 4 | let f x = 5 | raise (Failure "test") + 1 6 | 7 | let g x = 8 | f x + 1 9 | 10 | let h x = 11 | print_int (g x); print_endline "h" 12 | 13 | let i x = 14 | if h x = () then () 15 | 16 | let () = 17 | Printexc.record_backtrace true; 18 | i () 19 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/inline_test.native.reference: -------------------------------------------------------------------------------- 1 | inline_test.ml 2 | line 5 3 | characters 2-24 4 | inline_test.ml 5 | line 8 6 | characters 2-5 7 | inline_test.ml 8 | line 11 9 | characters 12-17 10 | inline_test.ml 11 | line 14 12 | characters 5-8 13 | inline_test.ml 14 | line 18 15 | characters 2-6 16 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/inline_traversal_test.byte.reference: -------------------------------------------------------------------------------- 1 | inline_traversal_test.ml:5 2 | inline_traversal_test.ml:8 3 | inline_traversal_test.ml:11 4 | inline_traversal_test.ml:14 5 | inline_traversal_test.ml:19 6 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/inline_traversal_test.native.reference: -------------------------------------------------------------------------------- 1 | inline_traversal_test.ml:5 2 | inline_traversal_test.ml:8 3 | inline_traversal_test.ml:11 4 | inline_traversal_test.ml:14 5 | inline_traversal_test.ml:19 6 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/pr6920_why_at.byte.reference: -------------------------------------------------------------------------------- 1 | Fatal error: exception Pervasives.Exit 2 | Raised at file "pr6920_why_at.ml", line 1, characters 41-45 3 | Called from file "pr6920_why_at.ml", line 3, characters 2-11 4 | Called from file "pr6920_why_at.ml", line 9, characters 2-6 5 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/pr6920_why_at.ml: -------------------------------------------------------------------------------- 1 | let why : unit -> unit = fun () -> raise Exit [@@inline never] 2 | let f () = 3 | why @@ (); 4 | ignore (3 + 2); 5 | () [@@inline never] 6 | 7 | let () = 8 | Printexc.record_backtrace true; 9 | f () 10 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/pr6920_why_at.native.reference: -------------------------------------------------------------------------------- 1 | Fatal error: exception Pervasives.Exit 2 | Raised at file "pr6920_why_at.ml", line 1, characters 35-45 3 | Called from file "pr6920_why_at.ml", line 3, characters 2-11 4 | Called from file "pr6920_why_at.ml", line 9, characters 2-6 5 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/pr6920_why_swallow.byte.reference: -------------------------------------------------------------------------------- 1 | Fatal error: exception Pervasives.Exit 2 | Raised at file "pr6920_why_swallow.ml", line 1, characters 41-45 3 | Called from file "pr6920_why_swallow.ml", line 4, characters 4-14 4 | Called from file "pr6920_why_swallow.ml", line 11, characters 2-6 5 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/pr6920_why_swallow.ml: -------------------------------------------------------------------------------- 1 | let why : unit -> unit = fun () -> raise Exit [@@inline never] 2 | let f () = 3 | for i = 1 to 10 do 4 | why @@ (); 5 | done; 6 | ignore (3 + 2); 7 | () [@@inline never] 8 | 9 | let () = 10 | Printexc.record_backtrace true; 11 | f () 12 | -------------------------------------------------------------------------------- /testsuite/tests/backtrace/pr6920_why_swallow.native.reference: -------------------------------------------------------------------------------- 1 | Fatal error: exception Pervasives.Exit 2 | Raised at file "pr6920_why_swallow.ml", line 1, characters 35-45 3 | Called from file "pr6920_why_swallow.ml", line 4, characters 4-14 4 | Called from file "pr6920_why_swallow.ml", line 11, characters 2-6 5 | -------------------------------------------------------------------------------- /testsuite/tests/basic-float/tfloat_hex.ml: -------------------------------------------------------------------------------- 1 | let try_float_of_string str = 2 | try 3 | print_float (float_of_string str); 4 | print_newline () 5 | with exn -> 6 | print_endline (Printexc.to_string exn) 7 | ;; 8 | 9 | let () = 10 | try_float_of_string "0x1A"; 11 | try_float_of_string "0x1Ap3"; 12 | try_float_of_string "0x"; 13 | try_float_of_string "0x."; 14 | try_float_of_string "0xp0"; 15 | try_float_of_string "0x.p0"; 16 | -------------------------------------------------------------------------------- /testsuite/tests/basic-float/tfloat_hex.reference: -------------------------------------------------------------------------------- 1 | 26. 2 | 208. 3 | Failure("float_of_string") 4 | Failure("float_of_string") 5 | Failure("float_of_string") 6 | Failure("float_of_string") 7 | -------------------------------------------------------------------------------- /testsuite/tests/basic-float/tfloat_record.reference: -------------------------------------------------------------------------------- 1 | 1. 2 | 1. 3 | 2. 4 | 3. 5 | 6 | 1. 7 | 2. 8 | 3. 9 | 4. 10 | 5. 11 | 6. 12 | 7. 13 | 8. 14 | 9. 15 | 0. 16 | 1. 17 | 2. 18 | 3. 19 | 4. 20 | 5. 21 | 6. 22 | 7. 23 | 8. 24 | 9. 25 | 0. 26 | 1. 27 | 2. 28 | 3. 29 | 4. 30 | 5. 31 | 6. 32 | 7. 33 | 8. 34 | 9. 35 | 0. 36 | 1. 37 | 2. 38 | 3. 39 | 4. 40 | 5. 41 | 6. 42 | 7. 43 | 8. 44 | 9. 45 | 0. 46 | 47 | -------------------------------------------------------------------------------- /testsuite/tests/basic-io-2/io.reference: -------------------------------------------------------------------------------- 1 | 16-byte chunks 2 | passed 3 | 256-byte chunks 4 | passed 5 | 4096-byte chunks 6 | passed 7 | 65536-byte chunks 8 | passed 9 | 19-byte chunks 10 | passed 11 | 263-byte chunks 12 | passed 13 | 4011-byte chunks 14 | passed 15 | 0...8192 byte chunks 16 | passed 17 | line per line, short lines 18 | passed 19 | line per line, short and long lines 20 | passed 21 | backwards, 4096-byte chunks 22 | passed 23 | backwards, 64-byte chunks 24 | passed 25 | -------------------------------------------------------------------------------- /testsuite/tests/basic-io-2/test-file-short-lines: -------------------------------------------------------------------------------- 1 | ## 2 | # Host Database 3 | # 4 | # localhost is used to configure the loopback interface 5 | # when the system is booting. Do not change this entry. 6 | ## 7 | 127.0.0.1 localhost 8 | 255.255.255.255 broadcasthost 9 | ::1 localhost 10 | fe80::1%lo0 localhost 11 | -------------------------------------------------------------------------------- /testsuite/tests/basic-io/wc.reference: -------------------------------------------------------------------------------- 1 | 1199 characters, 178 words, 55 lines 2 | -------------------------------------------------------------------------------- /testsuite/tests/basic-modules/main.ml: -------------------------------------------------------------------------------- 1 | (* PR#6435 *) 2 | 3 | module F (M : sig 4 | type t 5 | module Set : Set.S with type elt = t 6 | end) = 7 | struct 8 | let test set = Printf.printf "%d\n" (M.Set.cardinal set) 9 | end 10 | 11 | module M = F (Offset) 12 | 13 | let () = M.test (Offset.M.Set.singleton "42") 14 | let v = Pr6726.Test.v 15 | -------------------------------------------------------------------------------- /testsuite/tests/basic-modules/main.mli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/basic-modules/main.mli -------------------------------------------------------------------------------- /testsuite/tests/basic-modules/main.reference: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /testsuite/tests/basic-modules/offset.ml: -------------------------------------------------------------------------------- 1 | module M = struct 2 | type t = string 3 | 4 | let x = 0 5 | let x = 1 6 | 7 | module Set = Set.Make(String) 8 | end 9 | 10 | include M 11 | -------------------------------------------------------------------------------- /testsuite/tests/basic-modules/pr6726.ml: -------------------------------------------------------------------------------- 1 | module ExtUnixAll = struct 2 | external unused : unit -> unit = "caml_blit_string" 3 | module BigEndian = struct 4 | let get_uint8 str off = 33 5 | end 6 | end 7 | 8 | module ExtUnix = struct 9 | module All = ExtUnixAll 10 | end 11 | 12 | module Test = struct 13 | open ExtUnix.All 14 | let test_endian_string x = 15 | let module B = BigEndian in 16 | B.get_uint8 x 0 17 | let v = test_endian_string 1 18 | end 19 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/bounds.reference: -------------------------------------------------------------------------------- 1 | 0: doesn't fail 2 | 1: doesn't fail 3 | 2: doesn't fail 4 | 3: fails 5 | 4: fails 6 | -1: fails 7 | Trail: -1 4 3 2 1 0 8 | 9 | All tests succeeded. 10 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/function_in_ref.ml: -------------------------------------------------------------------------------- 1 | 2 | let f x = x + 1 3 | let g x = x - 1 4 | 5 | let run () = 6 | let r = ref f in 7 | r := g; 8 | let n = !r 1 in 9 | assert(n = 0) 10 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/function_in_ref.reference: -------------------------------------------------------------------------------- 1 | 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/if_in_if.reference: -------------------------------------------------------------------------------- 1 | 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/morematch.reference: -------------------------------------------------------------------------------- 1 | 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/opaque_prim.ml: -------------------------------------------------------------------------------- 1 | let f x = Sys.opaque_identity x 2 | 3 | let () = 4 | assert(f f == f); 5 | assert(Sys.opaque_identity 1 = 1); 6 | assert(Sys.opaque_identity 1. = 1.) 7 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/opaque_prim.reference: -------------------------------------------------------------------------------- 1 | 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/pr2719.reference: -------------------------------------------------------------------------------- 1 | Value of test at the beginning : false 2 | Value of test now : false 3 | 4 | All tests succeeded. 5 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/pr6216.ml: -------------------------------------------------------------------------------- 1 | (* PR6216: wrong inlining of GADT match *) 2 | 3 | type _ t = 4 | | Float : float t 5 | | String : string t 6 | 7 | let f : type a . a t -> a -> unit = fun t a -> 8 | match t with 9 | | Float -> () 10 | | String -> ignore (String.length a : int) 11 | 12 | let _g (kind : float t) (x : float) : unit = f kind (x *. 13.) 13 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/pr6216.reference: -------------------------------------------------------------------------------- 1 | 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/record_evaluation_order.reference: -------------------------------------------------------------------------------- 1 | d1 2 | c1 3 | b1 4 | a1 5 | d2 6 | c2 7 | b2 8 | a2 9 | default 10 | d3 11 | c3 12 | a3 13 | 14 | x9 15 | x8 16 | x7 17 | x6 18 | x5 19 | x4 20 | x3 21 | x2 22 | x1 23 | 24 | x7 25 | x2 26 | 27 | x7 28 | x2 29 | 30 | x7 31 | x5 32 | x2 33 | 34 | x7 35 | x5 36 | x2 37 | 38 | All tests succeeded. 39 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/tbuffer.reference: -------------------------------------------------------------------------------- 1 | 0 1 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/testrandom.ml: -------------------------------------------------------------------------------- 1 | open Random 2 | 3 | let _ = 4 | for i = 0 to 20 do 5 | print_char ' '; print_int (int 1000); 6 | done; 7 | print_newline (); print_newline (); 8 | for i = 0 to 20 do 9 | print_char ' '; print_float (float 1000.); 10 | done 11 | 12 | let _ = exit 0 13 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/testrandom.reference: -------------------------------------------------------------------------------- 1 | 344 685 182 641 439 500 104 20 921 370 217 885 949 678 615 412 401 606 428 869 289 2 | 3 | 122.128067547 461.324792129 360.006556146 768.75882284 396.500946942 190.217751234 567.660068681 403.59226778 59.8488223602 363.816246826 764.705761642 172.627051105 481.861849093 399.173195422 629.424106752 391.547032203 676.701133948 174.382120878 994.425675487 585.00027757 34.3270777955 4 | All tests succeeded. 5 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/tformat.ml: -------------------------------------------------------------------------------- 1 | (* 2 | 3 | A testbed file for the module Format. 4 | 5 | *) 6 | 7 | open Testing;; 8 | 9 | open Format;; 10 | 11 | (* BR#4769 *) 12 | let test0 () = 13 | let b = Buffer.create 10 in 14 | let msg = "Hello world!" in 15 | Format.bprintf b "%s" msg; 16 | let s = Buffer.contents b in 17 | s = msg 18 | ;; 19 | 20 | test (test0 ()) 21 | ;; 22 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/tformat.reference: -------------------------------------------------------------------------------- 1 | 0 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/top_level_patterns.ml: -------------------------------------------------------------------------------- 1 | 2 | type t = 3 | | A of (int * int * int) 4 | | B of int * int 5 | 6 | let (A (a, _, b) | B (b, a)) = A (1, 2, 3) 7 | 8 | let () = print_int a; print_int b 9 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/top_level_patterns.reference: -------------------------------------------------------------------------------- 1 | 13 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/basic-more/tprintf.reference: -------------------------------------------------------------------------------- 1 | 0 1 2 3 4 5 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/basic-multdef/multdef.ml: -------------------------------------------------------------------------------- 1 | let f x = x + 1 2 | external g : string -> int = "caml_int_of_string" 3 | -------------------------------------------------------------------------------- /testsuite/tests/basic-multdef/multdef.mli: -------------------------------------------------------------------------------- 1 | val f : int -> int 2 | val f : int -> int 3 | val g : string -> int 4 | -------------------------------------------------------------------------------- /testsuite/tests/basic-multdef/usemultdef.ml: -------------------------------------------------------------------------------- 1 | let _ = print_int(Multdef.f 1); print_newline(); exit 0 2 | -------------------------------------------------------------------------------- /testsuite/tests/basic-multdef/usemultdef.reference: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /testsuite/tests/basic-private/length.ml: -------------------------------------------------------------------------------- 1 | (* 2 | 3 | A testbed file for private type abbreviation definitions. 4 | 5 | We define a Length module to implement positive integers. 6 | 7 | *) 8 | 9 | type t = int;; 10 | 11 | let make x = 12 | if x >= 0 then x else 13 | failwith (Printf.sprintf "cannot build negative length : %i" x) 14 | ;; 15 | 16 | external from : t -> int = "%identity";; 17 | -------------------------------------------------------------------------------- /testsuite/tests/basic-private/length.mli: -------------------------------------------------------------------------------- 1 | (* 2 | 3 | A testbed file for private type abbreviation definitions. 4 | 5 | We define a Length module to implement positive integers. 6 | 7 | *) 8 | 9 | type t = private int;; 10 | 11 | val make : int -> t;; 12 | 13 | external from : t -> int = "%identity";; 14 | -------------------------------------------------------------------------------- /testsuite/tests/basic-private/tlength.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/basic-private/tlength.reference -------------------------------------------------------------------------------- /testsuite/tests/basic/arrays.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/basic/arrays.reference -------------------------------------------------------------------------------- /testsuite/tests/basic/bigints.reference: -------------------------------------------------------------------------------- 1 | 1000000000 2 | 10000000000 3 | 100000000000 4 | 1000000000000 5 | 10000000000000 6 | 100000000000000 7 | 1000000000000000 8 | 10000000000000000 9 | 100000000000000000 10 | 1000000000000000000 11 | -------------------------------------------------------------------------------- /testsuite/tests/basic/constprop.reference: -------------------------------------------------------------------------------- 1 | booleans: passed 2 | integers: passed 3 | floats: passed 4 | 32-bit integers: passed 5 | native integers: passed 6 | 64-bit integers: passed 7 | integer conversions: passed 8 | 32-bit integer conversions: passed 9 | native integer conversions: passed 10 | 64-bit integer conversions: passed 11 | -------------------------------------------------------------------------------- /testsuite/tests/basic/divint.reference: -------------------------------------------------------------------------------- 1 | 1 int 2 | 2 int 3 | 3 int 4 | 4 int 5 | 5 int 6 | 6 int 7 | 7 int 8 | 9 int 9 | 10 int 10 | 11 int 11 | 12 int 12 | 25 int 13 | 55 int 14 | 125 int 15 | 625 int 16 | -1 int 17 | -2 int 18 | -3 int 19 | 1 nat 20 | 2 nat 21 | 3 nat 22 | 4 nat 23 | 5 nat 24 | 6 nat 25 | 7 nat 26 | 9 nat 27 | 10 nat 28 | 11 nat 29 | 12 nat 30 | 25 nat 31 | 55 nat 32 | 125 nat 33 | 625 nat 34 | -1 nat 35 | -2 nat 36 | -3 nat 37 | Test passed. 38 | -------------------------------------------------------------------------------- /testsuite/tests/basic/float.ml: -------------------------------------------------------------------------------- 1 | Printf.printf "1./.0. = %f\n" (1.0 /. 0.0);; 2 | -------------------------------------------------------------------------------- /testsuite/tests/basic/float.reference: -------------------------------------------------------------------------------- 1 | 1./.0. = inf 2 | -------------------------------------------------------------------------------- /testsuite/tests/basic/float_physical_equality.ml: -------------------------------------------------------------------------------- 1 | let a = -0. 2 | let b = +0. 3 | 4 | let _ = 5 | assert(not (a == b)) 6 | 7 | let f () = 8 | let a = -0. in 9 | let b = +0. in 10 | assert(not (a == b)) 11 | -------------------------------------------------------------------------------- /testsuite/tests/basic/float_physical_equality.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/basic/float_physical_equality.reference -------------------------------------------------------------------------------- /testsuite/tests/basic/includestruct.reference: -------------------------------------------------------------------------------- 1 | 1, 2 2 | 2, 3 3 | 124, 457 4 | 0 5 | 2 6 | 2 7 | 1 8 | 3 9 | F is called 10 | A 11 | 42 12 | A 13 | 42 14 | foo1 15 | foo1 16 | -------------------------------------------------------------------------------- /testsuite/tests/basic/localexn.ml: -------------------------------------------------------------------------------- 1 | let f (type t) () = 2 | let exception E of t in 3 | (fun x -> E x), (function E _ -> print_endline "OK" | _ -> print_endline "KO") 4 | 5 | let inj1, proj1 = f () 6 | let inj2, proj2 = f () 7 | 8 | let () = proj1 (inj1 42) 9 | let () = proj1 (inj2 42) 10 | -------------------------------------------------------------------------------- /testsuite/tests/basic/localexn.reference: -------------------------------------------------------------------------------- 1 | OK 2 | KO 3 | -------------------------------------------------------------------------------- /testsuite/tests/basic/maps.reference: -------------------------------------------------------------------------------- 1 | Union+concat 2 | 0 AB 3 | 3 X1 4 | 5 X2 5 | Inter 6 | 4 Y 7 | Union+concat (with Map.union) 8 | 0 AB 9 | 3 X1 10 | 5 X2 11 | -------------------------------------------------------------------------------- /testsuite/tests/basic/min_int.ml: -------------------------------------------------------------------------------- 1 | (* This will test the parsing of the smallest integer on 32-bit architectures. 2 | It doesn't do much on 64-bit but at least it doesn't crash. 3 | *) 4 | 5 | let min_int = -1073741824 6 | let () = match min_int with 7 | | -1073741824 as i -> 8 | assert (string_of_int i = "-1073741824"); 9 | print_endline "OK" 10 | | _ -> assert false 11 | -------------------------------------------------------------------------------- /testsuite/tests/basic/min_int.reference: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /testsuite/tests/basic/recvalues.reference: -------------------------------------------------------------------------------- 1 | Test 1: passed 2 | Test 2: passed 3 | Test 3: passed 4 | foo 5 | Test 4: passed 6 | -------------------------------------------------------------------------------- /testsuite/tests/basic/sets.reference: -------------------------------------------------------------------------------- 1 | -10 true false 2 | -9 false false 3 | -8 false false 4 | -7 false true 5 | -6 false false 6 | -5 false false 7 | -4 false false 8 | -3 false true 9 | -2 true false 10 | -1 false false 11 | 0 true false 12 | 1 false true 13 | 2 true false 14 | 3 false false 15 | 4 true false 16 | 5 false true 17 | 6 true false 18 | 7 false false 19 | 8 false false 20 | 9 false true 21 | 10 false false 22 | false 23 | true 24 | true 25 | false 26 | -------------------------------------------------------------------------------- /testsuite/tests/basic/stringmatch.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/basic/stringmatch.reference -------------------------------------------------------------------------------- /testsuite/tests/basic/tailcalls.reference: -------------------------------------------------------------------------------- 1 | 10000001 2 | 10000001 3 | 10000001 4 | 11 5 | 11 6 | 10000001 7 | -------------------------------------------------------------------------------- /testsuite/tests/callback/reference: -------------------------------------------------------------------------------- 1 | 7 2 | 7 3 | 7 4 | 7 5 | 7 6 | aaaaa 7 | aaaaa 8 | bbbbb 9 | -------------------------------------------------------------------------------- /testsuite/tests/docstrings/Makefile: -------------------------------------------------------------------------------- 1 | 2 | BASEDIR=../.. 3 | include $(BASEDIR)/makefiles/Makefile.dparsetree 4 | include $(BASEDIR)/makefiles/Makefile.common 5 | -------------------------------------------------------------------------------- /testsuite/tests/docstrings/empty.ml: -------------------------------------------------------------------------------- 1 | type t = Label (**) 2 | (** attached to t *) 3 | 4 | (**) 5 | 6 | (** Empty docstring comments should not generate attributes *) 7 | 8 | type w (**) 9 | -------------------------------------------------------------------------------- /testsuite/tests/embedded/cmcaml.ml: -------------------------------------------------------------------------------- 1 | (* OCaml part of the code *) 2 | 3 | let rec fib n = 4 | if n < 2 then 1 else fib(n-1) + fib(n-2) 5 | 6 | let format_result n = 7 | let r = "Result = " ^ string_of_int n in 8 | (* Allocate gratuitously to test GC *) 9 | for i = 1 to 1500 do ignore (Bytes.create 256) done; 10 | r 11 | 12 | (* Registration *) 13 | 14 | let _ = 15 | Callback.register "fib" fib; 16 | Callback.register "format_result" format_result 17 | -------------------------------------------------------------------------------- /testsuite/tests/embedded/program.reference: -------------------------------------------------------------------------------- 1 | Initializing OCaml code... 2 | Back in C code... 3 | Computing fib(20)... 4 | Result = 10946 5 | -------------------------------------------------------------------------------- /testsuite/tests/exotic-syntax/exotic.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/exotic-syntax/exotic.reference -------------------------------------------------------------------------------- /testsuite/tests/extension-constructor/test.reference: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /testsuite/tests/float-unboxing/float_subst_boxed_number.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/float-unboxing/float_subst_boxed_number.reference -------------------------------------------------------------------------------- /testsuite/tests/formats-transition/Makefile: -------------------------------------------------------------------------------- 1 | BASEDIR=../.. 2 | include $(BASEDIR)/makefiles/Makefile.toplevel 3 | include $(BASEDIR)/makefiles/Makefile.common 4 | -------------------------------------------------------------------------------- /testsuite/tests/formats-transition/deprecated_unsigned_printers.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # * * val test : (int -> string, unit, string) format -> string = 3 | # %n: true 4 | # %l: true 5 | # %N: true 6 | # %L: true 7 | # 8 | -------------------------------------------------------------------------------- /testsuite/tests/formats-transition/legacy_incompatible_flags.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # * toto 3 | # toto 4 | # toto 5 | # toto 6 | # "toto" 7 | # toto 8 | # * * * 9 | -------------------------------------------------------------------------------- /testsuite/tests/formats-transition/legacy_unfinished_modifiers.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # * * * * * * * * 3 3 | # 3 4 | # 3 5 | # 3 6 | # 7 | -------------------------------------------------------------------------------- /testsuite/tests/formatting/Makefile: -------------------------------------------------------------------------------- 1 | BASEDIR=../.. 2 | MAIN_MODULE=margins 3 | 4 | include $(BASEDIR)/makefiles/Makefile.toplevel 5 | include $(BASEDIR)/makefiles/Makefile.common 6 | -------------------------------------------------------------------------------- /testsuite/tests/formatting/margins.ml: -------------------------------------------------------------------------------- 1 | let () = Format.pp_set_margin Format.std_formatter 20;; 2 | 3 | 1 + "foo";; 4 | 5 | let () = Format.pp_set_margin Format.std_formatter 80;; 6 | 7 | 1 + "foo";; 8 | -------------------------------------------------------------------------------- /testsuite/tests/formatting/margins.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # # Characters 5-10: 3 | 1 + "foo";; 4 | ^^^^^ 5 | Error: This expression has type 6 | string 7 | but an expression was expected of type 8 | int 9 | # # Characters 5-10: 10 | 1 + "foo";; 11 | ^^^^^ 12 | Error: This expression has type string but an expression was expected of type 13 | int 14 | # 15 | -------------------------------------------------------------------------------- /testsuite/tests/int64-unboxing/test.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/int64-unboxing/test.reference -------------------------------------------------------------------------------- /testsuite/tests/lazy/lazy1.ml: -------------------------------------------------------------------------------- 1 | (* Mantis 7301, due to A. Frisch *) 2 | 3 | let foo () = 4 | (fun xs0 () -> Lazy.force (List.hd xs0) ()) 5 | (List.map (fun g -> lazy g) 6 | [Lazy.force ( lazy ( let _ = () in fun () -> () ) )] 7 | ) 8 | 9 | let () = 10 | let gen = foo () in 11 | gen (); 12 | Gc.compact (); 13 | print_char 'A'; flush stdout; 14 | gen () 15 | -------------------------------------------------------------------------------- /testsuite/tests/lazy/lazy1.reference: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /testsuite/tests/letrec/backreferences.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/letrec/backreferences.reference -------------------------------------------------------------------------------- /testsuite/tests/letrec/class_1.ml: -------------------------------------------------------------------------------- 1 | (* class expression are compiled to recursive bindings *) 2 | class test = 3 | object 4 | method x = 1 5 | end 6 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/class_1.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/letrec/class_1.reference -------------------------------------------------------------------------------- /testsuite/tests/letrec/class_2.ml: -------------------------------------------------------------------------------- 1 | (* class expressions may also contain local recursive bindings *) 2 | class test = 3 | let rec f = print_endline "f"; fun x -> g x 4 | and g = print_endline "g"; fun x -> f x in 5 | object 6 | method f : 'a 'b. 'a -> 'b = f 7 | method g : 'a 'b. 'a -> 'b = g 8 | end 9 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/class_2.reference: -------------------------------------------------------------------------------- 1 | f 2 | g 3 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/evaluation_order_1.reference: -------------------------------------------------------------------------------- 1 | effect 2 | effect 3 | effect 4 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/evaluation_order_2.reference: -------------------------------------------------------------------------------- 1 | effect 2 | effect 3 | effect 4 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/evaluation_order_3.ml: -------------------------------------------------------------------------------- 1 | type t = { x : t; y : t } 2 | 3 | let p = print_endline 4 | 5 | let test = 6 | let rec x = p "x"; { x = (p "x_x"; x); y = (p "x_y"; y) } 7 | and y = p "y"; { x = (p "y_x"; x); y = (p "y_y"; y) } 8 | in 9 | assert (x.x == x); assert (x.y == y); 10 | assert (y.x == x); assert (y.y == y); 11 | () 12 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/evaluation_order_3.reference: -------------------------------------------------------------------------------- 1 | x 2 | x_y 3 | x_x 4 | y 5 | y_y 6 | y_x 7 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/float_block_1.ml: -------------------------------------------------------------------------------- 1 | (* Effect are not named to allow different evaluation orders (flambda 2 | and clambda differ on this point). 3 | *) 4 | let test = 5 | let rec x = print_endline "effect"; [| 1; 2; 3 |] 6 | and y = print_endline "effect"; [| 1.; 2.; 3. |] 7 | in 8 | assert (x = [| 1; 2; 3 |]); 9 | assert (y = [| 1.; 2.; 3. |]); 10 | () 11 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/float_block_1.reference: -------------------------------------------------------------------------------- 1 | effect 2 | effect 3 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/float_block_2.ml: -------------------------------------------------------------------------------- 1 | (* a bug in cmmgen.ml provokes a segfault in certain natively compiled 2 | letrec-bindings involving float arrays *) 3 | let test = 4 | let rec x = [| y; y |] and y = 1. in 5 | assert (x = [| 1.; 1. |]); 6 | assert (y = 1.); 7 | () 8 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/float_block_2.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/letrec/float_block_2.reference -------------------------------------------------------------------------------- /testsuite/tests/letrec/lists.ml: -------------------------------------------------------------------------------- 1 | (* a test with lists, because cyclic lists are fun *) 2 | let test = 3 | let rec li = 0::1::2::3::4::5::6::7::8::9::li in 4 | match li with 5 | | 0::1::2::3::4::5::6::7::8::9:: 6 | 0::1::2::3::4::5::6::7::8::9::li' -> 7 | assert (li == li') 8 | | _ -> assert false 9 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/lists.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/letrec/lists.reference -------------------------------------------------------------------------------- /testsuite/tests/letrec/mixing_value_closures_1.ml: -------------------------------------------------------------------------------- 1 | (* mixing values and closures may exercise interesting code paths *) 2 | type t = A of (int -> int) 3 | let test = 4 | let rec x = A f 5 | and f = function 6 | | 0 -> 2 7 | | n -> match x with A g -> g 0 8 | in assert (f 1 = 2) 9 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/mixing_value_closures_1.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/letrec/mixing_value_closures_1.reference -------------------------------------------------------------------------------- /testsuite/tests/letrec/mixing_value_closures_2.ml: -------------------------------------------------------------------------------- 1 | (* a polymorphic variant of test3.ml; found a real bug once *) 2 | let test = 3 | let rec x = `A f 4 | and f = function 5 | | 0 -> 2 6 | | n -> match x with `A g -> g 0 7 | in 8 | assert (f 1 = 2) 9 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/mixing_value_closures_2.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/letrec/mixing_value_closures_2.reference -------------------------------------------------------------------------------- /testsuite/tests/letrec/mutual_functions.ml: -------------------------------------------------------------------------------- 1 | (* a simple test with mutually recursive functions *) 2 | let test = 3 | let rec even = function 4 | | 0 -> true 5 | | n -> odd (n - 1) 6 | and odd = function 7 | | 0 -> false 8 | | n -> even (n - 1) 9 | in 10 | List.iter (fun i -> assert (even i <> odd i && even i = (i mod 2 = 0))) 11 | [0;1;2;3;4;5;6] 12 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/mutual_functions.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/letrec/mutual_functions.reference -------------------------------------------------------------------------------- /testsuite/tests/letrec/record_with.ml: -------------------------------------------------------------------------------- 1 | (* A regression test for both PR#4141 and PR#5819: when a recursive 2 | variable is defined by a { record with ... } expression. 3 | *) 4 | 5 | type t = { 6 | self : t; 7 | t0 : int; 8 | t1 : int; 9 | t2 : int; 10 | t3 : int; 11 | t4 : int; 12 | };; 13 | let rec t = { 14 | self = t; 15 | t0 = 42; 16 | t1 = 42; 17 | t2 = 42; 18 | t3 = 42; 19 | t4 = 42; 20 | };; 21 | 22 | let rec self = { t with self=self } in 23 | Printf.printf "%d\n" self.self.t0 24 | ;; 25 | -------------------------------------------------------------------------------- /testsuite/tests/letrec/record_with.reference: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-arg/testarg.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/lib-arg/testarg.reference -------------------------------------------------------------------------------- /testsuite/tests/lib-bigarray/fftba.reference: -------------------------------------------------------------------------------- 1 | 16... ok 2 | 32... ok 3 | 64... ok 4 | 128... ok 5 | 256... ok 6 | 512... ok 7 | 1024... ok 8 | 2048... ok 9 | 4096... ok 10 | 8192... ok 11 | 16384... ok 12 | 32768... ok 13 | 65536... ok 14 | -------------------------------------------------------------------------------- /testsuite/tests/lib-bigarray/pr5115.ml: -------------------------------------------------------------------------------- 1 | (* PR#5115 - multiple evaluation of bigarray expr *) 2 | 3 | open Bigarray 4 | 5 | let f y0 = 6 | Printf.printf "***EXEC***\n%!"; 7 | y0 8 | 9 | let _ = 10 | let y = Array1.of_array float64 fortran_layout [| 1. |] in 11 | (f y).{1}; 12 | (f y).{1} <- 3.14 13 | -------------------------------------------------------------------------------- /testsuite/tests/lib-bigarray/pr5115.reference: -------------------------------------------------------------------------------- 1 | ***EXEC*** 2 | ***EXEC*** 3 | -------------------------------------------------------------------------------- /testsuite/tests/lib-digest/md5.reference: -------------------------------------------------------------------------------- 1 | Test vectors passed. 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-bytecode/custom.reference: -------------------------------------------------------------------------------- 1 | This is stub2, calling stub1: 2 | This is stub1! 3 | Ok! 4 | This is stub1! 5 | ABCDEF 6 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-bytecode/main.reference: -------------------------------------------------------------------------------- 1 | Loading plug1.cma 2 | This is stub1! 3 | ABCDEF 4 | Loading plug2.cma 5 | This is stub2, calling stub1: 6 | This is stub1! 7 | Ok! 8 | This is Plug2.f 9 | Result is: 2 10 | This is Plug1.f 11 | Result is: 1 12 | This is Main.f 13 | Result is: 0 14 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-bytecode/plug1.ml: -------------------------------------------------------------------------------- 1 | external stub1: unit -> string = "stub1" 2 | 3 | let f x = print_string "This is Plug1.f\n"; x + 1 4 | 5 | let () = Registry.register f 6 | 7 | let () = print_endline (stub1 ()) 8 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-bytecode/plug2.ml: -------------------------------------------------------------------------------- 1 | external stub2: unit -> unit = "stub2" 2 | 3 | let f x = print_string "This is Plug2.f\n"; x + 2 4 | 5 | let () = Registry.register f 6 | 7 | let () = stub2 () 8 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-bytecode/registry.ml: -------------------------------------------------------------------------------- 1 | let functions = ref ([]: (int -> int) list) 2 | 3 | let register f = 4 | functions := f :: !functions 5 | 6 | let get_functions () = 7 | !functions 8 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-bytecode/static.reference: -------------------------------------------------------------------------------- 1 | This is stub1! 2 | ABCDEF 3 | This is stub2, calling stub1: 4 | This is stub1! 5 | Ok! 6 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-csharp/bytecode.reference: -------------------------------------------------------------------------------- 1 | Now starting the OCaml engine. 2 | Main is running. 3 | Loading ../../../otherlibs/bigarray/bigarray.cma 4 | Loading plugin.cmo 5 | I'm the plugin. 6 | OK. 7 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-csharp/main.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | public class M { 4 | [DllImport("main.dll")] 5 | public static extern void start_caml_engine(); 6 | 7 | public static void Main() { 8 | System.Console.WriteLine("Now starting the OCaml engine."); 9 | start_caml_engine(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-csharp/native.reference: -------------------------------------------------------------------------------- 1 | Now starting the OCaml engine. 2 | Main is running. 3 | Loading ../../../otherlibs/bigarray/bigarray.cmxs 4 | Loading plugin.cmxs 5 | I'm the plugin. 6 | OK. 7 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-csharp/plugin.ml: -------------------------------------------------------------------------------- 1 | let f x = x.{2} 2 | 3 | let () = 4 | print_endline "I'm the plugin." 5 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/a.ml: -------------------------------------------------------------------------------- 1 | let x = ref 0 2 | let u = Random.int 1000 3 | 4 | let () = 5 | Printf.printf "A is running (%i)\n%!" u 6 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/api.ml: -------------------------------------------------------------------------------- 1 | let mods = ref [] 2 | 3 | let reg_mod name = 4 | if List.mem name !mods then 5 | Printf.printf "Reloading module %s\n" name 6 | else ( 7 | mods := name :: !mods; 8 | Printf.printf "Registering module %s\n" name 9 | ) 10 | 11 | 12 | let cbs = ref [] 13 | 14 | let add_cb f = cbs := f :: !cbs 15 | let runall () = List.iter (fun f -> f ()) !cbs 16 | 17 | (* 18 | let () = 19 | at_exit runall 20 | *) 21 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/b.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | print_endline "B is running"; 3 | incr A.x; 4 | Printf.printf "A.x = %i\n" !A.x 5 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/bug.ml: -------------------------------------------------------------------------------- 1 | let () = try raise (Invalid_argument "X") with Invalid_argument s -> 2 | raise (Invalid_argument (s ^ s)) 3 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/c.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | print_endline "C is running"; 3 | incr A.x; 4 | Printf.printf "A.x = %i\n" !A.x 5 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/pack_client.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | print_endline Mypack.Packed1.mykey 3 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/packed1.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | Api.reg_mod "Packed1" 3 | 4 | let bla = Sys.argv.(0) ^ "XXX" 5 | let mykey = Sys.argv.(0) 6 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/packed1_client.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | Api.reg_mod "Packed1_client"; 3 | print_endline Packed1.mykey 4 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/plugin.ml: -------------------------------------------------------------------------------- 1 | let rec f x = ignore ([x]); f x 2 | 3 | let rec fact n = if n = 0 then 1 else n * fact (n - 1) 4 | 5 | let facts = [ fact 1; fact 2; fact 3; fact (Random.int 4) ] 6 | 7 | let () = 8 | Api.reg_mod "Plugin"; 9 | Api.add_cb (fun () -> print_endline "Callback from plugin"); 10 | print_endline "COUCOU"; 11 | () 12 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/plugin.mli: -------------------------------------------------------------------------------- 1 | val facts: int list 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/plugin2.ml: -------------------------------------------------------------------------------- 1 | (*external ex: int -> int = "caml_ex"*) 2 | 3 | let () = 4 | Api.reg_mod "Plugin2"; 5 | Api.add_cb (fun () -> print_endline "Callback from plugin2"); 6 | (* let i = ex 3 in*) 7 | List.iter (fun i -> Printf.printf "%i\n" i) Plugin.facts; 8 | Printf.printf "XXX\n" 9 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/plugin4.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | Printf.printf "time = %f\n" (Unix.time ()); 3 | Api.reg_mod "Plugin" 4 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/plugin_ext.ml: -------------------------------------------------------------------------------- 1 | external fact: int -> string = "factorial" 2 | 3 | let () = 4 | Api.reg_mod "plugin_ext"; 5 | Printf.printf "fact 10 = %s\n" (fact 10) 6 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/plugin_high_arity.ml: -------------------------------------------------------------------------------- 1 | let f x x x x x x x x x x x x x = () 2 | 3 | let g x = f x x x x x x x x 4 | 5 | let () = 6 | Api.reg_mod "HA" 7 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/plugin_ref.ml: -------------------------------------------------------------------------------- 1 | let x = ref 0 2 | 3 | let () = 4 | Api.reg_mod "Plugin_ref"; 5 | 6 | Api.add_cb 7 | (fun () -> 8 | Printf.printf "current value for ref = %i\n" !x; 9 | incr x 10 | ) 11 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/plugin_simple.ml: -------------------------------------------------------------------------------- 1 | let facts = [ (Random.int 4) ] 2 | 3 | let () = print_endline "COUCOU"; print_char '\n' 4 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/plugin_thread.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | Api.reg_mod "Plugin_thread"; 3 | let _t = 4 | Thread.create 5 | (fun () -> 6 | for i = 1 to 5 do 7 | print_endline "Thread"; flush stdout; 8 | Thread.delay 1.; 9 | done 10 | ) () 11 | in 12 | for i = 1 to 10 do 13 | print_endline "Thread"; flush stdout; 14 | Thread.delay 0.50; 15 | done 16 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/reference: -------------------------------------------------------------------------------- 1 | Loading plugin.so 2 | Registering module Plugin 3 | COUCOU 4 | Loading plugin2.so 5 | Registering module Plugin2 6 | 1 7 | 2 8 | 6 9 | 1 10 | XXX 11 | Loading plugin_thread.so 12 | Registering module Plugin_thread 13 | Thread 14 | Thread 15 | Thread 16 | Thread 17 | Thread 18 | Thread 19 | Thread 20 | Thread 21 | Thread 22 | Thread 23 | Thread 24 | Thread 25 | Thread 26 | Thread 27 | Thread 28 | Callback from plugin2 29 | Callback from plugin 30 | Callback from main 31 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/sub/api.ml: -------------------------------------------------------------------------------- 1 | let f i = 2 | Printf.printf "Sub/api: f called with %i\n" i; 3 | i + 1 4 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/sub/api.mli: -------------------------------------------------------------------------------- 1 | val f : int -> int 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/sub/plugin.ml: -------------------------------------------------------------------------------- 1 | let rec fact n = if n = 0 then 1 else n * fact (n - 1) 2 | 3 | let facts = [ fact 1; fact 2; fact 3; fact 4; fact 5 ] 4 | 5 | let () = 6 | Api.reg_mod "Plugin'" 7 | -------------------------------------------------------------------------------- /testsuite/tests/lib-dynlink-native/sub/plugin3.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | ignore (Api.f 10) 3 | -------------------------------------------------------------------------------- /testsuite/tests/lib-filename/extension.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | let test f e = 3 | assert(Filename.extension f = e); 4 | assert(Filename.extension ("foo/" ^ f) = e); 5 | assert(f = Filename.remove_extension f ^ Filename.extension f) 6 | in 7 | test "" ""; 8 | test "foo" ""; 9 | test "foo.txt" ".txt"; 10 | test "foo.txt.gz" ".gz"; 11 | test ".foo" ""; 12 | test "." ""; 13 | test ".." ""; 14 | test "foo..txt" ".txt" 15 | -------------------------------------------------------------------------------- /testsuite/tests/lib-filename/extension.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/lib-filename/extension.reference -------------------------------------------------------------------------------- /testsuite/tests/lib-format/pr6824.ml: -------------------------------------------------------------------------------- 1 | let f = Format.sprintf "[%i]";; 2 | print_endline (f 1);; 3 | print_endline (f 2);; 4 | 5 | let f = Format.asprintf "[%i]";; 6 | print_endline (f 1);; 7 | print_endline (f 2);; 8 | -------------------------------------------------------------------------------- /testsuite/tests/lib-format/pr6824.reference: -------------------------------------------------------------------------------- 1 | [1] 2 | [2] 3 | [1] 4 | [2] 5 | 6 | All tests succeeded. 7 | -------------------------------------------------------------------------------- /testsuite/tests/lib-num/end_test.ml: -------------------------------------------------------------------------------- 1 | Test.end_tests ();; 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-obj/reachable_words.reference: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-printf/pr6534.reference: -------------------------------------------------------------------------------- 1 | 1 [ foo] 2 | 2 [ foo] 3 | 3 [foo ] 4 | 4 [foo ] 5 | 5 [foo ] 6 | 6 [foo ] 7 | 1 [ "foo"] 8 | 2 [ "foo"] 9 | 3 ["foo" ] 10 | 4 ["foo" ] 11 | 5 ["foo" ] 12 | 6 ["foo" ] 13 | 14 | All tests succeeded. 15 | -------------------------------------------------------------------------------- /testsuite/tests/lib-queue/test.reference: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-random/rand.ml: -------------------------------------------------------------------------------- 1 | (* Test that two Random.self_init() in close succession will not result 2 | in the same PRNG state. 3 | Note that even when the code is correct this test is expected to fail 4 | once in 10000 runs. 5 | *) 6 | 7 | let () = 8 | Random.self_init (); 9 | let x = Random.int 10000 in 10 | Random.self_init (); 11 | let y = Random.int 10000 in 12 | if x = y then print_endline "FAILED" else print_endline "PASSED" 13 | -------------------------------------------------------------------------------- /testsuite/tests/lib-random/rand.reference: -------------------------------------------------------------------------------- 1 | PASSED 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-scanf-2/reference: -------------------------------------------------------------------------------- 1 | Ping-pong Ping-pong Ping-pong Ping-pong Ping-pong Ping-pong Ping-pong Ping-pong! 2 | Test OK. 3 | -------------------------------------------------------------------------------- /testsuite/tests/lib-scanf/tscanf.reference: -------------------------------------------------------------------------------- 1 | 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/lib-set/testmap.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/lib-set/testmap.reference -------------------------------------------------------------------------------- /testsuite/tests/lib-set/testset.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/lib-set/testset.reference -------------------------------------------------------------------------------- /testsuite/tests/lib-stack/test.reference: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-str/t01.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/lib-str/t01.reference -------------------------------------------------------------------------------- /testsuite/tests/lib-stream/count_concat_bug.reference: -------------------------------------------------------------------------------- 1 | 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/lib-string/test_string.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/lib-string/test_string.reference -------------------------------------------------------------------------------- /testsuite/tests/lib-systhreads/testfork.reference: -------------------------------------------------------------------------------- 1 | Forking... 2 | In parent... 3 | In child... 4 | Child did minor GC. 5 | Child is exiting. 6 | Parent is exiting. 7 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/bank.reference: -------------------------------------------------------------------------------- 1 | Current balance: 100 2 | Final balance: 1 3 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/beat.reference: -------------------------------------------------------------------------------- 1 | passed 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/bufchan.reference: -------------------------------------------------------------------------------- 1 | 3 2 | un 3 | deux 4 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/close.ml: -------------------------------------------------------------------------------- 1 | let main () = 2 | let (rd, wr) = Unix.pipe() in 3 | let t = Thread.create 4 | (fun () -> 5 | Thread.delay 1.0; 6 | print_endline "closing fd..."; 7 | Unix.close wr; 8 | ) 9 | () in 10 | let buf = String.create 10 in 11 | print_endline "reading..."; 12 | begin try ignore (Unix.read rd buf 0 10) with Unix.Unix_error _ -> () end; 13 | print_endline "read returned"; 14 | t 15 | 16 | let t = Unix.handle_unix_error main () 17 | 18 | let _ = Thread.join t 19 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/close.reference: -------------------------------------------------------------------------------- 1 | reading... 2 | closing fd... 3 | read returned 4 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/fileio.reference: -------------------------------------------------------------------------------- 1 | 256-byte chunks, 256-byte chunks 2 | passed 3 | 4096-byte chunks, 4096-byte chunks 4 | passed 5 | 65536-byte chunks, 65536-byte chunks 6 | passed 7 | 256-byte chunks, 4096-byte chunks 8 | passed 9 | 4096-byte chunks, 256-byte chunks 10 | passed 11 | 4096-byte chunks, 65536-byte chunks 12 | passed 13 | 263-byte chunks, 4011-byte chunks 14 | passed 15 | 613-byte chunks, 1027-byte chunks 16 | passed 17 | 0...8192 byte chunks 18 | passed 19 | line per line 20 | passed 21 | truncated line 22 | passed 23 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/pr4466.reference: -------------------------------------------------------------------------------- 1 | Selected 2 | Data read: >>1111 3 | Selected 4 | Data read: >>2222 5 | Selected 6 | Data read: >>3333 7 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/pr5325.reference: -------------------------------------------------------------------------------- 1 | >>Client data 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/prodcons.reference: -------------------------------------------------------------------------------- 1 | passed 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/prodcons2.reference: -------------------------------------------------------------------------------- 1 | passed 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/sieve.reference: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | 5 4 | 7 5 | 11 6 | 13 7 | 17 8 | 19 9 | 23 10 | 29 11 | 31 12 | 37 13 | 41 14 | 43 15 | 47 16 | 53 17 | 59 18 | 61 19 | 67 20 | 71 21 | 73 22 | 79 23 | 83 24 | 89 25 | 97 26 | 101 27 | 103 28 | 107 29 | 109 30 | 113 31 | 127 32 | 131 33 | 137 34 | 139 35 | 149 36 | 151 37 | 157 38 | 163 39 | 167 40 | 173 41 | 179 42 | 181 43 | 191 44 | 193 45 | 197 46 | 199 47 | 211 48 | 223 49 | 227 50 | 229 51 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/signal.ml: -------------------------------------------------------------------------------- 1 | let sighandler _ = 2 | print_string "Got ctrl-C, exiting..."; print_newline(); 3 | exit 0 4 | 5 | let print_message delay c = 6 | while true do 7 | print_char c; flush stdout; Thread.delay delay 8 | done 9 | 10 | let _ = 11 | ignore (Sys.signal Sys.sigint (Sys.Signal_handle sighandler)); 12 | ignore (Thread.create (print_message 0.6666666666) 'a'); 13 | print_message 1.0 'b' 14 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/signal.precheck: -------------------------------------------------------------------------------- 1 | test "$TOOLCHAIN" != "msvc" -a "$TOOLCHAIN" != "mingw" 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/signal2.ml: -------------------------------------------------------------------------------- 1 | let print_message delay c = 2 | while true do 3 | print_char c; flush stdout; Thread.delay delay 4 | done 5 | 6 | let _ = 7 | ignore (Thread.sigmask Unix.SIG_BLOCK [Sys.sigint; Sys.sigterm]); 8 | ignore (Thread.create (print_message 0.6666666666) 'a'); 9 | ignore (Thread.create (print_message 1.0) 'b'); 10 | let s = Thread.wait_signal [Sys.sigint; Sys.sigterm] in 11 | Printf.printf "Got signal %d, exiting...\n" s 12 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/sockets.reference: -------------------------------------------------------------------------------- 1 | >>Client #1 2 | >>Client #2 3 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/socketsbuf.reference: -------------------------------------------------------------------------------- 1 | >>Client #1 2 | >>Client #2 3 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/swapchan.reference: -------------------------------------------------------------------------------- 1 | f G 2 | g F 3 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/tls.reference: -------------------------------------------------------------------------------- 1 | 1 --> un 2 | 2 --> deux 3 | 3 --> trois 4 | 4 --> quatre 5 | 5 --> cinq 6 | -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/token1.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/lib-threads/token1.reference -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/token2.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/lib-threads/token2.reference -------------------------------------------------------------------------------- /testsuite/tests/lib-threads/torture.reference: -------------------------------------------------------------------------------- 1 | passed 2 | -------------------------------------------------------------------------------- /testsuite/tests/lib-uchar/test.reference: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /testsuite/tests/link-test/aliases.ml: -------------------------------------------------------------------------------- 1 | module Submodule = Submodule 2 | -------------------------------------------------------------------------------- /testsuite/tests/link-test/external.ml: -------------------------------------------------------------------------------- 1 | let () = print_endline "linked external"; flush stdout 2 | external frexp : float -> float * int = "caml_frexp_float" 3 | -------------------------------------------------------------------------------- /testsuite/tests/link-test/external.mli: -------------------------------------------------------------------------------- 1 | external frexp : float -> float * int = "caml_frexp_float" 2 | -------------------------------------------------------------------------------- /testsuite/tests/link-test/external_for_pack.ml: -------------------------------------------------------------------------------- 1 | let () = print_endline "linked external from pack"; flush stdout 2 | external frexp : float -> float * int = "caml_frexp_float" 3 | -------------------------------------------------------------------------------- /testsuite/tests/link-test/external_for_pack.mli: -------------------------------------------------------------------------------- 1 | external frexp : float -> float * int = "caml_frexp_float" 2 | -------------------------------------------------------------------------------- /testsuite/tests/link-test/submodule.ml: -------------------------------------------------------------------------------- 1 | let () = print_endline "linked"; flush stdout 2 | module M = struct end 3 | -------------------------------------------------------------------------------- /testsuite/tests/link-test/test.ml: -------------------------------------------------------------------------------- 1 | include Aliases.Submodule.M 2 | let _, _ = External.frexp 3. 3 | -------------------------------------------------------------------------------- /testsuite/tests/link-test/test.reference: -------------------------------------------------------------------------------- 1 | linked 2 | linked external 3 | linked external from pack 4 | -------------------------------------------------------------------------------- /testsuite/tests/link-test/use_in_pack.ml: -------------------------------------------------------------------------------- 1 | let _, _ = External_for_pack.frexp 12. 2 | -------------------------------------------------------------------------------- /testsuite/tests/macros/Makefile: -------------------------------------------------------------------------------- 1 | BASEDIR=../.. 2 | include $(BASEDIR)/makefiles/Makefile.toplevel 3 | include $(BASEDIR)/makefiles/Makefile.common 4 | TOPFLAGS := $(TOPFLAGS) -I . 5 | -------------------------------------------------------------------------------- /testsuite/tests/macros/multiple_splices.ml: -------------------------------------------------------------------------------- 1 | let a = $(<<1>>) 2 | let b = $(<<"2">>) 3 | let c = $(<<'3'>>) 4 | let () = Printf.printf "%d %S %C\n" a b c 5 | ;; 6 | -------------------------------------------------------------------------------- /testsuite/tests/macros/multiple_splices.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # 1 "2" '3' 3 | val a : int = 1 4 | val b : string = "2" 5 | val c : char = '3' 6 | # 7 | -------------------------------------------------------------------------------- /testsuite/tests/macros/splice_argument_order.ml: -------------------------------------------------------------------------------- 1 | let s = Printf.sprintf "%d %d %d" $(<<1>>) $(<<2>>) $(<<3>>);; 2 | let () = assert (s = "1 2 3");; 3 | -------------------------------------------------------------------------------- /testsuite/tests/macros/splice_argument_order.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # val s : string = "1 2 3" 3 | # # 4 | -------------------------------------------------------------------------------- /testsuite/tests/macros/splice_order.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # macro one : int expr = << 1 >> 3 | # macro two : int expr = << 2 >> 4 | # macro three : int expr = << 3 >> 5 | # macro four : int expr = << 4 >> 6 | # macro five : int expr = << 5 >> 7 | # 1 8 | 2 9 | 3 10 | # 4 11 | # 5 12 | # static val x : int ~Pervasives.ref = {~Pervasives.contents = 0} 13 | # 1# 2# 3# 14 | -------------------------------------------------------------------------------- /testsuite/tests/macros/splicing_shadowed_global.ml: -------------------------------------------------------------------------------- 1 | macro x = << List.map Pervasives.pred [1;2;3] >>;; 2 | macro y = << Some 42 >>;; 3 | 4 | module Pervasives = struct 5 | let pred = Pervasives.succ 6 | end;; 7 | 8 | type fake_option = 9 | | Blah 10 | | Some of int 11 | ;; 12 | 13 | let l = $x;; 14 | let b = 15 | match $y with 16 | | Blah -> false 17 | | Some x -> x = 42 18 | ;; 19 | -------------------------------------------------------------------------------- /testsuite/tests/macros/static_values.ml: -------------------------------------------------------------------------------- 1 | static x = 42 2 | ;; 3 | 4 | let y = succ x (* Error: phase mismatch *) 5 | ;; 6 | 7 | static () = Printf.printf "%d\n" x (* Error: this module is at phase 0 *) 8 | ;; 9 | 10 | static () = ~Printf.printf "%d\n" x 11 | ;; 12 | 13 | let () = Printf.printf "%d\n" $(Expr.of_int x) 14 | ;; 15 | -------------------------------------------------------------------------------- /testsuite/tests/macros/static_values.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # static val x : int = 42 3 | # Characters 14-15: 4 | let y = succ x (* Error: phase mismatch *) 5 | ^ 6 | Error: Attempt to use value x of phase 1 in an environment of phase 0 7 | # Characters 13-26: 8 | static () = Printf.printf "%d\n" x (* Error: this module is at phase 0 *) 9 | ^^^^^^^^^^^^^ 10 | Error: Attempt to use value Printf.printf of phase 0 in an environment of phase 1 11 | # # 42 12 | # 13 | 42 14 | -------------------------------------------------------------------------------- /testsuite/tests/macros/tmp.ml: -------------------------------------------------------------------------------- 1 | module M : sig macro x : int expr end = struct 2 | static lol = 1334 3 | macro x = <<42>> 4 | let y = 42 5 | end 6 | 7 | let () = Printf.printf "%d\n" $M.x 8 | -------------------------------------------------------------------------------- /testsuite/tests/manual-intf-c/prog.ml: -------------------------------------------------------------------------------- 1 | (* File prog.ml -- main program using curses *) 2 | open Curses;; 3 | let main_window = initscr () in 4 | let small_window = newwin 10 5 20 10 in 5 | mvwaddstr main_window 10 2 "Hello"; 6 | mvwaddstr small_window 4 3 "world"; 7 | refresh(); 8 | Unix.sleep 5; 9 | endwin() 10 | -------------------------------------------------------------------------------- /testsuite/tests/manual-intf-c/prog2.reference: -------------------------------------------------------------------------------- 1 | File "curses_stubs.c", line 1: 2 | Error: Required module `Curses' is unavailable 3 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception-warnings/exhaustiveness_warnings.ml: -------------------------------------------------------------------------------- 1 | (** Test exhaustiveness. 2 | 3 | match clauses should continue to give warnings about inexhaustive 4 | value-matching clauses when there is an exception-matching clause 5 | *) 6 | 7 | let test_match_exhaustiveness () = 8 | match None with 9 | | exception e -> () 10 | | Some false -> () 11 | | None -> () 12 | ;; 13 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception-warnings/exhaustiveness_warnings.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # * * * * Characters 210-289: 3 | ....match None with 4 | | exception e -> () 5 | | Some false -> () 6 | | None -> () 7 | Warning 8: this pattern-matching is not exhaustive. 8 | Here is an example of a case that is not matched: 9 | Some true 10 | val test_match_exhaustiveness : unit -> unit = 11 | # 12 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception/allocation.reference: -------------------------------------------------------------------------------- 1 | no allocations for multiple-value match 2 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception/exception_propagation.ml: -------------------------------------------------------------------------------- 1 | (** 2 | Test that match allows exceptions to propagate. 3 | *) 4 | let () = 5 | try 6 | match 7 | (let _ = raise Not_found in 8 | assert false) 9 | with 10 | | _ -> assert false 11 | | exception Invalid_argument _ -> assert false 12 | with 13 | Not_found -> 14 | print_endline "caught expected exception (Not_found)" 15 | | _ -> 16 | assert false 17 | ;; 18 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception/exception_propagation.reference: -------------------------------------------------------------------------------- 1 | caught expected exception (Not_found) 2 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception/match_failure.reference: -------------------------------------------------------------------------------- 1 | match failure, as expected 2 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception/nested_handlers.reference: -------------------------------------------------------------------------------- 1 | five four three two one 2 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception/raise_from_success_continuation.ml: -------------------------------------------------------------------------------- 1 | (** 2 | Test raising exceptions from a value-matching branch. 3 | *) 4 | let test_raise_from_val_handler = 5 | let () = print_endline "test raise from val handler" in 6 | let g () = List.find ((=)2) [1;2;4] in 7 | let h () = 8 | match 9 | g () 10 | with exception _ -> 10 11 | | _ -> raise Not_found 12 | in 13 | assert ((try h () with Not_found -> 20) = 20); 14 | print_endline "raise from val handler succeeded" 15 | ;; 16 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception/raise_from_success_continuation.reference: -------------------------------------------------------------------------------- 1 | test raise from val handler 2 | raise from val handler succeeded 3 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception/streams.reference: -------------------------------------------------------------------------------- 1 | iter_stream with handler case (match) is tail recursive 2 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception/tail_calls.ml: -------------------------------------------------------------------------------- 1 | (** 2 | The success continuation expression is in tail position. 3 | *) 4 | 5 | let count_to_tr_match n = 6 | let rec loop i = 7 | match 8 | i < n 9 | with exception Not_found -> () 10 | | false -> () 11 | | true -> loop (i + 1) 12 | in loop 0 13 | ;; 14 | 15 | let test_tail_recursion = 16 | try 17 | count_to_tr_match 10000000; 18 | print_endline "handler-case (match) is tail recursive" 19 | with _ -> 20 | assert false 21 | ;; 22 | -------------------------------------------------------------------------------- /testsuite/tests/match-exception/tail_calls.reference: -------------------------------------------------------------------------------- 1 | handler-case (match) is tail recursive 2 | -------------------------------------------------------------------------------- /testsuite/tests/misc-unsafe/almabench.reference: -------------------------------------------------------------------------------- 1 | 0 17.00 -26.06 2 | 1 12.34 1.29 3 | 2 6.83 22.95 4 | 3 0.04 -1.26 5 | 4 2.30 12.54 6 | 5 2.93 14.35 7 | 6 21.27 -16.57 8 | 7 20.41 -19.04 9 | -------------------------------------------------------------------------------- /testsuite/tests/misc-unsafe/fft.reference: -------------------------------------------------------------------------------- 1 | 16... ok 2 | 32... ok 3 | 64... ok 4 | 128... ok 5 | 256... ok 6 | 512... ok 7 | 1024... ok 8 | 2048... ok 9 | 4096... ok 10 | 8192... ok 11 | 16384... ok 12 | 32768... ok 13 | 65536... ok 14 | 131072... ok 15 | 262144... ok 16 | -------------------------------------------------------------------------------- /testsuite/tests/misc-unsafe/quicksort.reference: -------------------------------------------------------------------------------- 1 | OK 2 | OK 3 | -------------------------------------------------------------------------------- /testsuite/tests/misc/bdd.reference: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /testsuite/tests/misc/boyer.reference: -------------------------------------------------------------------------------- 1 | Proved! 2 | -------------------------------------------------------------------------------- /testsuite/tests/misc/ephetest2.reference: -------------------------------------------------------------------------------- 1 | test0 check: OK 2 | test1 check: OK 3 | test2 check: OK 4 | test3 check: OK 5 | test4 check: OK 6 | -------------------------------------------------------------------------------- /testsuite/tests/misc/fib.ml: -------------------------------------------------------------------------------- 1 | let rec fib n = 2 | if n < 2 then 1 else fib(n-1) + fib(n-2) 3 | 4 | let _ = 5 | let n = 6 | if Array.length Sys.argv >= 2 7 | then int_of_string Sys.argv.(1) 8 | else 30 in 9 | print_int(fib n); print_newline(); exit 0 10 | -------------------------------------------------------------------------------- /testsuite/tests/misc/fib.reference: -------------------------------------------------------------------------------- 1 | 1346269 2 | -------------------------------------------------------------------------------- /testsuite/tests/misc/finaliser.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/misc/finaliser.reference -------------------------------------------------------------------------------- /testsuite/tests/misc/nucleic.reference: -------------------------------------------------------------------------------- 1 | 33.7976 2 | -------------------------------------------------------------------------------- /testsuite/tests/misc/pr7168.reference: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /testsuite/tests/misc/takc.ml: -------------------------------------------------------------------------------- 1 | let rec tak x y z = 2 | if x > y then tak (tak (x-1) y z) (tak (y-1) z x) (tak (z-1) x y) 3 | else z 4 | 5 | let rec repeat n = 6 | if n <= 0 then 0 else tak 18 12 6 + repeat(n-1) 7 | 8 | let _ = print_int (repeat 200); print_newline(); exit 0 9 | -------------------------------------------------------------------------------- /testsuite/tests/misc/takc.reference: -------------------------------------------------------------------------------- 1 | 1400 2 | -------------------------------------------------------------------------------- /testsuite/tests/misc/taku.ml: -------------------------------------------------------------------------------- 1 | let rec tak (x, y, z) = 2 | if x > y then tak(tak (x-1, y, z), tak (y-1, z, x), tak (z-1, x, y)) 3 | else z 4 | 5 | let rec repeat n = 6 | if n <= 0 then 0 else tak(18,12,6) + repeat(n-1) 7 | 8 | let _ = print_int (repeat 200); print_newline(); exit 0 9 | -------------------------------------------------------------------------------- /testsuite/tests/misc/taku.reference: -------------------------------------------------------------------------------- 1 | 1400 2 | -------------------------------------------------------------------------------- /testsuite/tests/misc/weaklifetime.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/misc/weaklifetime.reference -------------------------------------------------------------------------------- /testsuite/tests/misc/weaklifetime2.reference: -------------------------------------------------------------------------------- 1 | success 2 | success 3 | -------------------------------------------------------------------------------- /testsuite/tests/misc/weaktest.reference: -------------------------------------------------------------------------------- 1 | pass 2 | -------------------------------------------------------------------------------- /testsuite/tests/no-alias-deps/aliases.cmo.reference: -------------------------------------------------------------------------------- 1 | File aliases.cmo 2 | Unit name: Aliases 3 | Interfaces imported: 4 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Pervasives 5 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa D 6 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa CamlinternalFormatBasics 7 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa C 8 | -------------------------------- B 9 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Aliases 10 | -------------------------------- A 11 | Required globals: 12 | D 13 | Pervasives 14 | Uses unsafe features: no 15 | Force link: no 16 | -------------------------------------------------------------------------------- /testsuite/tests/no-alias-deps/aliases.ml: -------------------------------------------------------------------------------- 1 | module A' = A (* missing a.cmi *) 2 | module B' = B (* broken b.cmi *) 3 | module C' = C (* valid c.cmi *) 4 | module D' = D (* valid d.cmi *) 5 | let () = print_int D'.something 6 | -------------------------------------------------------------------------------- /testsuite/tests/no-alias-deps/aliases.ml.reference: -------------------------------------------------------------------------------- 1 | File "_none_", line 1: 2 | Warning 49: no cmi file was found in path for module A 3 | File "_none_", line 1: 4 | Warning 49: no valid cmi file was found in path for module B. b.cmi 5 | is not a compiled interface 6 | -------------------------------------------------------------------------------- /testsuite/tests/no-alias-deps/b.cmi.pre: -------------------------------------------------------------------------------- 1 | Not a valid cmi file 2 | -------------------------------------------------------------------------------- /testsuite/tests/no-alias-deps/c.mli: -------------------------------------------------------------------------------- 1 | val something : int 2 | -------------------------------------------------------------------------------- /testsuite/tests/no-alias-deps/d.mli: -------------------------------------------------------------------------------- 1 | val something : int 2 | -------------------------------------------------------------------------------- /testsuite/tests/opaque/fst/opaque_impl.ml: -------------------------------------------------------------------------------- 1 | 2 | let choose x y = x 3 | -------------------------------------------------------------------------------- /testsuite/tests/opaque/fst/opaque_intf.ml: -------------------------------------------------------------------------------- 1 | 2 | let choose x y = x 3 | -------------------------------------------------------------------------------- /testsuite/tests/opaque/fst/regular.ml: -------------------------------------------------------------------------------- 1 | 2 | let choose x y = x 3 | -------------------------------------------------------------------------------- /testsuite/tests/opaque/intf/opaque_impl.mli: -------------------------------------------------------------------------------- 1 | 2 | val choose : 'a -> 'a -> 'a 3 | -------------------------------------------------------------------------------- /testsuite/tests/opaque/intf/opaque_intf.mli: -------------------------------------------------------------------------------- 1 | 2 | val choose : 'a -> 'a -> 'a 3 | -------------------------------------------------------------------------------- /testsuite/tests/opaque/intf/regular.mli: -------------------------------------------------------------------------------- 1 | 2 | val choose : 'a -> 'a -> 'a 3 | -------------------------------------------------------------------------------- /testsuite/tests/opaque/snd/opaque_impl.ml: -------------------------------------------------------------------------------- 1 | 2 | let choose x y = y 3 | -------------------------------------------------------------------------------- /testsuite/tests/opaque/snd/opaque_intf.ml: -------------------------------------------------------------------------------- 1 | 2 | let choose x y = y 3 | -------------------------------------------------------------------------------- /testsuite/tests/opaque/snd/regular.ml: -------------------------------------------------------------------------------- 1 | 2 | let choose x y = y 3 | -------------------------------------------------------------------------------- /testsuite/tests/opaque/test.ml: -------------------------------------------------------------------------------- 1 | 2 | let () = 3 | print_endline (Opaque_intf.choose "Opaque_intf: First" "Opaque_intf: Second") 4 | 5 | let () = 6 | print_endline (Opaque_impl.choose "Opaque_impl: First" "Opaque_impl: Second") 7 | 8 | let () = 9 | print_endline (Regular.choose "Regular: First" "Regular: Second") 10 | -------------------------------------------------------------------------------- /testsuite/tests/parsetree/test.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/parsetree/test.reference -------------------------------------------------------------------------------- /testsuite/tests/parsing/docstrings.ml: -------------------------------------------------------------------------------- 1 | type 'a with_default 2 | = ?size:int (** default [42] *) 3 | -> ?resizable:bool (** default [true] *) 4 | -> 'a 5 | 6 | type obj = < 7 | meth1 : int -> int; 8 | (** method 1 *) 9 | 10 | meth2: unit -> float (** method 2 *); 11 | > 12 | 13 | type var = [ 14 | | `Foo (** foo *) 15 | | `Bar of int * string (** bar *) 16 | ] 17 | -------------------------------------------------------------------------------- /testsuite/tests/parsing/int_and_float_with_modifier.ml: -------------------------------------------------------------------------------- 1 | let int_with_custom_modifier = 2 | 1234567890_1234567890_1234567890_1234567890_1234567890z 3 | let float_with_custom_modifier = 4 | 1234567890_1234567890_1234567890_1234567890_1234567890.z 5 | 6 | let int32 = 1234l 7 | let int64 = 1234L 8 | let nativeint = 1234n 9 | 10 | let hex_without_modifier = 0x32f 11 | let hex_with_modifier = 0x32g 12 | 13 | let float_without_modifer = 1.2e3 14 | let float_with_modifer = 1.2g 15 | -------------------------------------------------------------------------------- /testsuite/tests/parsing/pr6865.ml: -------------------------------------------------------------------------------- 1 | let%foo x = 42 2 | let%foo _ = () and _ = () 3 | let%foo _ = () 4 | -------------------------------------------------------------------------------- /testsuite/tests/parsing/pr7165.ml: -------------------------------------------------------------------------------- 1 | (* this is a lexer directive with an out-of-bound integer; 2 | it should result in a lexing error instead of an 3 | uncaught exception as in PR#7165 *) 4 | #9342101923012312312 5 | -------------------------------------------------------------------------------- /testsuite/tests/parsing/pr7165.ml.reference: -------------------------------------------------------------------------------- 1 | File "pr7165.ml", line 4, characters 0-21: 2 | Error: Invalid lexer directive "#9342101923012312312": line number out of range 3 | -------------------------------------------------------------------------------- /testsuite/tests/ppx-attributes/warning.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/ppx-attributes/warning.reference -------------------------------------------------------------------------------- /testsuite/tests/prim-bigstring/Makefile: -------------------------------------------------------------------------------- 1 | BASEDIR=../.. 2 | LIBRARIES=unix bigarray 3 | ADD_COMPFLAGS=-I $(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix \ 4 | -I $(OTOPDIR)/otherlibs/bigarray 5 | LD_PATH=$(TOPDIR)/otherlibs/$(UNIXLIBVAR)unix:$(TOPDIR)/otherlibs/bigarray 6 | 7 | include $(BASEDIR)/makefiles/Makefile.several 8 | include $(BASEDIR)/makefiles/Makefile.common 9 | -------------------------------------------------------------------------------- /testsuite/tests/prim-bigstring/bigstring_access.reference: -------------------------------------------------------------------------------- 1 | 1234 12 0 2 | fedc fe 0 3 | 12345678 123456 1234 4 | fedcba09 fedcba fedc 5 | 1234567890abcdef 1234567890abcd 1234567890ab 6 | fedcba0987654321 fedcba09876543 fedcba098765 7 | -------------------------------------------------------------------------------- /testsuite/tests/prim-bigstring/string_access.reference: -------------------------------------------------------------------------------- 1 | 1234 12 0 2 | fedc fe 0 3 | 12345678 123456 1234 4 | fedcba09 fedcba fedc 5 | 1234567890abcdef 1234567890abcd 1234567890ab 6 | fedcba0987654321 fedcba09876543 fedcba098765 7 | -------------------------------------------------------------------------------- /testsuite/tests/prim-bswap/bswap.reference: -------------------------------------------------------------------------------- 1 | 4433 2 | f0f0 3 | 44332211 4 | f0f0f0f0 5 | 8877665544332211 6 | f0f0f0f0f0f0f0f0 7 | -------------------------------------------------------------------------------- /testsuite/tests/prim-revapply/apply.reference: -------------------------------------------------------------------------------- 1 | 6 2 | 36 3 | 18 4 | 37 5 | 260 6 | 6 7 | 36 8 | 18 9 | 37 10 | 260 11 | -------------------------------------------------------------------------------- /testsuite/tests/prim-revapply/revapply.ml: -------------------------------------------------------------------------------- 1 | external ( |> ) : 'a -> ('a -> 'b) -> 'b = "%revapply" 2 | 3 | let f x = x + x 4 | let g x = x * x 5 | let h x = x + 1 6 | let add x y = x + y 7 | 8 | let _ = 9 | List.iter (fun x -> 10 | print_int x; print_newline () 11 | ) 12 | [ 13 | 3 |> f; (* 6 *) 14 | 3 |> f |> g; (* 36 *) 15 | 3 |> g |> f; (* 18 *) 16 | 3 |> f |> g |> h; (* 37 *) 17 | 3 |> add 2 |> add 3 |> f |> g |> add 4; (* 260 *) 18 | ] 19 | -------------------------------------------------------------------------------- /testsuite/tests/prim-revapply/revapply.reference: -------------------------------------------------------------------------------- 1 | 6 2 | 36 3 | 18 4 | 37 5 | 260 6 | -------------------------------------------------------------------------------- /testsuite/tests/regression/pr3612/pr3612.reference: -------------------------------------------------------------------------------- 1 | -1 2 | -------------------------------------------------------------------------------- /testsuite/tests/regression/pr5080-notes/pr5080_notes_ok.ml: -------------------------------------------------------------------------------- 1 | let marshal_int f = 2 | match [] with 3 | | _ :: `INT n :: _ -> f n 4 | | _ -> failwith "marshal_int" 5 | -------------------------------------------------------------------------------- /testsuite/tests/regression/pr5233/pr5233.reference: -------------------------------------------------------------------------------- 1 | checking... value found / testing... ok 2 | checking... no value 3 | -------------------------------------------------------------------------------- /testsuite/tests/regression/pr5757/pr5757.ml: -------------------------------------------------------------------------------- 1 | Random.init 3;; 2 | for i = 0 to 100_000 do 3 | ignore (Bytes.create (Random.int 1_000_000)) 4 | done;; 5 | Printf.printf "hello world\n";; 6 | -------------------------------------------------------------------------------- /testsuite/tests/regression/pr5757/pr5757.reference: -------------------------------------------------------------------------------- 1 | hello world 2 | -------------------------------------------------------------------------------- /testsuite/tests/regression/pr6024/pr6024.ml: -------------------------------------------------------------------------------- 1 | Format.printf "@[%@-@@-@]@.";; 2 | -------------------------------------------------------------------------------- /testsuite/tests/regression/pr6024/pr6024.reference: -------------------------------------------------------------------------------- 1 | @-@- 2 | -------------------------------------------------------------------------------- /testsuite/tests/regression/pr7042/pr7042.ml: -------------------------------------------------------------------------------- 1 | let _ = 2 | let a = [| 0.0; -. 0.0 |] in 3 | Printf.printf "%Lx %Lx\n" 4 | (Int64.bits_of_float a.(0)) (Int64.bits_of_float a.(1)) 5 | -------------------------------------------------------------------------------- /testsuite/tests/regression/pr7042/pr7042.reference: -------------------------------------------------------------------------------- 1 | 0 8000000000000000 2 | -------------------------------------------------------------------------------- /testsuite/tests/required-external/Makefile: -------------------------------------------------------------------------------- 1 | # Ensure that calling an external C primite forces linking 2 | # the module that defines it 3 | 4 | MAIN_MODULE = main 5 | LIBRARIES = lib 6 | 7 | BASEDIR=../.. 8 | include $(BASEDIR)/makefiles/Makefile.one 9 | include $(BASEDIR)/makefiles/Makefile.common 10 | 11 | main.cmo: lib.cma 12 | main.cmx: lib.cmxa 13 | 14 | lib.cma: file.cmo 15 | @$(OCAMLC) -a -o $@ $< 16 | 17 | lib.cmxa: file.cmx 18 | @$(OCAMLOPT) -a -o $@ $< 19 | -------------------------------------------------------------------------------- /testsuite/tests/required-external/file.ml: -------------------------------------------------------------------------------- 1 | external getcwd : unit -> string = "caml_sys_getcwd" 2 | 3 | let f () = () 4 | 5 | let () = 6 | print_endline "Module `File' is linked"; 7 | flush stdout 8 | -------------------------------------------------------------------------------- /testsuite/tests/required-external/main.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | ignore (File.getcwd ()) 3 | -------------------------------------------------------------------------------- /testsuite/tests/required-external/main.reference: -------------------------------------------------------------------------------- 1 | Module `File' is linked 2 | -------------------------------------------------------------------------------- /testsuite/tests/runtime-errors/stackoverflow.bytecode.reference: -------------------------------------------------------------------------------- 1 | x = 20000 2 | x = 10000 3 | x = 0 4 | Stack overflow caught 5 | -------------------------------------------------------------------------------- /testsuite/tests/runtime-errors/stackoverflow.ml: -------------------------------------------------------------------------------- 1 | let rec f x = 2 | if not (x = 0 || x = 10000 || x = 20000) 3 | then 1 + f (x + 1) 4 | else 5 | try 6 | 1 + f (x + 1) 7 | with Stack_overflow -> 8 | print_string "x = "; print_int x; print_newline(); 9 | raise Stack_overflow 10 | 11 | let _ = 12 | try 13 | ignore(f 0) 14 | with Stack_overflow -> 15 | print_string "Stack overflow caught"; print_newline() 16 | -------------------------------------------------------------------------------- /testsuite/tests/runtime-errors/stackoverflow.native.reference: -------------------------------------------------------------------------------- 1 | x = 20000 2 | x = 10000 3 | x = 0 4 | Stack overflow caught 5 | -------------------------------------------------------------------------------- /testsuite/tests/runtime-errors/syserror.bytecode.reference: -------------------------------------------------------------------------------- 1 | Fatal error: exception Sys_error("titi:/toto: No such file or directory") 2 | -------------------------------------------------------------------------------- /testsuite/tests/runtime-errors/syserror.ml: -------------------------------------------------------------------------------- 1 | let channel = open_out "titi:/toto" 2 | -------------------------------------------------------------------------------- /testsuite/tests/runtime-errors/syserror.native.reference: -------------------------------------------------------------------------------- 1 | Fatal error: exception Sys_error("titi:/toto: No such file or directory") 2 | -------------------------------------------------------------------------------- /testsuite/tests/self-contained-toplevel/foo.ml: -------------------------------------------------------------------------------- 1 | let value = "Hello, world!" 2 | -------------------------------------------------------------------------------- /testsuite/tests/self-contained-toplevel/gen_cached_cmi.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | let cmi = Cmi_format.read_cmi "foo.cmi" in 3 | let data = Marshal.to_string cmi [] in 4 | Printf.printf "let foo = %S\n" data 5 | -------------------------------------------------------------------------------- /testsuite/tests/self-contained-toplevel/input.ml: -------------------------------------------------------------------------------- 1 | print_endline Foo.value;; 2 | -------------------------------------------------------------------------------- /testsuite/tests/self-contained-toplevel/main.reference: -------------------------------------------------------------------------------- 1 | Hello, world! 2 | -------------------------------------------------------------------------------- /testsuite/tests/tool-debugger/basic/debuggee.ml: -------------------------------------------------------------------------------- 1 | print_endline Sys.argv.(1);; 2 | print_endline (Sys.getenv "foo");; 3 | -------------------------------------------------------------------------------- /testsuite/tests/tool-debugger/basic/debuggee.reference: -------------------------------------------------------------------------------- 1 | 2 | (ocd) Loading program... done. 3 | arg1 4 | notbar 5 | Program exit. 6 | -------------------------------------------------------------------------------- /testsuite/tests/tool-debugger/basic/input_script: -------------------------------------------------------------------------------- 1 | set arguments arg1 arg2 2 | environment foo=bar 3 | environment foo=notbar 4 | run 5 | quit 6 | -------------------------------------------------------------------------------- /testsuite/tests/tool-debugger/find-artifacts/debuggee.reference: -------------------------------------------------------------------------------- 1 | 2 | (ocd) Loading program... done. 3 | Breakpoint: 1 4 | 10 <|b|>print x; 5 | x: Blah.blah = Foo 6 | y: Blah.blah = Bar "hi" 7 | -------------------------------------------------------------------------------- /testsuite/tests/tool-debugger/find-artifacts/in/blah.ml: -------------------------------------------------------------------------------- 1 | type blah = 2 | | Foo 3 | | Bar of string 4 | -------------------------------------------------------------------------------- /testsuite/tests/tool-debugger/find-artifacts/in/foo.ml: -------------------------------------------------------------------------------- 1 | open Blah 2 | 3 | let print = function 4 | | Foo -> print_endline "Foo"; 5 | | Bar s -> print_endline ("Bar(" ^ s ^ ")") 6 | 7 | let main () = 8 | let x = Foo in 9 | let y = Bar "hi" in 10 | print x; 11 | print y 12 | 13 | let _ = main () 14 | -------------------------------------------------------------------------------- /testsuite/tests/tool-debugger/find-artifacts/input_script: -------------------------------------------------------------------------------- 1 | break @ Foo 10 2 | run 3 | print x 4 | print y 5 | quit 6 | -------------------------------------------------------------------------------- /testsuite/tests/tool-debugger/no_debug_event/a.ml: -------------------------------------------------------------------------------- 1 | let x = 1 2 | -------------------------------------------------------------------------------- /testsuite/tests/tool-debugger/no_debug_event/b.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | print_int Foo.A.x; 3 | print_newline () 4 | -------------------------------------------------------------------------------- /testsuite/tests/tool-debugger/no_debug_event/input_script: -------------------------------------------------------------------------------- 1 | run 2 | quit 3 | -------------------------------------------------------------------------------- /testsuite/tests/tool-debugger/no_debug_event/noev.reference: -------------------------------------------------------------------------------- 1 | 2 | (ocd) Loading program... done. 3 | 1 4 | Program exit. 5 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t000.ml: -------------------------------------------------------------------------------- 1 | (* empty file *) 2 | 3 | (** 4 | 0 ATOM0 5 | 1 SETGLOBAL T000 6 | 3 STOP 7 | **) 8 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t010-const0.ml: -------------------------------------------------------------------------------- 1 | 0;; 2 | 3 | (** 4 | 0 CONST0 5 | 1 ATOM0 6 | 2 SETGLOBAL T010-const0 7 | 4 STOP 8 | **) 9 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t010-const1.ml: -------------------------------------------------------------------------------- 1 | 1;; 2 | 3 | (** 4 | 0 CONST1 5 | 1 ATOM0 6 | 2 SETGLOBAL T010-const1 7 | 4 STOP 8 | **) 9 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t010-const2.ml: -------------------------------------------------------------------------------- 1 | 2;; 2 | 3 | (** 4 | 0 CONST2 5 | 1 ATOM0 6 | 2 SETGLOBAL T010-const2 7 | 4 STOP 8 | **) 9 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t010-const3.ml: -------------------------------------------------------------------------------- 1 | 3;; 2 | 3 | (** 4 | 0 CONST3 5 | 1 ATOM0 6 | 2 SETGLOBAL T010-const3 7 | 4 STOP 8 | **) 9 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t011-constint.ml: -------------------------------------------------------------------------------- 1 | 4;; 2 | 3 | (** 4 | 0 CONSTINT 4 5 | 2 ATOM0 6 | 3 SETGLOBAL T011-constint 7 | 5 STOP 8 | **) 9 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t020.ml: -------------------------------------------------------------------------------- 1 | let _ = () in ();; 2 | 3 | (** 4 | 0 CONST0 5 | 1 PUSHCONST0 6 | 2 POP 1 7 | 4 ATOM0 8 | 5 SETGLOBAL T020 9 | 7 STOP 10 | **) 11 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t021-pushconst1.ml: -------------------------------------------------------------------------------- 1 | let _ = () in 1;; 2 | 3 | (** 4 | 0 CONST0 5 | 1 PUSHCONST1 6 | 2 POP 1 7 | 4 ATOM0 8 | 5 SETGLOBAL T021-pushconst1 9 | 7 STOP 10 | **) 11 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t021-pushconst2.ml: -------------------------------------------------------------------------------- 1 | let _ = () in 2;; 2 | 3 | (** 4 | 0 CONST0 5 | 1 PUSHCONST2 6 | 2 POP 1 7 | 4 ATOM0 8 | 5 SETGLOBAL T021-pushconst2 9 | 7 STOP 10 | **) 11 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t021-pushconst3.ml: -------------------------------------------------------------------------------- 1 | let _ = () in 3;; 2 | 3 | (** 4 | 0 CONST0 5 | 1 PUSHCONST3 6 | 2 POP 1 7 | 4 ATOM0 8 | 5 SETGLOBAL T021-pushconst3 9 | 7 STOP 10 | **) 11 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t022-pushconstint.ml: -------------------------------------------------------------------------------- 1 | let _ = () in -1;; 2 | 3 | (** 4 | 0 CONST0 5 | 1 PUSHCONSTINT -1 6 | 3 POP 1 7 | 5 ATOM0 8 | 6 SETGLOBAL T022-pushconstint 9 | 8 STOP 10 | **) 11 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t040-makeblock1.ml: -------------------------------------------------------------------------------- 1 | type t = { 2 | mutable a : int; 3 | };; 4 | 5 | { a = 0 };; 6 | 7 | (** 8 | 0 CONST0 9 | 1 MAKEBLOCK1 0 10 | 3 ATOM0 11 | 4 SETGLOBAL T040-makeblock1 12 | 6 STOP 13 | **) 14 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t040-makeblock2.ml: -------------------------------------------------------------------------------- 1 | type t = { 2 | mutable a : int; 3 | mutable b : int; 4 | };; 5 | 6 | { a = 0; b = 0 };; 7 | 8 | (** 9 | 0 CONST0 10 | 1 PUSHCONST0 11 | 2 MAKEBLOCK2 0 12 | 4 ATOM0 13 | 5 SETGLOBAL T040-makeblock2 14 | 7 STOP 15 | **) 16 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t040-makeblock3.ml: -------------------------------------------------------------------------------- 1 | type t = { 2 | mutable a : int; 3 | mutable b : int; 4 | mutable c : int; 5 | };; 6 | 7 | { a = 0; b = 0; c = 0 };; 8 | 9 | (** 10 | 0 CONST0 11 | 1 PUSHCONST0 12 | 2 PUSHCONST0 13 | 3 MAKEBLOCK3 0 14 | 5 ATOM0 15 | 6 SETGLOBAL T040-makeblock3 16 | 8 STOP 17 | **) 18 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t041-makeblock.ml: -------------------------------------------------------------------------------- 1 | type t = { 2 | mutable a : int; 3 | mutable b : int; 4 | mutable c : int; 5 | mutable d : int; 6 | };; 7 | 8 | { a = 0; b = 0; c = 0; d = 0 };; 9 | 10 | (** 11 | 0 CONST0 12 | 1 PUSHCONST0 13 | 2 PUSHCONST0 14 | 3 PUSHCONST0 15 | 4 MAKEBLOCK 4, 0 16 | 7 ATOM0 17 | 8 SETGLOBAL T041-makeblock 18 | 10 STOP 19 | **) 20 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t050-getglobal.ml: -------------------------------------------------------------------------------- 1 | [1];; 2 | 3 | (** 4 | 0 GETGLOBAL <0>(1, 0) 5 | 2 ATOM0 6 | 3 SETGLOBAL T050-getglobal 7 | 5 STOP 8 | **) 9 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t050-pushgetglobal.ml: -------------------------------------------------------------------------------- 1 | let _ = () in 0.01;; 2 | 3 | (** 4 | 0 CONST0 5 | 1 PUSHGETGLOBAL 0.01 6 | 3 POP 1 7 | 5 ATOM0 8 | 6 SETGLOBAL T050-pushgetglobal 9 | 8 STOP 10 | **) 11 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t051-getglobalfield.ml: -------------------------------------------------------------------------------- 1 | Lib.x;; 2 | 3 | (** 4 | 0 CONSTINT 42 5 | 2 PUSHACC0 6 | 3 MAKEBLOCK1 0 7 | 5 POP 1 8 | 7 SETGLOBAL Lib 9 | 9 GETGLOBALFIELD Lib, 0 10 | 12 ATOM0 11 | 13 SETGLOBAL T051-getglobalfield 12 | 15 STOP 13 | **) 14 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t051-pushgetglobalfield.ml: -------------------------------------------------------------------------------- 1 | let _ = () in Lib.x;; 2 | 3 | (** 4 | 0 CONSTINT 42 5 | 2 PUSHACC0 6 | 3 MAKEBLOCK1 0 7 | 5 POP 1 8 | 7 SETGLOBAL Lib 9 | 9 CONST0 10 | 10 PUSHGETGLOBALFIELD Lib, 0 11 | 13 POP 1 12 | 15 ATOM0 13 | 16 SETGLOBAL T051-pushgetglobalfield 14 | 18 STOP 15 | **) 16 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t060-raise.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | raise End_of_file;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 GETGLOBAL End_of_file 11 | 11 MAKEBLOCK1 0 12 | 13 RAISE 13 | 14 SETGLOBAL T060-raise 14 | 16 STOP 15 | **) 16 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t070-branch.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if true then 0 else raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST1 11 | 10 BRANCHIFNOT 15 12 | 12 CONST0 13 | 13 BRANCH 20 14 | 15 GETGLOBAL Not_found 15 | 17 MAKEBLOCK1 0 16 | 19 RAISE 17 | 20 ATOM0 18 | 21 SETGLOBAL T070-branch 19 | 23 STOP 20 | **) 21 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t070-branchif.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if not false then 0 else raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST0 11 | 10 BRANCHIF 15 12 | 12 CONST0 13 | 13 BRANCH 20 14 | 15 GETGLOBAL Not_found 15 | 17 MAKEBLOCK1 0 16 | 19 RAISE 17 | 20 ATOM0 18 | 21 SETGLOBAL T070-branchif 19 | 23 STOP 20 | **) 21 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t070-branchifnot.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if false then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST0 11 | 10 BRANCHIFNOT 17 12 | 12 GETGLOBAL Not_found 13 | 14 MAKEBLOCK1 0 14 | 16 RAISE 15 | 17 ATOM0 16 | 18 SETGLOBAL T070-branchifnot 17 | 20 STOP 18 | **) 19 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t071-boolnot.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if not true then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST1 11 | 10 BOOLNOT 12 | 11 BRANCHIFNOT 18 13 | 13 GETGLOBAL Not_found 14 | 15 MAKEBLOCK1 0 15 | 17 RAISE 16 | 18 ATOM0 17 | 19 SETGLOBAL T071-boolnot 18 | 21 STOP 19 | **) 20 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t080-eq.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if not (0 = 0) then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST0 11 | 10 PUSHCONST0 12 | 11 EQ 13 | 12 BOOLNOT 14 | 13 BRANCHIFNOT 20 15 | 15 GETGLOBAL Not_found 16 | 17 MAKEBLOCK1 0 17 | 19 RAISE 18 | 20 ATOM0 19 | 21 SETGLOBAL T080-eq 20 | 23 STOP 21 | **) 22 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t080-geint.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if not (0 >= 0) then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST0 11 | 10 PUSHCONST0 12 | 11 GEINT 13 | 12 BOOLNOT 14 | 13 BRANCHIFNOT 20 15 | 15 GETGLOBAL Not_found 16 | 17 MAKEBLOCK1 0 17 | 19 RAISE 18 | 20 ATOM0 19 | 21 SETGLOBAL T080-geint 20 | 23 STOP 21 | **) 22 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t080-gtint.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if 0 > 0 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST0 11 | 10 PUSHCONST0 12 | 11 GTINT 13 | 12 BRANCHIFNOT 19 14 | 14 GETGLOBAL Not_found 15 | 16 MAKEBLOCK1 0 16 | 18 RAISE 17 | 19 ATOM0 18 | 20 SETGLOBAL T080-gtint 19 | 22 STOP 20 | **) 21 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t080-leint.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if not (0 <= 0) then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST0 11 | 10 PUSHCONST0 12 | 11 LEINT 13 | 12 BOOLNOT 14 | 13 BRANCHIFNOT 20 15 | 15 GETGLOBAL Not_found 16 | 17 MAKEBLOCK1 0 17 | 19 RAISE 18 | 20 ATOM0 19 | 21 SETGLOBAL T080-leint 20 | 23 STOP 21 | **) 22 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t080-ltint.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if 0 < 0 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST0 11 | 10 PUSHCONST0 12 | 11 LTINT 13 | 12 BRANCHIFNOT 19 14 | 14 GETGLOBAL Not_found 15 | 16 MAKEBLOCK1 0 16 | 18 RAISE 17 | 19 ATOM0 18 | 20 SETGLOBAL T080-ltint 19 | 22 STOP 20 | **) 21 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t080-neq.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if 0 <> 0 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST0 11 | 10 PUSHCONST0 12 | 11 NEQ 13 | 12 BRANCHIFNOT 19 14 | 14 GETGLOBAL Not_found 15 | 16 MAKEBLOCK1 0 16 | 18 RAISE 17 | 19 ATOM0 18 | 20 SETGLOBAL T080-neq 19 | 22 STOP 20 | **) 21 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t092-pushacc0.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | let x = false in 3 | if x then raise Not_found 4 | ;; 5 | 6 | (** 7 | 0 CONSTINT 42 8 | 2 PUSHACC0 9 | 3 MAKEBLOCK1 0 10 | 5 POP 1 11 | 7 SETGLOBAL Lib 12 | 9 CONST0 13 | 10 PUSHACC0 14 | 11 BRANCHIFNOT 18 15 | 13 GETGLOBAL Not_found 16 | 15 MAKEBLOCK1 0 17 | 17 RAISE 18 | 18 POP 1 19 | 20 ATOM0 20 | 21 SETGLOBAL T092-pushacc0 21 | 23 STOP 22 | **) 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t100-pushtrap.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | try raise Not_found 3 | with _ -> () 4 | ;; 5 | 6 | (** 7 | 0 CONSTINT 42 8 | 2 PUSHACC0 9 | 3 MAKEBLOCK1 0 10 | 5 POP 1 11 | 7 SETGLOBAL Lib 12 | 9 PUSHTRAP 16 13 | 11 GETGLOBAL Not_found 14 | 13 MAKEBLOCK1 0 15 | 15 RAISE 16 | 16 PUSHCONST0 17 | 17 POP 1 18 | 19 ATOM0 19 | 20 SETGLOBAL T100-pushtrap 20 | 22 STOP 21 | **) 22 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t101-poptrap.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | try () 3 | with _ -> () 4 | ;; 5 | 6 | (** 7 | 0 CONSTINT 42 8 | 2 PUSHACC0 9 | 3 MAKEBLOCK1 0 10 | 5 POP 1 11 | 7 SETGLOBAL Lib 12 | 9 PUSHTRAP 15 13 | 11 CONST0 14 | 12 POPTRAP 15 | 13 BRANCH 18 16 | 15 PUSHCONST0 17 | 16 POP 1 18 | 18 ATOM0 19 | 19 SETGLOBAL T101-poptrap 20 | 21 STOP 21 | **) 22 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t110-andint.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if (3 land 6) <> 2 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST2 11 | 10 PUSHCONSTINT 6 12 | 12 PUSHCONST3 13 | 13 ANDINT 14 | 14 NEQ 15 | 15 BRANCHIFNOT 22 16 | 17 GETGLOBAL Not_found 17 | 19 MAKEBLOCK1 0 18 | 21 RAISE 19 | 22 ATOM0 20 | 23 SETGLOBAL T110-andint 21 | 25 STOP 22 | **) 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t110-asrint-2.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if (3 asr 1) <> 1 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST1 11 | 10 PUSHCONST1 12 | 11 PUSHCONST3 13 | 12 ASRINT 14 | 13 NEQ 15 | 14 BRANCHIFNOT 21 16 | 16 GETGLOBAL Not_found 17 | 18 MAKEBLOCK1 0 18 | 20 RAISE 19 | 21 ATOM0 20 | 22 SETGLOBAL T110-asrint-2 21 | 24 STOP 22 | **) 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t110-divint-1.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if 2 / 2 <> 1 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST1 11 | 10 PUSHCONST2 12 | 11 PUSHCONST2 13 | 12 DIVINT 14 | 13 NEQ 15 | 14 BRANCHIFNOT 21 16 | 16 GETGLOBAL Not_found 17 | 18 MAKEBLOCK1 0 18 | 20 RAISE 19 | 21 ATOM0 20 | 22 SETGLOBAL T110-divint-1 21 | 24 STOP 22 | **) 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t110-divint-2.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if 3 / 2 <> 1 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST1 11 | 10 PUSHCONST2 12 | 11 PUSHCONST3 13 | 12 DIVINT 14 | 13 NEQ 15 | 14 BRANCHIFNOT 21 16 | 16 GETGLOBAL Not_found 17 | 18 MAKEBLOCK1 0 18 | 20 RAISE 19 | 21 ATOM0 20 | 22 SETGLOBAL T110-divint-2 21 | 24 STOP 22 | **) 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t110-lslint.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if (3 lsl 2) <> 12 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONSTINT 12 11 | 11 PUSHCONST2 12 | 12 PUSHCONST3 13 | 13 LSLINT 14 | 14 NEQ 15 | 15 BRANCHIFNOT 22 16 | 17 GETGLOBAL Not_found 17 | 19 MAKEBLOCK1 0 18 | 21 RAISE 19 | 22 ATOM0 20 | 23 SETGLOBAL T110-lslint 21 | 25 STOP 22 | **) 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t110-lsrint.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if (14 lsr 2) <> 3 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST3 11 | 10 PUSHCONST2 12 | 11 PUSHCONSTINT 14 13 | 13 LSRINT 14 | 14 NEQ 15 | 15 BRANCHIFNOT 22 16 | 17 GETGLOBAL Not_found 17 | 19 MAKEBLOCK1 0 18 | 21 RAISE 19 | 22 ATOM0 20 | 23 SETGLOBAL T110-lsrint 21 | 25 STOP 22 | **) 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t110-modint-1.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if 20 mod 3 <> 2 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST2 11 | 10 PUSHCONST3 12 | 11 PUSHCONSTINT 20 13 | 13 MODINT 14 | 14 NEQ 15 | 15 BRANCHIFNOT 22 16 | 17 GETGLOBAL Not_found 17 | 19 MAKEBLOCK1 0 18 | 21 RAISE 19 | 22 ATOM0 20 | 23 SETGLOBAL T110-modint-1 21 | 25 STOP 22 | **) 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t110-mulint.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if 2 * 2 <> 4 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONSTINT 4 11 | 11 PUSHCONST2 12 | 12 PUSHCONST2 13 | 13 MULINT 14 | 14 NEQ 15 | 15 BRANCHIFNOT 22 16 | 17 GETGLOBAL Not_found 17 | 19 MAKEBLOCK1 0 18 | 21 RAISE 19 | 22 ATOM0 20 | 23 SETGLOBAL T110-mulint 21 | 25 STOP 22 | **) 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t110-offsetint.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if 2 + 2 <> 4 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONSTINT 4 11 | 11 PUSHCONST2 12 | 12 OFFSETINT 2 13 | 14 NEQ 14 | 15 BRANCHIFNOT 22 15 | 17 GETGLOBAL Not_found 16 | 19 MAKEBLOCK1 0 17 | 21 RAISE 18 | 22 ATOM0 19 | 23 SETGLOBAL T110-offsetint 20 | 25 STOP 21 | **) 22 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t110-orint.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if (3 lor 6) <> 7 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONSTINT 7 11 | 11 PUSHCONSTINT 6 12 | 13 PUSHCONST3 13 | 14 ORINT 14 | 15 NEQ 15 | 16 BRANCHIFNOT 23 16 | 18 GETGLOBAL Not_found 17 | 20 MAKEBLOCK1 0 18 | 22 RAISE 19 | 23 ATOM0 20 | 24 SETGLOBAL T110-orint 21 | 26 STOP 22 | **) 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t110-xorint.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | if (3 lxor 6) <> 5 then raise Not_found;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONSTINT 5 11 | 11 PUSHCONSTINT 6 12 | 13 PUSHCONST3 13 | 14 XORINT 14 | 15 NEQ 15 | 16 BRANCHIFNOT 23 16 | 18 GETGLOBAL Not_found 17 | 20 MAKEBLOCK1 0 18 | 22 RAISE 19 | 23 ATOM0 20 | 24 SETGLOBAL T110-xorint 21 | 26 STOP 22 | **) 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t150-push-1.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | let _ = 0 in 3 | try 0 with _ -> 0 4 | ;; 5 | 6 | (** 7 | 0 CONSTINT 42 8 | 2 PUSHACC0 9 | 3 MAKEBLOCK1 0 10 | 5 POP 1 11 | 7 SETGLOBAL Lib 12 | 9 CONST0 13 | 10 PUSH 14 | 11 PUSHTRAP 17 15 | 13 CONST0 16 | 14 POPTRAP 17 | 15 BRANCH 20 18 | 17 PUSHCONST0 19 | 18 POP 1 20 | 20 POP 1 21 | 22 ATOM0 22 | 23 SETGLOBAL T150-push-1 23 | 25 STOP 24 | **) 25 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t160-closure.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | let f () = ();; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 BRANCH 14 11 | 11 CONST0 12 | 12 RETURN 1 13 | 14 CLOSURE 0, 11 14 | 17 PUSHACC0 15 | 18 MAKEBLOCK1 0 16 | 20 POP 1 17 | 22 SETGLOBAL T160-closure 18 | 24 STOP 19 | **) 20 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t162-return.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | let f _ = 0 in f 0;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 BRANCH 14 11 | 11 CONST0 12 | 12 RETURN 1 13 | 14 CLOSURE 0, 11 14 | 17 PUSHCONST0 15 | 18 PUSHACC1 16 | 19 APPLY1 17 | 20 POP 1 18 | 22 ATOM0 19 | 23 SETGLOBAL T162-return 20 | 25 STOP 21 | **) 22 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t163.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | let f _ _ = 0 in f 0;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 BRANCH 17 11 | 11 RESTART 12 | 12 GRAB 1 13 | 14 CONST0 14 | 15 RETURN 2 15 | 17 CLOSURE 0, 12 16 | 20 PUSHCONST0 17 | 21 PUSHACC1 18 | 22 APPLY1 19 | 23 POP 1 20 | 25 ATOM0 21 | 26 SETGLOBAL T163 22 | 28 STOP 23 | **) 24 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t190-makefloatblock-1.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | let x = 0.0 in [| x |];; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 GETGLOBAL 0 11 | 11 PUSHACC0 12 | 12 MAKEFLOATBLOCK 1 13 | 14 POP 1 14 | 16 ATOM0 15 | 17 SETGLOBAL T190-makefloatblock-1 16 | 19 STOP 17 | **) 18 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t190-makefloatblock-2.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | let x = 0.0 in [| x; x |];; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 GETGLOBAL 0 11 | 11 PUSHACC0 12 | 12 PUSHACC1 13 | 13 MAKEFLOATBLOCK 2 14 | 15 POP 1 15 | 17 ATOM0 16 | 18 SETGLOBAL T190-makefloatblock-2 17 | 20 STOP 18 | **) 19 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t190-makefloatblock-3.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | let x = 0.0 in [| x; x; x |];; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 GETGLOBAL 0 11 | 11 PUSHACC0 12 | 12 PUSHACC1 13 | 13 PUSHACC2 14 | 14 MAKEFLOATBLOCK 3 15 | 16 POP 1 16 | 18 ATOM0 17 | 19 SETGLOBAL T190-makefloatblock-3 18 | 21 STOP 19 | **) 20 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t250-closurerec-1.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | let rec f _ = 0;; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 BRANCH 14 11 | 11 CONST0 12 | 12 RETURN 1 13 | 14 CLOSUREREC 0, 11 14 | 18 ACC0 15 | 19 MAKEBLOCK1 0 16 | 21 POP 1 17 | 23 SETGLOBAL T250-closurerec-1 18 | 25 STOP 19 | **) 20 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocaml/t330-compact-1.ml: -------------------------------------------------------------------------------- 1 | open Lib;; 2 | Gc.compact ();; 3 | 4 | (** 5 | 0 CONSTINT 42 6 | 2 PUSHACC0 7 | 3 MAKEBLOCK1 0 8 | 5 POP 1 9 | 7 SETGLOBAL Lib 10 | 9 CONST0 11 | 10 C_CALL1 gc_compaction 12 | 12 ATOM0 13 | 13 SETGLOBAL T330-compact-1 14 | 15 STOP 15 | **) 16 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/A.ml: -------------------------------------------------------------------------------- 1 | let f x = x +1 2 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/B.ml: -------------------------------------------------------------------------------- 1 | open Packed 2 | let g = A.f 3 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/C.ml: -------------------------------------------------------------------------------- 1 | open Lib 2 | let h x = A.f x + B.g x 3 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/D.ml: -------------------------------------------------------------------------------- 1 | let z x = imp (x*2) 2 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/depend.mk.reference: -------------------------------------------------------------------------------- 1 | lib.cmo : lib.cmi 2 | lib.cmx : lib.cmi 3 | lib.cmi : 4 | LibA.cmo : lib.cmi 5 | LibA.cmx : lib.cmx 6 | LibB.cmo : LibA.cmo lib.cmi 7 | LibB.cmx : LibA.cmx lib.cmx 8 | LibC.cmo : LibB.cmo LibA.cmo lib.cmi 9 | LibC.cmx : LibB.cmx LibA.cmx lib.cmx 10 | LibD.cmo : lib.cmi 11 | LibD.cmx : lib.cmx 12 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/depend.mk2.reference: -------------------------------------------------------------------------------- 1 | LibA.cmo : lib.cmi 2 | LibA.cmx : lib.cmi 3 | LibB.cmo : LibA.cmo lib.cmi 4 | LibB.cmx : LibA.cmx lib.cmi 5 | LibC.cmo : LibB.cmo LibA.cmo lib.cmi 6 | LibC.cmx : LibB.cmx LibA.cmx lib.cmi 7 | LibD.cmo : lib.cmi 8 | LibD.cmx : lib.cmi 9 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/depend.mod.reference: -------------------------------------------------------------------------------- 1 | lib.ml: 2 | lib.mli: 3 | LibA.ml: Lib 4 | LibB.ml: Lib LibA 5 | LibC.ml: Lib LibA LibB 6 | LibD.ml: Lib 7 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/depend.mod2.reference: -------------------------------------------------------------------------------- 1 | LibA.ml: 2 | LibB.ml: A Packed 3 | LibC.ml: Lib LibA LibB 4 | LibD.ml: 5 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/depend.mod3.reference: -------------------------------------------------------------------------------- 1 | LibA.ml: Lib 2 | LibB.ml: Lib LibA 3 | LibC.ml: Lib LibA LibB 4 | LibD.ml: Lib 5 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/lib.mli: -------------------------------------------------------------------------------- 1 | module Packed : sig 2 | module A = LibA 3 | module B = LibB 4 | module C = LibC 5 | end 6 | include (module type of struct include Packed end) 7 | 8 | val imp : int -> int 9 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/lib_impl.ml: -------------------------------------------------------------------------------- 1 | module Packed = struct 2 | module A = LibA 3 | module B = LibB 4 | module C = LibC 5 | end 6 | include Packed 7 | 8 | let imp x = x+1 9 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldep-modalias/main.ml: -------------------------------------------------------------------------------- 1 | open Lib 2 | 3 | let () = Printf.printf "B.g 3 = %d\n%!" (B.g 3) 4 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldoc-2/extensible_variant.ml: -------------------------------------------------------------------------------- 1 | (** Testing display of extensible variant types. 2 | 3 | @test_types_display 4 | *) 5 | 6 | type e = .. 7 | 8 | module M = struct 9 | type e += 10 | | A (** A doc *) 11 | | B (** B doc *) 12 | | C (** C doc *) 13 | end 14 | 15 | module type MT = sig 16 | type e += 17 | | A (** A doc *) 18 | | B (** B doc *) 19 | | C (** C doc *) 20 | end 21 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldoc-2/test.mli: -------------------------------------------------------------------------------- 1 | 2 | (** Ten comments for tests *) 3 | 4 | (** {6 A first comments for title } *) 5 | 6 | (** {7 A subsection for ocamldoc *} *) 7 | 8 | (** {7 Bis } *) 9 | 10 | (** {7 Ter } *) 11 | 12 | (** {6 A new section } *) 13 | 14 | (** {7 And its subsection } *) 15 | 16 | (** {7 Encore } *) 17 | 18 | (** Encore! Encore! *) 19 | 20 | 21 | (**/**) 22 | module Silence : sig 23 | (** At last *) 24 | end 25 | 26 | (**/**) 27 | 28 | (** {7 With strange aeons } *) 29 | 30 | module End : sig end 31 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldoc-open/alias.ml: -------------------------------------------------------------------------------- 1 | module Aliased_inner = Inner 2 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldoc-open/inner.ml: -------------------------------------------------------------------------------- 1 | 2 | type a = int 3 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldoc-open/main.ml: -------------------------------------------------------------------------------- 1 | 2 | (** Documentation test *) 3 | 4 | type t = a 5 | (** Alias to type Inner.a *) 6 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldoc/t01.ml: -------------------------------------------------------------------------------- 1 | (** Testing display of types. 2 | 3 | @test_types_display 4 | *) 5 | 6 | let x = 1 7 | 8 | 9 | module M = struct 10 | let y = 2 11 | 12 | end 13 | 14 | module type MT = sig 15 | type t = string -> int -> string -> (string * string * string) -> 16 | (string * string * string) -> 17 | (string * string * string) -> unit 18 | val y : int 19 | 20 | type obj_type = 21 | < foo : int ; bar : float -> string ; gee : int -> (int * string) > 22 | end 23 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldoc/t02.ml: -------------------------------------------------------------------------------- 1 | module Foo = struct type u type t = int let x = 1 end;; 2 | module type TFoo = module type of Foo;; 3 | 4 | module type TBar = TFoo with type u := float;; 5 | 6 | module type Gee = 7 | sig 8 | module M : module type of Foo 9 | include module type of Foo 10 | end 11 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldoc/t02.reference: -------------------------------------------------------------------------------- 1 | # 2 | # module T02: 3 | # 4 | # module T02.Foo: 5 | # 6 | # module type T02.TFoo: 7 | # 8 | # module type T02.TBar: 9 | # 10 | # module type T02.Gee: 11 | # 12 | # module T02.Gee.M: 13 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldoc/t03.ml: -------------------------------------------------------------------------------- 1 | module Foo = struct type t = int let x = 1 end;; 2 | module type MT = module type of Foo;; 3 | module Bar = struct type t = int let x = 2 end;; 4 | 5 | module type MT2 = sig type t val x : t end;; 6 | module type Gee = MT2 with type t = float ;; 7 | module T = (val 8 | (if true 9 | then (module Foo:MT2 with type t = int) 10 | else (module Bar: MT2 with type t = int)) 11 | : MT2 with type t = int) 12 | ;; 13 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldoc/t03.reference: -------------------------------------------------------------------------------- 1 | # 2 | # module T03: 3 | # 4 | # module T03.Foo: 5 | # 6 | # module type T03.MT: 7 | # 8 | # module T03.Bar: 9 | # 10 | # module type T03.MT2: 11 | # 12 | # module type T03.Gee: 13 | # 14 | # module T03.T: 15 | -------------------------------------------------------------------------------- /testsuite/tests/tool-ocamldoc/t04.ml: -------------------------------------------------------------------------------- 1 | (** Testing display of inline record. 2 | 3 | @test_types_display 4 | *) 5 | 6 | 7 | module A = struct 8 | type a = A of {lbl:int} 9 | 10 | end 11 | 12 | module type E = sig 13 | exception E of {lbl:int} 14 | 15 | end 16 | 17 | 18 | module E_bis= struct 19 | exception E of {lbl:int} 20 | end 21 | -------------------------------------------------------------------------------- /testsuite/tests/tool-toplevel/tracing.ml: -------------------------------------------------------------------------------- 1 | List.fold_left;; 2 | #trace List.fold_left;; 3 | 0;; 4 | List.fold_left (+) 0 [1;2;3];; 5 | -------------------------------------------------------------------------------- /testsuite/tests/translprim/Makefile: -------------------------------------------------------------------------------- 1 | BASEDIR=../.. 2 | TOPFLAGS+=-dlambda 3 | include $(BASEDIR)/makefiles/Makefile.dlambda 4 | include $(BASEDIR)/makefiles/Makefile.common 5 | -------------------------------------------------------------------------------- /testsuite/tests/typing-extension-constructor/test.ml: -------------------------------------------------------------------------------- 1 | 2 | type t = ..;; 3 | type t += A;; 4 | 5 | [%extension_constructor A];; 6 | ([%extension_constructor A] : extension_constructor);; 7 | 8 | module M = struct 9 | type extension_constructor = int 10 | end;; 11 | 12 | open M;; 13 | 14 | ([%extension_constructor A] : extension_constructor);; 15 | -------------------------------------------------------------------------------- /testsuite/tests/typing-extension-constructor/test.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # type t = .. 3 | # type t += A 4 | # - : extension_constructor = 5 | # - : extension_constructor = 6 | # module M : sig type extension_constructor = int end 7 | # # Characters 2-28: 8 | ([%extension_constructor A] : extension_constructor);; 9 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 10 | Error: This expression has type extension_constructor 11 | but an expression was expected of type M.extension_constructor = int 12 | # 13 | -------------------------------------------------------------------------------- /testsuite/tests/typing-extensions/Makefile: -------------------------------------------------------------------------------- 1 | BASEDIR=../.. 2 | include $(BASEDIR)/makefiles/Makefile.toplevel 3 | include $(BASEDIR)/makefiles/Makefile.common 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-fstclassmod/fstclassmod.reference: -------------------------------------------------------------------------------- 1 | abc/def/xyz xyz/def/abc 2 | 1 3 | 2 4 | XXXXXXXX 5 | 10 6 | (123,("A",456)) 7 | 2 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-gadts/pr6174.ml: -------------------------------------------------------------------------------- 1 | type _ t = C : ((('a -> 'o) -> 'o) -> ('b -> 'o) -> 'o) t 2 | let f : type a o. ((a -> o) -> o) t -> (a -> o) -> o = 3 | fun C k -> k (fun x -> x);; 4 | [%%expect{| 5 | type _ t = C : ((('a -> 'o) -> 'o) -> ('b -> 'o) -> 'o) t 6 | Line _, characters 24-25: 7 | Error: This expression has type $0 but an expression was expected of type 8 | $1 = ($2 -> $1) -> $1 9 | |}];; 10 | -------------------------------------------------------------------------------- /testsuite/tests/typing-gadts/pr7230.ml: -------------------------------------------------------------------------------- 1 | type _ t = T : int t;; 2 | 3 | (* Should raise Not_found *) 4 | let _ = match (raise Not_found : float t) with _ -> .;; 5 | 6 | [%%expect{| 7 | type _ t = T : int t 8 | Exception: Not_found. 9 | |}];; 10 | -------------------------------------------------------------------------------- /testsuite/tests/typing-gadts/pr7298.ml: -------------------------------------------------------------------------------- 1 | type t = T : t;; 2 | 3 | module M : sig 4 | type free = < bar : t -> unit; foo : free -> unit > 5 | end = struct 6 | class free = object (self : 'self) 7 | method foo self = () 8 | method bar T = self#foo self 9 | end 10 | end;; 11 | [%%expect{| 12 | type t = T : t 13 | module M : sig type free = < bar : t -> unit; foo : free -> unit > end 14 | |}] 15 | -------------------------------------------------------------------------------- /testsuite/tests/typing-gadts/pr7381.ml: -------------------------------------------------------------------------------- 1 | type (_,_) eql = Refl : ('a, 'a) eql;; 2 | [%%expect{| 3 | type (_, _) eql = Refl : ('a, 'a) eql 4 | |}] 5 | 6 | let f : type t. (int, t) eql * (t, string) eql -> unit = function _ -> . ;; 7 | [%%expect{| 8 | val f : (int, 't) eql * ('t, string) eql -> unit = 9 | |}] 10 | 11 | let f : type t. ((int, t) eql * (t, string) eql) option -> unit = 12 | function None -> () ;; 13 | [%%expect{| 14 | val f : ((int, 't) eql * ('t, string) eql) option -> unit = 15 | |}] 16 | -------------------------------------------------------------------------------- /testsuite/tests/typing-labels/mixin.reference: -------------------------------------------------------------------------------- 1 | y 2 | -6 + x 3 | 9 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-labels/mixin2.reference: -------------------------------------------------------------------------------- 1 | y 2 | -6 + x 3 | 9 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-labels/mixin3.reference: -------------------------------------------------------------------------------- 1 | y 2 | -6 + x 3 | 9 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-misc-bugs/pr6303_bad.ml: -------------------------------------------------------------------------------- 1 | type 'a foo = {x: 'a; y: int} 2 | let r = {{x = 0; y = 0} with x = 0} 3 | let r' : string foo = r 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-misc-bugs/pr6946_bad.ml: -------------------------------------------------------------------------------- 1 | external foo : int = "%ignore";; 2 | let _ = foo ();; 3 | -------------------------------------------------------------------------------- /testsuite/tests/typing-misc/pr7228.ml: -------------------------------------------------------------------------------- 1 | type t = A of {mutable x: int};; 2 | fun (A r) -> r.x <- 42;; 3 | [%%expect{| 4 | type t = A of { mutable x : int; } 5 | - : t -> unit = 6 | |}];; 7 | 8 | (* Check that mutability is blocked for inline records on private types *) 9 | type t = private A of {mutable x: int};; 10 | fun (A r) -> r.x <- 42;; 11 | [%%expect{| 12 | type t = private A of { mutable x : int; } 13 | Line _, characters 15-16: 14 | Error: Cannot assign field x of the private type t.A 15 | |}];; 16 | -------------------------------------------------------------------------------- /testsuite/tests/typing-misc/printing.ml: -------------------------------------------------------------------------------- 1 | (* PR#7012 *) 2 | 3 | type t = [ 'A_name | `Hi ];; 4 | [%%expect{| 5 | Line _, characters 11-18: 6 | Error: The type 'A_name is not a polymorphic variant type 7 | Hint: Did you mean `A_name? 8 | |}];; 9 | 10 | let f (x:'id_arg) = x;; 11 | [%%expect{| 12 | val f : 'id_arg -> 'id_arg = 13 | |}];; 14 | 15 | let f (x:'Id_arg) = x;; 16 | [%%expect{| 17 | val f : 'Id_arg -> 'Id_arg = 18 | |}];; 19 | -------------------------------------------------------------------------------- /testsuite/tests/typing-misc/wellfounded.ml: -------------------------------------------------------------------------------- 1 | (* PR#6768 *) 2 | 3 | type _ prod = Prod : ('a * 'y) prod;; 4 | 5 | let f : type t. t prod -> _ = function Prod -> 6 | let module M = 7 | struct 8 | type d = d * d 9 | end 10 | in () 11 | ;; 12 | [%%expect{| 13 | type _ prod = Prod : ('a * 'y) prod 14 | Line _, characters 6-20: 15 | Error: The type abbreviation d is cyclic 16 | |}];; 17 | -------------------------------------------------------------------------------- /testsuite/tests/typing-missing-cmi/a.ml: -------------------------------------------------------------------------------- 1 | let (a : M.a) = 2 2 | -------------------------------------------------------------------------------- /testsuite/tests/typing-missing-cmi/b.ml: -------------------------------------------------------------------------------- 1 | let (b : M.b) = 2 2 | -------------------------------------------------------------------------------- /testsuite/tests/typing-missing-cmi/c.ml: -------------------------------------------------------------------------------- 1 | (* GPR#816 *) 2 | (* This PR means that Foo(Bar).t is known to be equal to Foo(Baz).t 3 | when Bar is an alias for Baz, even when the definition for Foo is unknown. 4 | This can happen when .cmi files depend on other .cmi files not in the path 5 | -- a situation that is partially supported. *) 6 | 7 | module A = M 8 | 9 | type t1 = M.Foo(M).t 10 | type t2 = A.Foo(A).t 11 | -------------------------------------------------------------------------------- /testsuite/tests/typing-missing-cmi/main.ml: -------------------------------------------------------------------------------- 1 | let _ = A.a = B.b 2 | -------------------------------------------------------------------------------- /testsuite/tests/typing-missing-cmi/main.ml.reference: -------------------------------------------------------------------------------- 1 | File "main.ml", line 1, characters 14-17: 2 | Error: This expression has type M.b but an expression was expected of type 3 | M.a 4 | M.b is abstract because no corresponding cmi file was found in path. 5 | M.a is abstract because no corresponding cmi file was found in path. 6 | -------------------------------------------------------------------------------- /testsuite/tests/typing-missing-cmi/main_ok.ml: -------------------------------------------------------------------------------- 1 | let f (x : C.t1) = (x : C.t2) 2 | -------------------------------------------------------------------------------- /testsuite/tests/typing-missing-cmi/subdir/m.ml: -------------------------------------------------------------------------------- 1 | type a = int 2 | type b = a 3 | 4 | module Foo(X : sig end) = struct type t = T end 5 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr5164_ok.ml: -------------------------------------------------------------------------------- 1 | module type INCLUDING = sig 2 | include module type of List 3 | include module type of ListLabels 4 | end 5 | 6 | module Including_typed: INCLUDING = struct 7 | include List 8 | include ListLabels 9 | end 10 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr5663_ok.ml: -------------------------------------------------------------------------------- 1 | module F (M : sig 2 | type 'a t 3 | type 'a u = string 4 | val f : unit -> _ u t 5 | end) = struct 6 | let t = M.f () 7 | end 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr5914_ok.ml: -------------------------------------------------------------------------------- 1 | type 't a = [ `A ] 2 | type 't wrap = 't constraint 't = [> 't wrap a ] 3 | type t = t a wrap 4 | 5 | module T = struct 6 | let foo : 't wrap -> 't wrap -> unit = fun _ _ -> () 7 | let bar : ('a a wrap as 'a) = `A 8 | end 9 | 10 | module Good : sig 11 | val bar: t 12 | val foo: t -> t -> unit 13 | end = T 14 | 15 | module Bad : sig 16 | val foo: t -> t -> unit 17 | val bar: t 18 | end = T 19 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr6240_ok.ml: -------------------------------------------------------------------------------- 1 | module M : sig 2 | module type T 3 | module F (X : T) : sig end 4 | end = struct 5 | module type T = sig end 6 | module F (X : T) = struct end 7 | end 8 | 9 | module type T = M.T 10 | 11 | module F : functor (X : T) -> sig end = M.F 12 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr6293_bad.ml: -------------------------------------------------------------------------------- 1 | module type S = sig type t = { a : int; b : int; } end;; 2 | let f (module M : S with type t = int) = { M.a = 0 };; 3 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr6572_ok.ml: -------------------------------------------------------------------------------- 1 | module type S = sig 2 | include Set.S 3 | module E : sig val x : int end 4 | end 5 | 6 | module Make(O : Set.OrderedType) : S with type elt = O.t = 7 | struct 8 | include Set.Make(O) 9 | module E = struct let x = 1 end 10 | end 11 | 12 | module rec A : Set.OrderedType = struct 13 | type t = int 14 | let compare = Pervasives.compare 15 | end 16 | and B : S = struct 17 | module C = Make(A) 18 | include C 19 | end 20 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr6651_ok.ml: -------------------------------------------------------------------------------- 1 | module type S = sig 2 | module type T 3 | module X : T 4 | end 5 | 6 | module F (X : S) = X.X 7 | 8 | module M = struct 9 | module type T = sig type t end 10 | module X = struct type t = int end 11 | end 12 | 13 | type t = F(M).t 14 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr6899_first_bad.ml: -------------------------------------------------------------------------------- 1 | let should_reject = 2 | let table = Hashtbl.create 1 in 3 | fun x y -> Hashtbl.add table x y 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr6899_ok.ml: -------------------------------------------------------------------------------- 1 | type 'a t = 'a option 2 | let is_some = function 3 | | None -> false 4 | | Some _ -> true 5 | 6 | let should_accept ?x () = is_some x 7 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr6899_second_bad.ml: -------------------------------------------------------------------------------- 1 | include struct 2 | let foo `Test = () 3 | let wrap f `Test = f 4 | let bar = wrap () 5 | end 6 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr6944_ok.ml: -------------------------------------------------------------------------------- 1 | let f () = 2 | let module S = String in 3 | let module N = Map.Make(S) in 4 | N.add "sum" 41 N.empty;; 5 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr6954_ok.ml: -------------------------------------------------------------------------------- 1 | module X = struct module Y = struct module type S = sig type t end end end 2 | 3 | (* open X (* works! *) *) 4 | module Y = X.Y 5 | 6 | type 'a arg_t = 'at constraint 'a = (module Y.S with type t = 'at) 7 | type t = (module X.Y.S with type t = unit) 8 | 9 | let f (x : t arg_t) = () 10 | 11 | let () = f () 12 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr6981_ok.ml: -------------------------------------------------------------------------------- 1 | module type S = 2 | sig 3 | type a 4 | type b 5 | end 6 | module Foo 7 | (Bar : S with type a = private [> `A]) 8 | (Baz : S with type b = private < b : Bar.b ; .. >) = 9 | struct 10 | end 11 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr6985_ok.ml: -------------------------------------------------------------------------------- 1 | module Foo 2 | (Bar : sig type a = private [> `A ] end) 3 | (Baz : module type of struct include Bar end) = 4 | struct 5 | end 6 | module Bazoinks = struct type a = [ `A ] end 7 | module Bug = Foo(Bazoinks)(Bazoinks) 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr7082_ok.ml: -------------------------------------------------------------------------------- 1 | module type FOO = sig type t end 2 | module type BAR = 3 | sig 4 | (* Works: module rec A : (sig include FOO with type t = < b:B.t > end) *) 5 | module rec A : (FOO with type t = < b:B.t >) 6 | and B : FOO 7 | end 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr7112_bad.ml: -------------------------------------------------------------------------------- 1 | module A = struct module type S module S = struct end end 2 | module F (_ : sig end) = struct module type S module S = A.S end 3 | module M = struct end 4 | module N = M 5 | module G (X : F(N).S) : A.S = X 6 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr7112_ok.ml: -------------------------------------------------------------------------------- 1 | module F (_ : sig end) = struct module type S end 2 | module M = struct end 3 | module N = M 4 | module G (X : F(N).S) : F(M).S = X 5 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules-bugs/pr7182_ok.ml: -------------------------------------------------------------------------------- 1 | module rec M 2 | : sig external f : int -> int = "%identity" end 3 | = struct external f : int -> int = "%identity" end 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules/pr7207.ml: -------------------------------------------------------------------------------- 1 | module F (X : sig end) = struct type t = int end;; 2 | type t = F(Does_not_exist).t;; 3 | [%%expect{| 4 | module F : functor (X : sig end) -> sig type t = int end 5 | Line _, characters 9-28: 6 | Error: Unbound module Does_not_exist 7 | |}];; 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-modules/recursive.ml: -------------------------------------------------------------------------------- 1 | (* PR#7324 *) 2 | 3 | module rec T : sig type t = T.t end = T;; 4 | [%%expect{| 5 | Line _, characters 15-35: 6 | Error: The type abbreviation T.t is cyclic 7 | |}] 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects-bugs/pr3968_bad.ml: -------------------------------------------------------------------------------- 1 | type expr = 2 | [ `Abs of string * expr 3 | | `App of expr * expr 4 | ] 5 | 6 | class type exp = 7 | object 8 | method eval : (string, exp) Hashtbl.t -> expr 9 | end;; 10 | 11 | class app e1 e2 : exp = 12 | object 13 | val l = e1 14 | val r = e2 15 | method eval env = 16 | match l with 17 | | `Abs(var,body) -> 18 | Hashtbl.add env var r; 19 | body 20 | | _ -> `App(l,r); 21 | end 22 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects-bugs/pr4435_bad.ml: -------------------------------------------------------------------------------- 1 | (* Two v's in the same class *) 2 | class c v = object initializer print_endline v val v = 42 end;; 3 | new c "42";; 4 | 5 | (* Two hidden v's in the same class! *) 6 | class c (v : int) = 7 | object 8 | method v0 = v 9 | inherit ((fun v -> object method v : string = v end) "42") 10 | end;; 11 | (new c 42)#v0;; 12 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects-bugs/pr4766_ok.ml: -------------------------------------------------------------------------------- 1 | class virtual ['a] c = 2 | object (s : 'a) 3 | method virtual m : 'b 4 | end 5 | 6 | let o = 7 | object (s :'a) 8 | inherit ['a] c 9 | method m = 42 10 | end 11 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects-bugs/pr4824_ok.ml: -------------------------------------------------------------------------------- 1 | module M : 2 | sig 3 | class x : int -> object method m : int end 4 | end 5 | = 6 | struct 7 | class x _ = object 8 | method m = 42 9 | end 10 | end;; 11 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects-bugs/pr4824a_bad.ml: -------------------------------------------------------------------------------- 1 | module M : sig class c : 'a -> object val x : 'b end end = 2 | struct class c x = object val x = x end end 3 | 4 | class c (x : int) = object inherit M.c x method x : bool = x end 5 | 6 | let r = (new c 2)#x;; 7 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects-bugs/pr5156_ok.ml: -------------------------------------------------------------------------------- 1 | class type t = object end;; 2 | class ['a] o1 = object (self : #t as 'a) end;; 3 | type 'a obj = ( < .. > as 'a);; 4 | class type ['a] o2 = object ('a obj) end;; 5 | class ['a] o3 = object (self : 'a obj) end;; 6 | class ['a] o4 = object (self) method m = (self : 'a obj) end;; 7 | (* 8 | let o = object (self : 'a obj) end;; 9 | let o = object (self) method m = (self : 'a obj) end;; 10 | *) 11 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects-bugs/pr7293_ok.ml: -------------------------------------------------------------------------------- 1 | type t = T : t 2 | type s = T 3 | 4 | class c = object (self : 'self) 5 | 6 | method foo : s -> 'self = function 7 | | T -> self#bar () 8 | 9 | method bar : unit -> 'self = fun () -> self 10 | 11 | end 12 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects-bugs/woodyatt_ok.ml: -------------------------------------------------------------------------------- 1 | (* test.ml *) 2 | class alfa = object(_:'self) 3 | method x: 'a. ('a, out_channel, unit) format -> 'a = Printf.printf 4 | end 5 | 6 | class bravo a = object 7 | val y = (a :> alfa) 8 | initializer y#x "bravo initialized" 9 | end 10 | 11 | class charlie a = object 12 | inherit bravo a 13 | initializer y#x "charlie initialized" 14 | end 15 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr5545.ml: -------------------------------------------------------------------------------- 1 | type foo = int;; 2 | 3 | class o = 4 | object(this) 5 | method x : foo = 10 6 | method y : int = this # x 7 | end;; 8 | 9 | 10 | class o = 11 | object(this) 12 | method x : foo = 10 13 | method y = (this # x : int) 14 | end;; 15 | 16 | 17 | 18 | class o = 19 | object(this) 20 | method x : int = (10 : int) 21 | method y = (this # x : foo) 22 | end;; 23 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr5545.ml.principal.reference: -------------------------------------------------------------------------------- 1 | 2 | # type foo = int 3 | # class o : object method x : foo method y : int end 4 | # class o : object method x : foo method y : int end 5 | # class o : object method x : int method y : foo end 6 | # 7 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr5545.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # type foo = int 3 | # class o : object method x : foo method y : int end 4 | # class o : object method x : foo method y : int end 5 | # class o : object method x : int method y : foo end 6 | # 7 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr5858.ml: -------------------------------------------------------------------------------- 1 | class type c = object end;; 2 | module type S = sig class c: c end;; 3 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr5858.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # class type c = object end 3 | # Characters 29-30: 4 | module type S = sig class c: c end;; 5 | ^ 6 | Error: The class type c is not yet completely defined 7 | # 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr6123_bad.ml: -------------------------------------------------------------------------------- 1 | class virtual name = 2 | object 3 | end 4 | 5 | and func (args_ty, ret_ty) = 6 | object(self) 7 | inherit name 8 | 9 | val mutable memo_args = None 10 | 11 | method arguments = 12 | match memo_args with 13 | | Some xs -> xs 14 | | None -> 15 | let args = List.map (fun ty -> new argument(self, ty)) args_ty in 16 | memo_args <- Some args; args 17 | end 18 | 19 | and argument (func, ty) = 20 | object 21 | inherit name 22 | end 23 | ;; 24 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr6123_bad.ml.principal.reference: -------------------------------------------------------------------------------- 1 | 2 | # Characters 253-257: 3 | let args = List.map (fun ty -> new argument(self, ty)) args_ty in 4 | ^^^^ 5 | Error: This expression has type < arguments : 'a; .. > 6 | but an expression was expected of type 'b 7 | Self type cannot escape its class 8 | # 9 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr6123_bad.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # Characters 253-257: 3 | let args = List.map (fun ty -> new argument(self, ty)) args_ty in 4 | ^^^^ 5 | Error: This expression has type < arguments : 'a; .. > 6 | but an expression was expected of type 'b 7 | Self type cannot escape its class 8 | # 9 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr6383.ml: -------------------------------------------------------------------------------- 1 | let f (x: #M.foo) = 0;; 2 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr6383.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # Characters 10-16: 3 | let f (x: #M.foo) = 0;; 4 | ^^^^^^ 5 | Error: Unbound module M 6 | # 7 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr6907_bad.ml: -------------------------------------------------------------------------------- 1 | class type ['e] t = object('s) 2 | method update : 'e -> 's 3 | end;; 4 | 5 | module type S = sig 6 | class base : 'e -> ['e] t 7 | end;; 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-objects/pr6907_bad.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # class type ['e] t = object ('a) method update : 'e -> 'a end 3 | # Characters 23-48: 4 | class base : 'e -> ['e] t 5 | ^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | Error: Some type variables are unbound in this type: 7 | class base : 'e -> ['e] t 8 | The method update has type 'e -> < update : 'a; .. > as 'a where 'e 9 | is unbound 10 | # 11 | -------------------------------------------------------------------------------- /testsuite/tests/typing-pattern_open/Makefile: -------------------------------------------------------------------------------- 1 | BASEDIR=../.. 2 | include $(BASEDIR)/makefiles/Makefile.toplevel 3 | include $(BASEDIR)/makefiles/Makefile.common 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-poly-bugs/pr5322_ok.ml: -------------------------------------------------------------------------------- 1 | type 'par t = 'par 2 | module M : sig val x : end = 3 | struct let x : = Obj.magic () end 4 | 5 | let ident v = v 6 | class alias = object method alias : 'a . 'a t -> 'a = ident end 7 | -------------------------------------------------------------------------------- /testsuite/tests/typing-polyvariants-bugs-2/pr3918a.mli: -------------------------------------------------------------------------------- 1 | type 'a voption = [ `None | `Some of 'a] 2 | -------------------------------------------------------------------------------- /testsuite/tests/typing-polyvariants-bugs-2/pr3918b.mli: -------------------------------------------------------------------------------- 1 | type 'a vlist = ('a * 'b) Pr3918a.voption as 'b 2 | -------------------------------------------------------------------------------- /testsuite/tests/typing-polyvariants-bugs-2/pr3918c.ml: -------------------------------------------------------------------------------- 1 | (* 2 | ocamlc -c pr3918a.mli pr3918b.mli 3 | rm -f pr3918a.cmi 4 | ocamlc -c pr3918c.ml 5 | *) 6 | 7 | open Pr3918b 8 | 9 | let f x = (x : 'a vlist :> 'b vlist) 10 | let f (x : 'a vlist) = (x : 'b vlist) 11 | -------------------------------------------------------------------------------- /testsuite/tests/typing-polyvariants-bugs/pr4775_ok.ml: -------------------------------------------------------------------------------- 1 | module type Poly = sig 2 | type 'a t = 'a constraint 'a = [> ] 3 | end 4 | 5 | module Combine (A : Poly) (B : Poly) = struct 6 | type ('a, 'b) t = 'a A.t constraint 'a = 'b B.t 7 | end 8 | 9 | module C = Combine 10 | (struct type 'a t = 'a constraint 'a = [> ] end) 11 | (struct type 'a t = 'a constraint 'a = [> ] end) 12 | -------------------------------------------------------------------------------- /testsuite/tests/typing-polyvariants-bugs/pr4933_ok.ml: -------------------------------------------------------------------------------- 1 | module type Priv = sig 2 | type t = private int 3 | end 4 | 5 | module Make (Unit:sig end): Priv = struct type t = int end 6 | 7 | module A = Make (struct end) 8 | 9 | module type Priv' = sig 10 | type t = private [> `A] 11 | end 12 | 13 | module Make' (Unit:sig end): Priv' = struct type t = [`A] end 14 | 15 | module A' = Make' (struct end) 16 | -------------------------------------------------------------------------------- /testsuite/tests/typing-polyvariants-bugs/pr5057_ok.ml: -------------------------------------------------------------------------------- 1 | (* PR5057 *) 2 | 3 | module TT = struct 4 | module IntSet = Set.Make(struct type t = int let compare = compare end) 5 | end 6 | 7 | let () = 8 | let f flag = 9 | let module T = TT in 10 | let _ = match flag with `A -> 0 | `B r -> r in 11 | let _ = match flag with `A -> T.IntSet.mem | `B r -> r in 12 | () 13 | in 14 | f `A 15 | -------------------------------------------------------------------------------- /testsuite/tests/typing-polyvariants-bugs/pr5057a_bad.ml: -------------------------------------------------------------------------------- 1 | (* This one should fail *) 2 | 3 | let f flag = 4 | let module T = Set.Make(struct type t = int let compare = compare end) in 5 | let _ = match flag with `A -> 0 | `B r -> r in 6 | let _ = match flag with `A -> T.mem | `B r -> r in 7 | () 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-polyvariants-bugs/pr7199_ok.ml: -------------------------------------------------------------------------------- 1 | module type S = sig 2 | type +'a t 3 | 4 | val foo : [`A] t -> unit 5 | val bar : [< `A | `B] t -> unit 6 | end 7 | 8 | module Make(T : S) = struct 9 | let f x = 10 | T.foo x; 11 | T.bar x; 12 | (x :> [`A | `C] T.t) 13 | end 14 | -------------------------------------------------------------------------------- /testsuite/tests/typing-private-bugs/pr5026_bad.ml: -------------------------------------------------------------------------------- 1 | type untyped;; 2 | type -'a typed = private untyped;; 3 | type -'typing wrapped = private sexp 4 | and +'a t = 'a typed wrapped 5 | and sexp = private untyped wrapped;; 6 | class type ['a] s3 = object 7 | val underlying : 'a t 8 | end;; 9 | class ['a] s3object r : ['a] s3 = object 10 | val underlying = r 11 | end;; 12 | -------------------------------------------------------------------------------- /testsuite/tests/typing-private-bugs/pr5469_ok.ml: -------------------------------------------------------------------------------- 1 | module M (T:sig type t end) 2 | = struct type t = private { t : T.t } end 3 | module P 4 | = struct 5 | module T = struct type t end 6 | module R = M(T) 7 | end 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t01bad.ml: -------------------------------------------------------------------------------- 1 | (* Bad (t = t) *) 2 | module rec A : sig type t = A.t end = struct type t = A.t end;; 3 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t02bad.ml: -------------------------------------------------------------------------------- 1 | (* Bad (t = t) *) 2 | module rec A : sig type t = B.t end = struct type t = B.t end 3 | and B : sig type t = A.t end = struct type t = A.t end;; 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t03ok.ml: -------------------------------------------------------------------------------- 1 | (* OK (t = int) *) 2 | module rec A : sig type t = B.t end = struct type t = B.t end 3 | and B : sig type t = int end = struct type t = int end;; 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t04bad.ml: -------------------------------------------------------------------------------- 1 | (* Bad (t = int * t) *) 2 | module rec A : sig type t = int * A.t end = struct type t = int * A.t end;; 3 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t05bad.ml: -------------------------------------------------------------------------------- 1 | (* Bad (t = t -> int) *) 2 | module rec A : sig type t = B.t -> int end = struct type t = B.t -> int end 3 | and B : sig type t = A.t end = struct type t = A.t end;; 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t06ok.ml: -------------------------------------------------------------------------------- 1 | (* OK (t = ) *) 2 | module rec A : sig type t = end = struct type t = end 3 | and B : sig type t = A.t end = struct type t = A.t end;; 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t07bad.ml: -------------------------------------------------------------------------------- 1 | (* Bad (not regular) *) 2 | module rec A : sig type 'a t = end 3 | = struct type 'a t = end;; 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t08bad.ml: -------------------------------------------------------------------------------- 1 | (* Bad (not regular) *) 2 | module rec A : sig type 'a t = end 3 | = struct type 'a t = end 4 | and B : sig type 'a t = 'a A.t end = struct type 'a t = 'a A.t end;; 5 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t09bad.ml: -------------------------------------------------------------------------------- 1 | (* Bad (not regular) *) 2 | module rec A : sig type 'a t = 'a B.t end 3 | = struct type 'a t = 'a B.t end 4 | and B : sig type 'a t = end 5 | = struct type 'a t = end;; 6 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t10ok.ml: -------------------------------------------------------------------------------- 1 | (* OK *) 2 | module rec A : sig type 'a t = 'a array B.t * 'a list B.t end 3 | = struct type 'a t = 'a array B.t * 'a list B.t end 4 | and B : sig type 'a t = end 5 | = struct type 'a t = end;; 6 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t11bad.ml: -------------------------------------------------------------------------------- 1 | (* Bad (not regular) *) 2 | module rec A : sig type 'a t = 'a list B.t end 3 | = struct type 'a t = 'a list B.t end 4 | and B : sig type 'a t = end 5 | = struct type 'a t = end;; 6 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t12bad.ml: -------------------------------------------------------------------------------- 1 | (* Bad (not regular) *) 2 | module rec M : 3 | sig 4 | class ['a] c : 'a -> object 5 | method map : ('a -> 'b) -> 'b M.c 6 | end 7 | end 8 | = struct 9 | class ['a] c (x : 'a) = object 10 | method map : 'b. ('a -> 'b) -> 'b M.c 11 | = fun f -> new M.c (f x) 12 | end 13 | end;; 14 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t13ok.ml: -------------------------------------------------------------------------------- 1 | (* OK *) 2 | class type [ 'node ] extension = object method node : 'node end 3 | class type [ 'ext ] node = object constraint 'ext = 'ext node #extension end 4 | class x = object method node : x node = assert false end 5 | type t = x node;; 6 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t14bad.ml: -------------------------------------------------------------------------------- 1 | (* Bad - PR 4261 *) 2 | 3 | module PR_4261 = struct 4 | module type S = 5 | sig 6 | type t 7 | end 8 | 9 | module type T = 10 | sig 11 | module D : S 12 | type t = D.t 13 | end 14 | 15 | module rec U : T with module D = U' = U 16 | and U' : S with type t = U'.t = U 17 | end;; 18 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t15bad.ml: -------------------------------------------------------------------------------- 1 | (* Bad - PR 4512 *) 2 | module type S' = sig type t = int end 3 | module rec M : S' with type t = M.t = struct type t = M.t end;; 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-recmod/t19ok.ml: -------------------------------------------------------------------------------- 1 | (* PR 4758, PR 4266 *) 2 | 3 | module PR_4758 = struct 4 | module type S = sig end 5 | module type Mod = sig 6 | module Other : S 7 | end 8 | module rec A : S = struct end 9 | and C : sig include Mod with module Other = A end = struct 10 | module Other = A 11 | end 12 | module C' = C (* check that we can take an alias *) 13 | module F(X:sig end) = struct type t end 14 | let f (x : F(C).t) = (x : F(C').t) 15 | end 16 | -------------------------------------------------------------------------------- /testsuite/tests/typing-rectypes-bugs/pr5343_bad.ml: -------------------------------------------------------------------------------- 1 | module M : sig 2 | type 'a t 3 | type u = u t and v = v t 4 | val f : int -> u 5 | val g : v -> bool 6 | end = struct 7 | type 'a t = 'a 8 | type u = int and v = bool 9 | let f x = x 10 | let g x = x 11 | end;; 12 | 13 | let h (x : int) : bool = M.g (M.f x);; 14 | -------------------------------------------------------------------------------- /testsuite/tests/typing-rectypes-bugs/pr6174_bad.ml: -------------------------------------------------------------------------------- 1 | type _ t = C : ((('a -> 'o) -> 'o) -> ('b -> 'o) -> 'o) t 2 | let f : type a o. ((a -> o) -> o) t -> (a -> o) -> o = 3 | fun C k -> k (fun x -> x);; 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-rectypes-bugs/pr6870_bad.ml: -------------------------------------------------------------------------------- 1 | module type T = sig type 'a t end 2 | module Fix (T : T) = struct type r = ('r T.t as 'r) end 3 | -------------------------------------------------------------------------------- /testsuite/tests/typing-safe-linking/Makefile: -------------------------------------------------------------------------------- 1 | # Check safety of linking 2 | 3 | SOURCES = a.ml b_bad.ml 4 | OBJECTS = $(SOURCES:%.ml=%.cmo) 5 | 6 | all: a.cmo 7 | @printf " ... testing 'b_bad.ml'" 8 | @$(OCAMLC) -c -safe-string -warn-error +8 b_bad.ml 2> /dev/null \ 9 | && echo " => failed" || echo " => passed" 10 | 11 | clean: 12 | @rm -f *.cmo *.cmi 13 | 14 | BASEDIR=../.. 15 | include $(BASEDIR)/makefiles/Makefile.common 16 | -------------------------------------------------------------------------------- /testsuite/tests/typing-safe-linking/a.ml: -------------------------------------------------------------------------------- 1 | type _ t = 2 | X of string 3 | | Y : bytes t 4 | 5 | let y : string t = Y 6 | -------------------------------------------------------------------------------- /testsuite/tests/typing-safe-linking/b_bad.ml: -------------------------------------------------------------------------------- 1 | let f : string A.t -> unit = function 2 | A.X s -> print_endline s 3 | 4 | let () = f A.y 5 | -------------------------------------------------------------------------------- /testsuite/tests/typing-short-paths/pr5918.ml: -------------------------------------------------------------------------------- 1 | module rec A : sig 2 | type t 3 | end = struct 4 | type t = { a : unit; b : unit } 5 | let _ = { a = () } 6 | end 7 | ;; 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-short-paths/pr5918.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # Characters 82-92: 3 | let _ = { a = () } 4 | ^^^^^^^^^^ 5 | Error: Some record fields are undefined: b 6 | # 7 | -------------------------------------------------------------------------------- /testsuite/tests/typing-short-paths/pr6836.ml: -------------------------------------------------------------------------------- 1 | type t = [`A | `B];; 2 | type 'a u = t;; 3 | let a : [< int u] = `A;; 4 | 5 | type 'a s = 'a;; 6 | let b : [< t s] = `B;; 7 | -------------------------------------------------------------------------------- /testsuite/tests/typing-short-paths/pr6836.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # type t = [ `A | `B ] 3 | # type 'a u = t 4 | # val a : [< int u > `A ] = `A 5 | # type 'a s = 'a 6 | # val b : [< t > `B ] = `B 7 | # 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-signatures/pr6371.ml: -------------------------------------------------------------------------------- 1 | module M = struct 2 | type t = int * (< m : 'a > as 'a) 3 | end;; 4 | 5 | module type S = 6 | sig module M : sig type t end end with module M = M 7 | ;; 8 | -------------------------------------------------------------------------------- /testsuite/tests/typing-signatures/pr6371.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # module M : sig type t = int * (< m : 'a > as 'a) end 3 | # module type S = sig module M : sig type t = int * (< m : 'a > as 'a) end end 4 | # 5 | -------------------------------------------------------------------------------- /testsuite/tests/typing-signatures/pr6672.ml: -------------------------------------------------------------------------------- 1 | module type S = sig type 'a t end;; 2 | module type T = S with type +'a t = 'a list;; 3 | module type T = S with type -'a t = 'a list;; 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-signatures/pr6672.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # module type S = sig type 'a t end 3 | # module type T = sig type 'a t = 'a list end 4 | # Characters 23-43: 5 | module type T = S with type -'a t = 'a list;; 6 | ^^^^^^^^^^^^^^^^^^^^ 7 | Error: In this definition, expected parameter variances are not satisfied. 8 | The 1st type parameter was expected to be contravariant, 9 | but it is injective covariant. 10 | # 11 | -------------------------------------------------------------------------------- /testsuite/tests/typing-unboxed-types/Makefile: -------------------------------------------------------------------------------- 1 | BASEDIR=../.. 2 | include $(BASEDIR)/makefiles/Makefile.toplevel 3 | include $(BASEDIR)/makefiles/Makefile.common 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-warnings/application.ml: -------------------------------------------------------------------------------- 1 | let _ = ignore (+);; 2 | let _ = raise Exit 3;; 3 | -------------------------------------------------------------------------------- /testsuite/tests/typing-warnings/application.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # Characters 15-18: 3 | let _ = ignore (+);; 4 | ^^^ 5 | Warning 5: this function application is partial, 6 | maybe some arguments are missing. 7 | - : unit = () 8 | # Characters 19-20: 9 | let _ = raise Exit 3;; 10 | ^ 11 | Warning 20: this argument will not be used by the function. 12 | Exception: Pervasives.Exit. 13 | # 14 | -------------------------------------------------------------------------------- /testsuite/tests/typing-warnings/pr5892.ml: -------------------------------------------------------------------------------- 1 | open CamlinternalOO;; 2 | type _ choice = Left : label choice | Right : tag choice;; 3 | let f : label choice -> bool = function Left -> true;; (* warn *) 4 | -------------------------------------------------------------------------------- /testsuite/tests/typing-warnings/pr5892.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # # type _ choice = 3 | Left : CamlinternalOO.label choice 4 | | Right : CamlinternalOO.tag choice 5 | # Characters 31-52: 6 | let f : label choice -> bool = function Left -> true;; (* warn *) 7 | ^^^^^^^^^^^^^^^^^^^^^ 8 | Warning 8: this pattern-matching is not exhaustive. 9 | Here is an example of a case that is not matched: 10 | Right 11 | val f : CamlinternalOO.label choice -> bool = 12 | # 13 | -------------------------------------------------------------------------------- /testsuite/tests/typing-warnings/pr6872.ml: -------------------------------------------------------------------------------- 1 | exception A;; 2 | type a = A;; 3 | 4 | A;; 5 | raise A;; 6 | fun (A : a) -> ();; 7 | function Not_found -> 1 | A -> 2 | _ -> 3;; 8 | try raise A with A -> 2;; 9 | -------------------------------------------------------------------------------- /testsuite/tests/typing-warnings/pr7115.ml: -------------------------------------------------------------------------------- 1 | type t = A : t;; 2 | 3 | module X1 : sig end = struct 4 | let _f ~x (* x unused argument *) = function 5 | | A -> let x = () in x 6 | end;; 7 | 8 | module X2 : sig end = struct 9 | let x = 42 (* unused value *) 10 | let _f = function 11 | | A -> let x = () in x 12 | end;; 13 | 14 | module X3 : sig end = struct 15 | module O = struct let x = 42 (* unused *) end 16 | open O (* unused open *) 17 | 18 | let _f = function 19 | | A -> let x = () in x 20 | end;; 21 | -------------------------------------------------------------------------------- /testsuite/tests/typing-warnings/pr7297.ml: -------------------------------------------------------------------------------- 1 | let () = raise Exit; () ;; (* warn *) 2 | -------------------------------------------------------------------------------- /testsuite/tests/typing-warnings/pr7297.ml.reference: -------------------------------------------------------------------------------- 1 | 2 | # Characters 9-19: 3 | let () = raise Exit; () ;; (* warn *) 4 | ^^^^^^^^^^ 5 | Warning 21: this statement never returns (or has an unsound type.) 6 | Exception: Pervasives.Exit. 7 | # 8 | -------------------------------------------------------------------------------- /testsuite/tests/unboxed-primitive-args/main.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/unboxed-primitive-args/main.reference -------------------------------------------------------------------------------- /testsuite/tests/unwind/driver.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | Mylib.foo1 Mylib.bar 1 2 3 4 5 6 7 8 9 10; 3 | Mylib.foo2 Mylib.baz 1 2 3 4 5 6 7 8 9 10 4 | -------------------------------------------------------------------------------- /testsuite/tests/utils/test_strongly_connected_components.reference: -------------------------------------------------------------------------------- 1 | 2 | All tests succeeded. 3 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/deprecated_module.ml: -------------------------------------------------------------------------------- 1 | module M = struct 2 | type t = int 3 | 4 | let x = 10 5 | end 6 | [@@ocaml.deprecated] 7 | 8 | let _ = M.x 9 | include M 10 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/deprecated_module.mli: -------------------------------------------------------------------------------- 1 | [@@@ocaml.deprecated {| 2 | As you could guess, Deprecated_module is deprecated. 3 | Please use something else! 4 | |} ] 5 | 6 | module M: sig 7 | val x: int 8 | [@@ocaml.deprecated] 9 | 10 | type t 11 | [@@ocaml.deprecated] 12 | end 13 | [@@ocaml.deprecated] 14 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/deprecated_module.reference: -------------------------------------------------------------------------------- 1 | File "deprecated_module.ml", line 8, characters 8-11: 2 | Warning 3: deprecated: module M 3 | File "deprecated_module.ml", line 9, characters 8-9: 4 | Warning 3: deprecated: module M 5 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/deprecated_module_use.ml: -------------------------------------------------------------------------------- 1 | open Deprecated_module 2 | 3 | type s = M.t 4 | 5 | open M 6 | let _ = x 7 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/module_without_cmx.mli: -------------------------------------------------------------------------------- 1 | 2 | val id : 'a -> 'a 3 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w01.ml: -------------------------------------------------------------------------------- 1 | 2 | (* C *) 3 | 4 | let foo = ( *);; 5 | 6 | 7 | (* F *) 8 | 9 | let f x y = x;; 10 | f 1; f 1;; 11 | 12 | 13 | (* M *) 14 | 15 | (* duh *) 16 | 17 | 18 | (* P *) 19 | 20 | let 1 = 1;; 21 | 22 | 23 | (* S *) 24 | 25 | 1; 1;; 26 | 27 | 28 | (* U *) 29 | 30 | match 1 with 31 | | 1 -> () 32 | | 1 -> () 33 | | _ -> () 34 | ;; 35 | 36 | 37 | (* V *) 38 | 39 | (* re-duh *) 40 | 41 | 42 | (* X *) 43 | 44 | (* re-re *) 45 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w06.ml: -------------------------------------------------------------------------------- 1 | let foo ~bar = ignore bar (* one label *) 2 | 3 | let bar ~foo ~baz = ignore (foo, baz) (* two labels *) 4 | 5 | let () = foo 2 6 | let () = bar 4 2 7 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w06.reference: -------------------------------------------------------------------------------- 1 | File "w06.ml", line 5, characters 9-12: 2 | Warning 6: label bar was omitted in the application of this function. 3 | File "w06.ml", line 6, characters 9-12: 4 | Warning 6: labels foo, baz were omitted in the application of this function. 5 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w45.ml: -------------------------------------------------------------------------------- 1 | module T1 = struct 2 | type t = A 3 | type s = X 4 | end 5 | 6 | module T2 = struct 7 | type t = T1.t = A 8 | type s = X 9 | end 10 | 11 | module T3 = struct 12 | open T1 (* unused open *) 13 | open T2 (* shadow X, which is later used; but not A, see #6762 *) 14 | 15 | let _ = (A, X) (* X belongs to several types *) 16 | end 17 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w45.reference: -------------------------------------------------------------------------------- 1 | File "w45.ml", line 13, characters 2-9: 2 | Warning 45: this open statement shadows the constructor X (which is later used) 3 | File "w45.ml", line 15, characters 14-15: 4 | Warning 41: X belongs to several types: T2.s T1.s 5 | The first one was selected. Please disambiguate if this is wrong. 6 | File "w45.ml", line 12, characters 2-9: 7 | Warning 33: unused open T1. 8 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w50.ml: -------------------------------------------------------------------------------- 1 | module A : sig end = struct 2 | module L = List 3 | 4 | module X1 = struct end 5 | 6 | module Y1 = X1 7 | end 8 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w50.reference: -------------------------------------------------------------------------------- 1 | File "w50.ml", line 2, characters 2-17: 2 | Warning 60: unused module L. 3 | File "w50.ml", line 6, characters 2-16: 4 | Warning 60: unused module Y1. 5 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w51.ml: -------------------------------------------------------------------------------- 1 | 2 | let rec fact = function 3 | | 1 -> 1 4 | | n -> n * (fact [@tailcall]) (n-1) 5 | ;; 6 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w51.reference: -------------------------------------------------------------------------------- 1 | File "w51.ml", line 4, characters 13-37: 2 | Warning 51: expected tailcall 3 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w51_bis.ml: -------------------------------------------------------------------------------- 1 | let rec foldl op acc = function 2 | [] -> acc 3 | | x :: xs -> 4 | try (foldl [@tailcall]) op (op x acc) xs 5 | with Not_found -> assert false 6 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w51_bis.reference: -------------------------------------------------------------------------------- 1 | File "w51_bis.ml", line 4, characters 12-48: 2 | Warning 51: expected tailcall 3 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w54.ml: -------------------------------------------------------------------------------- 1 | 2 | let f = (fun x -> x) [@inline] [@inline never] 3 | let g = (fun x -> x) [@inline] [@something_else] [@ocaml.inline] 4 | 5 | let h x = (g [@inlined] [@ocaml.inlined never]) x 6 | 7 | let v = ((fun x -> x) [@inline] [@inlined]) 1 (* accepted *) 8 | 9 | let i = ((fun x -> x) [@inline]) [@@inline] 10 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w54.reference: -------------------------------------------------------------------------------- 1 | File "w54.ml", line 9, characters 0-43: 2 | Warning 54: the "inline" attribute is used more than once on this expression 3 | File "w54.ml", line 5, characters 26-39: 4 | Warning 54: the "ocaml.inlined" attribute is used more than once on this expression 5 | File "w54.ml", line 3, characters 51-63: 6 | Warning 54: the "ocaml.inline" attribute is used more than once on this expression 7 | File "w54.ml", line 2, characters 33-39: 8 | Warning 54: the "inline" attribute is used more than once on this expression 9 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w55.opt_backend.ml: -------------------------------------------------------------------------------- 1 | 2 | let f = (fun x -> x + 1) [@inline never] 3 | 4 | let g x = (f [@inlined]) x 5 | 6 | let h = ref f 7 | 8 | let i x = (!h [@inlined]) x 9 | 10 | let j x y = x + y 11 | 12 | let h x = (j [@inlined]) x 13 | 14 | let a x = 15 | let b = x + 1 in 16 | fun y -> y + b 17 | 18 | let b x y = (a [@inlined]) x y 19 | 20 | let c x = x + 1 [@@inline never] 21 | let d x = (c [@inlined]) x 22 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w55.opt_backend.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/warnings/w55.opt_backend.reference -------------------------------------------------------------------------------- /testsuite/tests/warnings/w58.opt.ml: -------------------------------------------------------------------------------- 1 | 2 | let () = print_endline (Module_without_cmx.id "Hello World") 3 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w58.opt.opt_reference: -------------------------------------------------------------------------------- 1 | File "_none_", line 1: 2 | Warning 58: no cmx file was found in path for module Module_without_cmx, and its interface was not compiled with -opaque 3 | -------------------------------------------------------------------------------- /testsuite/tests/warnings/w58.opt.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/warnings/w58.opt.reference -------------------------------------------------------------------------------- /testsuite/tests/warnings/w59.opt_backend.clambda.opt_reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/warnings/w59.opt_backend.clambda.opt_reference -------------------------------------------------------------------------------- /testsuite/tests/warnings/w59.opt_backend.reference: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modular-macros/ocaml-macros/5da92ef33e5883f250586d4fdef4324965ded499/testsuite/tests/warnings/w59.opt_backend.reference --------------------------------------------------------------------------------