summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/interactive/lib-gc/alloc.ml1
-rw-r--r--testsuite/interactive/lib-graph-2/graph_test.ml4
-rw-r--r--testsuite/lib/Makefile7
-rw-r--r--testsuite/lib/testing.ml3
-rw-r--r--testsuite/makefiles/Makefile.common16
-rw-r--r--testsuite/makefiles/Makefile.one5
-rw-r--r--testsuite/makefiles/Makefile.several9
-rw-r--r--testsuite/tests/asmcomp/Makefile7
-rw-r--r--testsuite/tests/asmcomp/amd64.S20
-rw-r--r--testsuite/tests/asmcomp/arith.cmm3
-rw-r--r--testsuite/tests/asmcomp/arm.S1
-rw-r--r--testsuite/tests/asmcomp/checkbound.cmm2
-rw-r--r--testsuite/tests/asmcomp/hppa.S108
-rw-r--r--testsuite/tests/asmcomp/i386.S3
-rw-r--r--testsuite/tests/asmcomp/i386nt.asm82
-rw-r--r--testsuite/tests/asmcomp/ia64.S2
-rw-r--r--testsuite/tests/asmcomp/m68k.S2
-rw-r--r--testsuite/tests/asmcomp/main.ml1
-rw-r--r--testsuite/tests/asmcomp/mainarith.c1
-rw-r--r--testsuite/tests/asmcomp/parsecmm.mly4
-rw-r--r--testsuite/tests/asmcomp/power-aix.S2
-rw-r--r--testsuite/tests/asmcomp/sparc.S2
-rw-r--r--testsuite/tests/asmcomp/tagged-fib.cmm1
-rw-r--r--testsuite/tests/asmcomp/tagged-integr.cmm1
-rw-r--r--testsuite/tests/basic-float/tfloat_record.ml1
-rw-r--r--testsuite/tests/basic-io-2/io.ml14
-rw-r--r--testsuite/tests/basic-more/bounds.ml2
-rw-r--r--testsuite/tests/basic-more/morematch.ml70
-rw-r--r--testsuite/tests/basic-more/tbuffer.ml1
-rw-r--r--testsuite/tests/basic-more/tbuffer.reference2
-rw-r--r--testsuite/tests/basic-more/testrandom.ml7
-rw-r--r--testsuite/tests/basic-more/testrandom.reference4
-rw-r--r--testsuite/tests/basic-more/tformat.reference2
-rw-r--r--testsuite/tests/basic-more/tprintf.ml2
-rw-r--r--testsuite/tests/basic-more/tprintf.reference2
-rw-r--r--testsuite/tests/basic/bigints.ml35
-rw-r--r--testsuite/tests/basic/boxedints.ml46
-rw-r--r--testsuite/tests/basic/boxedints.reference12
-rw-r--r--testsuite/tests/basic/equality.ml1
-rw-r--r--testsuite/tests/basic/includestruct.ml3
-rw-r--r--testsuite/tests/basic/maps.ml1
-rw-r--r--testsuite/tests/basic/patmatch.ml5
-rw-r--r--testsuite/tests/basic/patmatch.reference2
-rw-r--r--testsuite/tests/basic/recvalues.ml2
-rw-r--r--testsuite/tests/basic/tailcalls.ml2
-rw-r--r--testsuite/tests/callback/Makefile4
-rw-r--r--testsuite/tests/callback/tcallback.ml1
-rw-r--r--testsuite/tests/embedded/Makefile2
-rw-r--r--testsuite/tests/embedded/cmcaml.ml2
-rw-r--r--testsuite/tests/embedded/cmmain.c2
-rw-r--r--testsuite/tests/embedded/program.reference2
-rw-r--r--testsuite/tests/gc-roots/globrootsprim.c2
-rw-r--r--testsuite/tests/letrec/backreferences.reference (renamed from testsuite/tests/letrec/backreferences.result)0
-rw-r--r--testsuite/tests/letrec/class_1.reference (renamed from testsuite/tests/letrec/class_1.result)0
-rw-r--r--testsuite/tests/letrec/float_block_2.reference (renamed from testsuite/tests/letrec/float_block_2.result)0
-rw-r--r--testsuite/tests/letrec/lists.reference (renamed from testsuite/tests/letrec/lists.result)0
-rw-r--r--testsuite/tests/letrec/mixing_value_closures_1.reference (renamed from testsuite/tests/letrec/mixing_value_closures_1.result)0
-rw-r--r--testsuite/tests/letrec/mixing_value_closures_2.reference (renamed from testsuite/tests/letrec/mixing_value_closures_2.result)0
-rw-r--r--testsuite/tests/letrec/mutual_functions.reference (renamed from testsuite/tests/letrec/mutual_functions.result)0
-rw-r--r--testsuite/tests/lib-bigarray-2/bigarrf.f1
-rw-r--r--testsuite/tests/lib-bigarray-2/bigarrfml.ml1
-rw-r--r--testsuite/tests/lib-bigarray-2/bigarrfstub.c1
-rw-r--r--testsuite/tests/lib-bigarray/bigarrays.ml16
-rw-r--r--testsuite/tests/lib-bigarray/fftba.ml33
-rw-r--r--testsuite/tests/lib-bigarray/pr5115.ml1
-rw-r--r--testsuite/tests/lib-digest/md5.ml2
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/.ignore2
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/Makefile11
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/custom.reference2
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/main.ml34
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/main.reference8
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/plug1.ml3
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/plug2.ml3
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/registry.ml7
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/static.reference2
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/stub1.c2
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/stub2.c4
-rw-r--r--testsuite/tests/lib-dynlink-csharp/Makefile8
-rw-r--r--testsuite/tests/lib-dynlink-csharp/bytecode.reference2
-rwxr-xr-xtestsuite/tests/lib-dynlink-csharp/main.cs2
-rwxr-xr-xtestsuite/tests/lib-dynlink-csharp/main.ml3
-rw-r--r--testsuite/tests/lib-dynlink-csharp/native.reference2
-rwxr-xr-xtestsuite/tests/lib-dynlink-csharp/plugin.ml2
-rw-r--r--testsuite/tests/lib-dynlink-native/.ignore2
-rw-r--r--testsuite/tests/lib-dynlink-native/Makefile2
-rw-r--r--testsuite/tests/lib-dynlink-native/api.ml4
-rwxr-xr-xtestsuite/tests/lib-dynlink-native/b.ml1
-rw-r--r--testsuite/tests/lib-dynlink-native/bug.ml2
-rw-r--r--testsuite/tests/lib-dynlink-native/main.ml30
-rw-r--r--testsuite/tests/lib-dynlink-native/packed1.ml1
-rw-r--r--testsuite/tests/lib-dynlink-native/plugin.ml3
-rw-r--r--testsuite/tests/lib-dynlink-native/plugin2.ml4
-rw-r--r--testsuite/tests/lib-dynlink-native/plugin4.ml2
-rw-r--r--testsuite/tests/lib-dynlink-native/plugin_ref.ml5
-rw-r--r--testsuite/tests/lib-dynlink-native/plugin_thread.ml16
-rw-r--r--testsuite/tests/lib-dynlink-native/reference13
-rw-r--r--testsuite/tests/lib-dynlink-native/sub/plugin.ml1
-rw-r--r--testsuite/tests/lib-dynlink-native/sub/plugin3.ml1
-rw-r--r--testsuite/tests/lib-hashtbl/hfun.ml9
-rw-r--r--testsuite/tests/lib-hashtbl/htbl.ml2
-rw-r--r--testsuite/tests/lib-marshal/intext.ml104
-rw-r--r--testsuite/tests/lib-marshal/intext.reference23
-rw-r--r--testsuite/tests/lib-marshal/intextaux.c2
-rw-r--r--testsuite/tests/lib-num/test_big_ints.ml129
-rw-r--r--testsuite/tests/lib-num/test_nats.ml8
-rw-r--r--testsuite/tests/lib-num/test_nums.ml44
-rw-r--r--testsuite/tests/lib-printf/Makefile7
-rw-r--r--testsuite/tests/lib-printf/tprintf.ml468
-rw-r--r--testsuite/tests/lib-printf/tprintf.reference89
-rw-r--r--testsuite/tests/lib-scanf-2/Makefile3
-rw-r--r--testsuite/tests/lib-scanf/.ignore1
-rw-r--r--testsuite/tests/lib-scanf/tscanf.ml22
-rw-r--r--testsuite/tests/lib-scanf/tscanf.reference2
-rw-r--r--testsuite/tests/lib-scanf/tscanf_data1
-rw-r--r--testsuite/tests/lib-set/testmap.ml3
-rw-r--r--testsuite/tests/lib-set/testset.ml3
-rw-r--r--testsuite/tests/lib-str/t01.ml6
-rw-r--r--testsuite/tests/lib-stream/Makefile4
-rw-r--r--testsuite/tests/lib-stream/count_concat_bug.ml57
-rw-r--r--testsuite/tests/lib-stream/count_concat_bug.reference2
-rw-r--r--testsuite/tests/lib-systhreads/testfork.ml4
-rw-r--r--testsuite/tests/lib-threads/test1.checker2
-rw-r--r--testsuite/tests/lib-threads/test3.runner2
-rw-r--r--testsuite/tests/lib-threads/test4.checker2
-rw-r--r--testsuite/tests/lib-threads/test4.runner2
-rw-r--r--testsuite/tests/lib-threads/test5.checker2
-rw-r--r--testsuite/tests/lib-threads/test5.runner2
-rw-r--r--testsuite/tests/lib-threads/test6.checker2
-rw-r--r--testsuite/tests/lib-threads/test7.checker2
-rw-r--r--testsuite/tests/lib-threads/testA.checker2
-rw-r--r--testsuite/tests/lib-threads/testexit.checker2
-rw-r--r--testsuite/tests/lib-threads/testsignal.checker2
-rw-r--r--testsuite/tests/lib-threads/testsignal.runner2
-rw-r--r--testsuite/tests/lib-threads/testsignal2.runner2
-rw-r--r--testsuite/tests/lib-threads/torture.ml4
-rw-r--r--testsuite/tests/lib-threads/torture.reference2
-rw-r--r--testsuite/tests/lib-threads/torture.runner2
-rw-r--r--testsuite/tests/misc-kb/equations.ml5
-rw-r--r--testsuite/tests/misc-kb/equations.mli2
-rw-r--r--testsuite/tests/misc-kb/kb.ml7
-rw-r--r--testsuite/tests/misc-kb/kbmain.ml3
-rw-r--r--testsuite/tests/misc-kb/orderings.ml11
-rw-r--r--testsuite/tests/misc-kb/orderings.mli2
-rw-r--r--testsuite/tests/misc-kb/terms.ml8
-rw-r--r--testsuite/tests/misc-kb/terms.mli2
-rw-r--r--testsuite/tests/misc-unsafe/almabench.ml74
-rw-r--r--testsuite/tests/misc-unsafe/fft.ml33
-rw-r--r--testsuite/tests/misc/bdd.ml42
-rw-r--r--testsuite/tests/misc/boyer.ml350
-rw-r--r--testsuite/tests/misc/fib.ml3
-rw-r--r--testsuite/tests/misc/nucleic.ml34
-rw-r--r--testsuite/tests/misc/sieve.ml2
-rw-r--r--testsuite/tests/misc/sieve.reference2
-rw-r--r--testsuite/tests/misc/takc.ml1
-rw-r--r--testsuite/tests/prim-revapply/Makefile4
-rw-r--r--testsuite/tests/prim-revapply/apply.ml36
-rw-r--r--testsuite/tests/prim-revapply/apply.reference10
-rw-r--r--testsuite/tests/prim-revapply/revapply.ml18
-rw-r--r--testsuite/tests/prim-revapply/revapply.reference5
-rw-r--r--testsuite/tests/regression/pr5233/Makefile4
-rw-r--r--testsuite/tests/regression/pr5233/pr5233.ml50
-rw-r--r--testsuite/tests/regression/pr5233/pr5233.reference2
-rw-r--r--testsuite/tests/tool-lexyacc/gram_aux.ml1
-rw-r--r--testsuite/tests/tool-lexyacc/grammar.mly3
-rw-r--r--testsuite/tests/tool-lexyacc/input54
-rw-r--r--testsuite/tests/tool-lexyacc/input.ml1
-rw-r--r--testsuite/tests/tool-lexyacc/lexgen.ml5
-rw-r--r--testsuite/tests/tool-lexyacc/main.reference1
-rw-r--r--testsuite/tests/tool-lexyacc/output.ml7
-rw-r--r--testsuite/tests/tool-lexyacc/scan_aux.ml1
-rw-r--r--testsuite/tests/tool-lexyacc/scanner.mll54
-rw-r--r--testsuite/tests/tool-ocamldoc/Makefile5
-rw-r--r--testsuite/tests/tool-ocamldoc/odoc_test.ml100
-rw-r--r--testsuite/tests/tool-ocamldoc/t01.ml2
-rw-r--r--testsuite/tests/tool-ocamldoc/t03.ml2
-rw-r--r--testsuite/tests/typing-fstclassmod/fstclassmod.ml1
-rw-r--r--testsuite/tests/typing-gadts/Makefile6
-rw-r--r--testsuite/tests/typing-gadts/dynamic_frisch.ml24
-rw-r--r--testsuite/tests/typing-gadts/pr5689.ml74
-rw-r--r--testsuite/tests/typing-gadts/pr5689.ml.principal.reference28
-rw-r--r--testsuite/tests/typing-gadts/pr5689.ml.reference28
-rw-r--r--testsuite/tests/typing-gadts/test.ml123
-rw-r--r--testsuite/tests/typing-gadts/test.ml.principal.reference37
-rw-r--r--testsuite/tests/typing-gadts/test.ml.reference35
-rw-r--r--testsuite/tests/typing-implicit_unpack/Makefile1
-rw-r--r--testsuite/tests/typing-implicit_unpack/implicit_unpack.ml2
-rw-r--r--testsuite/tests/typing-implicit_unpack/implicit_unpack.ml.reference6
-rw-r--r--testsuite/tests/typing-modules-bugs/pr5164_ok.ml2
-rw-r--r--testsuite/tests/typing-modules/Makefile1
-rw-r--r--testsuite/tests/typing-modules/Test.ml29
-rw-r--r--testsuite/tests/typing-modules/Test.ml.principal.reference32
-rw-r--r--testsuite/tests/typing-modules/Test.ml.reference32
-rw-r--r--testsuite/tests/typing-objects-bugs/pr3968_bad.ml10
-rw-r--r--testsuite/tests/typing-objects-bugs/pr4018_bad.ml2
-rw-r--r--testsuite/tests/typing-objects-bugs/pr4766_ok.ml8
-rw-r--r--testsuite/tests/typing-objects-bugs/yamagata021012_ok.ml10
-rw-r--r--testsuite/tests/typing-objects/Exemples.ml2
-rw-r--r--testsuite/tests/typing-objects/Exemples.ml.principal.reference358
-rw-r--r--testsuite/tests/typing-objects/Exemples.ml.reference2
-rw-r--r--testsuite/tests/typing-objects/Makefile1
-rw-r--r--testsuite/tests/typing-objects/Tests.ml2
-rw-r--r--testsuite/tests/typing-objects/Tests.ml.principal.reference302
-rw-r--r--testsuite/tests/typing-objects/Tests.ml.reference14
-rw-r--r--testsuite/tests/typing-objects/pr5619_bad.ml29
-rw-r--r--testsuite/tests/typing-objects/pr5619_bad.ml.principal.reference18
-rw-r--r--testsuite/tests/typing-objects/pr5619_bad.ml.reference18
-rw-r--r--testsuite/tests/typing-poly-bugs/pr5322_ok.ml1
-rw-r--r--testsuite/tests/typing-poly/Makefile1
-rw-r--r--testsuite/tests/typing-poly/poly.ml22
-rw-r--r--testsuite/tests/typing-poly/poly.ml.principal.reference17
-rw-r--r--testsuite/tests/typing-poly/poly.ml.reference30
-rw-r--r--testsuite/tests/typing-polyvariants-bugs/pr5057_ok.ml2
-rw-r--r--testsuite/tests/typing-polyvariants-bugs/pr5057a_bad.ml2
-rw-r--r--testsuite/tests/typing-private-bugs/pr5026_bad.ml2
-rw-r--r--testsuite/tests/typing-private/Makefile1
-rw-r--r--testsuite/tests/typing-private/private.ml6
-rw-r--r--testsuite/tests/typing-private/private.ml.reference6
-rw-r--r--testsuite/tests/typing-recmod/t02bad.ml1
-rw-r--r--testsuite/tests/typing-recmod/t08bad.ml1
-rw-r--r--testsuite/tests/typing-recmod/t13ok.ml2
-rw-r--r--testsuite/tests/typing-recmod/t14bad.ml2
-rw-r--r--testsuite/tests/typing-recmod/t16ok.ml1
-rw-r--r--testsuite/tests/typing-recmod/t17ok.ml5
-rw-r--r--testsuite/tests/typing-recmod/t18ok.ml3
-rw-r--r--testsuite/tests/typing-recmod/t19ok.ml1
-rw-r--r--testsuite/tests/typing-recmod/t22ok.ml20
-rw-r--r--testsuite/tests/typing-signatures/Makefile1
-rw-r--r--testsuite/tests/typing-signatures/els.ml4
-rw-r--r--testsuite/tests/typing-sigsubst/Makefile1
-rw-r--r--testsuite/tests/typing-sigsubst/sigsubst.ml5
-rw-r--r--testsuite/tests/typing-sigsubst/sigsubst.ml.reference4
-rw-r--r--testsuite/tests/typing-typeparam/Makefile6
-rw-r--r--testsuite/tests/typing-typeparam/newtype.ml13
-rw-r--r--testsuite/tests/typing-typeparam/newtype.ml.reference19
-rw-r--r--testsuite/tests/typing-typeparam/newtype.reference5
235 files changed, 3027 insertions, 1124 deletions
diff --git a/testsuite/interactive/lib-gc/alloc.ml b/testsuite/interactive/lib-gc/alloc.ml
index dbcb3e4fda..24a568caaf 100644
--- a/testsuite/interactive/lib-gc/alloc.ml
+++ b/testsuite/interactive/lib-gc/alloc.ml
@@ -48,4 +48,3 @@ let argspecs = [
Arg.parse argspecs (fun _ -> ()) "Usage: alloc [-c]";;
main ();;
-
diff --git a/testsuite/interactive/lib-graph-2/graph_test.ml b/testsuite/interactive/lib-graph-2/graph_test.ml
index 39b845675d..6c9fd49ac6 100644
--- a/testsuite/interactive/lib-graph-2/graph_test.ml
+++ b/testsuite/interactive/lib-graph-2/graph_test.ml
@@ -27,7 +27,7 @@ let sz = 450;;
open_graph (Printf.sprintf " %ix%i" sz sz);;
-(* To be defined for older versions of O'Caml
+(* To be defined for older versions of OCaml
Lineto, moveto and draw_rect.
let rlineto x y =
@@ -150,7 +150,7 @@ let x,y = current_point () in
fill_rect x (y - 5) (8 * 20) 25;;
set_color yellow;;
go_legend ();;
-draw_string "Graphics (Caml)";;
+draw_string "Graphics (OCaml)";;
(* Pie parts in different colors. *)
let draw_green_string s = set_color green; draw_string s;;
diff --git a/testsuite/lib/Makefile b/testsuite/lib/Makefile
index c73bea508f..b6fc63c207 100644
--- a/testsuite/lib/Makefile
+++ b/testsuite/lib/Makefile
@@ -1,9 +1,14 @@
# $Id$
-compile: testing.cmi testing.cmo testing.cmx
+compile: compile-targets
promote: defaultpromote
clean: defaultclean
include ../makefiles/Makefile.common
+
+compile-targets: testing.cmi testing.cmo
+ @if [ -z "$(BYTECODE_ONLY)" ]; then \
+ $(MAKE) testing.cmx; \
+ fi
diff --git a/testsuite/lib/testing.ml b/testsuite/lib/testing.ml
index aa8933a789..4b49cfc0a1 100644
--- a/testsuite/lib/testing.ml
+++ b/testsuite/lib/testing.ml
@@ -30,7 +30,7 @@ at_exit finish;;
let test_num = ref (-1);;
let print_test_number () =
- print_int !test_num; print_string " "; flush stdout;;
+ print_string " "; print_int !test_num; flush stdout;;
let next_test () =
incr test_num;
@@ -93,4 +93,3 @@ let any_failure_test = test_raises_some_failure;;
let scan_failure_test f x =
test_raises_exc_p (function Scan_failure _ -> true | _ -> false) f x;;
-
diff --git a/testsuite/makefiles/Makefile.common b/testsuite/makefiles/Makefile.common
index e1b15dbace..c7da5b7058 100644
--- a/testsuite/makefiles/Makefile.common
+++ b/testsuite/makefiles/Makefile.common
@@ -7,16 +7,16 @@ include $(TOPDIR)/config/Makefile
DIFF=diff -q
BOOTDIR=$(TOPDIR)/boot
OCAMLRUN=$(BOOTDIR)/ocamlrun$(EXE)
-OCAML=$(OCAMLRUN) $(TOPDIR)/ocaml$(EXE) -I $(TOPDIR)/stdlib
-OCAMLC=$(OCAMLRUN) $(TOPDIR)/ocamlc$(EXE) -I $(TOPDIR)/stdlib
-OCAMLOPT=$(OCAMLRUN) $(TOPDIR)/ocamlopt$(EXE) -I $(TOPDIR)/stdlib
-OCAMLDOC=$(OCAMLRUN) $(TOPDIR)/ocamldoc/ocamldoc$(EXE)
-OCAMLLEX=$(OCAMLRUN) $(TOPDIR)/lex/ocamllex$(EXE)
-OCAMLMKLIB=$(OCAMLRUN) $(TOPDIR)/tools/ocamlmklib$(EXE)
+OCAML=$(OCAMLRUN) $(TOPDIR)/ocaml -I $(TOPDIR)/stdlib
+OCAMLC=$(OCAMLRUN) $(TOPDIR)/ocamlc -I $(TOPDIR)/stdlib
+OCAMLOPT=$(OCAMLRUN) $(TOPDIR)/ocamlopt -I $(TOPDIR)/stdlib
+OCAMLDOC=$(OCAMLRUN) $(TOPDIR)/ocamldoc/ocamldoc
+OCAMLLEX=$(OCAMLRUN) $(TOPDIR)/lex/ocamllex
+OCAMLMKLIB=$(OCAMLRUN) $(TOPDIR)/tools/ocamlmklib
OCAMLYACC=$(TOPDIR)/yacc/ocamlyacc$(EXE)
OCAMLBUILD=$(TOPDIR)/_build/ocamlbuild/ocamlbuild.native
-DUMPOBJ=$(OCAMLRUN) $(TOPDIR)/tool/dumpobj$(EXE)
-BYTECODE_ONLY=`if [ "$(ASM)" = "none" ]; then echo 'YES'; else echo ''; fi`
+DUMPOBJ=$(OCAMLRUN) $(TOPDIR)/tool/dumpobj
+BYTECODE_ONLY=`if [ "$(ARCH)" = "none" -o "$(ASM)" = "none" ]; then echo 'YES'; else echo ''; fi`
#COMPFLAGS=
#FORTRAN_COMPILER=
#FORTRAN_LIBRARY=
diff --git a/testsuite/makefiles/Makefile.one b/testsuite/makefiles/Makefile.one
index ca07bf16da..5c8e365e38 100644
--- a/testsuite/makefiles/Makefile.one
+++ b/testsuite/makefiles/Makefile.one
@@ -20,12 +20,15 @@ ADD_CFLAGS+=$(CUSTOM_FLAG)
default: compile run
-compile: $(ML_FILES) $(CMO_FILES) $(CMX_FILES) $(MAIN_MODULE).cmo $(MAIN_MODULE).cmx
+compile: $(ML_FILES) $(CMO_FILES) $(MAIN_MODULE).cmo
@for file in $(C_FILES); do \
$(NATIVECC) $(NATIVECCCOMPOPTS) -c -I$(TOPDIR)/byterun $$file.c; \
done;
+ @rm -f program.byte program.byte.exe
@$(OCAMLC) $(ADD_COMPFLAGS) $(ADD_CFLAGS) -o program.byte $(O_FILES) $(CMA_FILES) $(CMO_FILES) $(ADD_CMO_FILES) $(MAIN_MODULE).cmo
@if [ -z "$(BYTECODE_ONLY)" ]; then \
+ rm -f program.native program.native.exe; \
+ $(MAKE) $(CMX_FILES) $(MAIN_MODULE).cmx; \
$(OCAMLOPT) $(ADD_COMPFLAGS) -o program.native $(O_FILES) $(CMXA_FILES) $(CMX_FILES) $(ADD_CMX_FILES) $(MAIN_MODULE).cmx; \
fi
diff --git a/testsuite/makefiles/Makefile.several b/testsuite/makefiles/Makefile.several
index e5bd430a1c..af81182253 100644
--- a/testsuite/makefiles/Makefile.several
+++ b/testsuite/makefiles/Makefile.several
@@ -41,19 +41,20 @@ run-all:
run-file:
@printf " $(DESC)"
+ @rm -f program program.exe
@$(COMP) $(COMPFLAGS) $(FILE) -o program
@if [ -f `basename $(FILE) ml`runner ]; then \
sh `basename $(FILE) ml`runner; \
else \
./program $(PROGRAM_ARGS) > `basename $(FILE) ml`result; \
- fi
+ fi || (echo " => failed" && exit 1)
@if [ -f `basename $(FILE) ml`checker ]; then \
sh `basename $(FILE) ml`checker; \
else \
- $(DIFF) `basename $(FILE) ml`reference `basename $(FILE) ml`result > /dev/null || (echo " => failed" && exit 1); \
- fi
+ $(DIFF) `basename $(FILE) ml`reference `basename $(FILE) ml`result > /dev/null; \
+ fi || (echo " => failed" && exit 1)
promote: defaultpromote
clean: defaultclean
- @rm -f *.result ./program
+ @rm -f *.result ./program program.exe
diff --git a/testsuite/tests/asmcomp/Makefile b/testsuite/tests/asmcomp/Makefile
index 2161b856e4..8143873d65 100644
--- a/testsuite/tests/asmcomp/Makefile
+++ b/testsuite/tests/asmcomp/Makefile
@@ -1,4 +1,5 @@
BASEDIR=../..
+
CC=$(NATIVECC)
CFLAGS=$(NATIVECCCOMPOPTS) -g
@@ -33,6 +34,7 @@ OTHEROBJS=\
$(TOPDIR)/typing/subst.cmo \
$(TOPDIR)/typing/predef.cmo \
$(TOPDIR)/typing/datarepr.cmo \
+ $(TOPDIR)/typing/cmi_format.cmo \
$(TOPDIR)/typing/env.cmo \
$(TOPDIR)/typing/typedtree.cmo \
$(TOPDIR)/typing/ctype.cmo \
@@ -43,6 +45,7 @@ OTHEROBJS=\
$(TOPDIR)/typing/includemod.cmo \
$(TOPDIR)/typing/parmatch.cmo \
$(TOPDIR)/typing/typetexp.cmo \
+ $(TOPDIR)/typing/cmt_format.cmo \
$(TOPDIR)/typing/stypes.cmo \
$(TOPDIR)/typing/typecore.cmo \
$(TOPDIR)/typing/typedecl.cmo \
@@ -139,11 +142,11 @@ clean: defaultclean
@rm -f parsecmm.ml parsecmm.mli lexcmm.ml
@rm -f $(CASES:=.s)
+include $(BASEDIR)/makefiles/Makefile.common
+
power.o: power-$(SYSTEM).o
@cp power-$(SYSTEM).o power.o
promote:
-include $(BASEDIR)/makefiles/Makefile.common
-
arch: $(ARCH).o
diff --git a/testsuite/tests/asmcomp/amd64.S b/testsuite/tests/asmcomp/amd64.S
index 26db8722a9..57229e09a4 100644
--- a/testsuite/tests/asmcomp/amd64.S
+++ b/testsuite/tests/asmcomp/amd64.S
@@ -39,12 +39,12 @@ CALL_GEN_CODE:
pushq %r13
pushq %r14
pushq %r15
- movq %rdi, %r10
- movq %rsi, %rax
- movq %rdx, %rbx
- movq %rcx, %rdi
- movq %r8, %rsi
- call *%r10
+ movq %rdi, %r10
+ movq %rsi, %rax
+ movq %rdx, %rbx
+ movq %rcx, %rdi
+ movq %r8, %rsi
+ call *%r10
popq %r15
popq %r14
popq %r13
@@ -59,17 +59,17 @@ CAML_C_CALL:
jmp *%rax
#ifdef SYS_macosx
- .literal16
+ .literal16
#else
- .section .rodata.cst8,"aM",@progbits,8
+ .section .rodata.cst8,"aM",@progbits,8
#endif
.globl CAML_NEGF_MASK
.align ALIGN
CAML_NEGF_MASK:
- .quad 0x8000000000000000, 0
+ .quad 0x8000000000000000, 0
.globl CAML_ABSF_MASK
.align ALIGN
CAML_ABSF_MASK:
- .quad 0x7FFFFFFFFFFFFFFF, 0
+ .quad 0x7FFFFFFFFFFFFFFF, 0
.comm young_limit, 8
diff --git a/testsuite/tests/asmcomp/arith.cmm b/testsuite/tests/asmcomp/arith.cmm
index a8bc613c77..b29812957a 100644
--- a/testsuite/tests/asmcomp/arith.cmm
+++ b/testsuite/tests/asmcomp/arith.cmm
@@ -217,6 +217,3 @@
(floataset d 38 (absf f))
)))))))
-
-
-
diff --git a/testsuite/tests/asmcomp/arm.S b/testsuite/tests/asmcomp/arm.S
index 0fd1a29fe6..8fab5ae92f 100644
--- a/testsuite/tests/asmcomp/arm.S
+++ b/testsuite/tests/asmcomp/arm.S
@@ -37,4 +37,3 @@ call_gen_code:
caml_c_call:
@ function to call is in r10
mov pc, r10
-
diff --git a/testsuite/tests/asmcomp/checkbound.cmm b/testsuite/tests/asmcomp/checkbound.cmm
index c20740c113..62828bd350 100644
--- a/testsuite/tests/asmcomp/checkbound.cmm
+++ b/testsuite/tests/asmcomp/checkbound.cmm
@@ -17,5 +17,3 @@
(function "checkbound1" (x: int)
(checkbound x 2))
-
-
diff --git a/testsuite/tests/asmcomp/hppa.S b/testsuite/tests/asmcomp/hppa.S
index 02f457dc75..ff3d66d59f 100644
--- a/testsuite/tests/asmcomp/hppa.S
+++ b/testsuite/tests/asmcomp/hppa.S
@@ -32,13 +32,13 @@
#endif
#ifdef SYS_hpux
- .space $PRIVATE$
- .subspa $DATA$,quad=1,align=8,access=31
- .subspa $BSS$,quad=1,align=8,access=31,zero,sort=82
- .space $TEXT$
- .subspa $LIT$,quad=0,align=8,access=44
- .subspa $CODE$,quad=0,align=8,access=44,code_only
- .import $global$, data
+ .space $PRIVATE$
+ .subspa $DATA$,quad=1,align=8,access=31
+ .subspa $BSS$,quad=1,align=8,access=31,zero,sort=82
+ .space $TEXT$
+ .subspa $LIT$,quad=0,align=8,access=44
+ .subspa $CODE$,quad=0,align=8,access=44,code_only
+ .import $global$, data
.import $$dyncall, millicode
#endif
@@ -47,8 +47,8 @@
EXPORT_CODE(G(call_gen_code))
G(call_gen_code):
STARTPROC
- stw %r2,-20(%r30)
- ldo 256(%r30), %r30
+ stw %r2,-20(%r30)
+ ldo 256(%r30), %r30
; Save the callee-save registers
ldo -32(%r30), %r1
stws,ma %r3, -4(%r1)
@@ -67,26 +67,26 @@ G(call_gen_code):
stws,ma %r16, -4(%r1)
stws,ma %r17, -4(%r1)
stws,ma %r18, -4(%r1)
- fstds,ma %fr12, -8(%r1)
- fstds,ma %fr13, -8(%r1)
- fstds,ma %fr14, -8(%r1)
- fstds,ma %fr15, -8(%r1)
- fstds,ma %fr16, -8(%r1)
- fstds,ma %fr17, -8(%r1)
- fstds,ma %fr18, -8(%r1)
- fstds,ma %fr19, -8(%r1)
- fstds,ma %fr20, -8(%r1)
- fstds,ma %fr21, -8(%r1)
- fstds,ma %fr22, -8(%r1)
- fstds,ma %fr23, -8(%r1)
- fstds,ma %fr24, -8(%r1)
- fstds,ma %fr25, -8(%r1)
- fstds,ma %fr26, -8(%r1)
- fstds,ma %fr27, -8(%r1)
- fstds,ma %fr28, -8(%r1)
- fstds,ma %fr29, -8(%r1)
- fstds,ma %fr30, -8(%r1)
- fstds,ma %fr31, -8(%r1)
+ fstds,ma %fr12, -8(%r1)
+ fstds,ma %fr13, -8(%r1)
+ fstds,ma %fr14, -8(%r1)
+ fstds,ma %fr15, -8(%r1)
+ fstds,ma %fr16, -8(%r1)
+ fstds,ma %fr17, -8(%r1)
+ fstds,ma %fr18, -8(%r1)
+ fstds,ma %fr19, -8(%r1)
+ fstds,ma %fr20, -8(%r1)
+ fstds,ma %fr21, -8(%r1)
+ fstds,ma %fr22, -8(%r1)
+ fstds,ma %fr23, -8(%r1)
+ fstds,ma %fr24, -8(%r1)
+ fstds,ma %fr25, -8(%r1)
+ fstds,ma %fr26, -8(%r1)
+ fstds,ma %fr27, -8(%r1)
+ fstds,ma %fr28, -8(%r1)
+ fstds,ma %fr29, -8(%r1)
+ fstds,ma %fr30, -8(%r1)
+ fstds,ma %fr31, -8(%r1)
; Shuffle the arguments and call
copy %r26, %r22
@@ -121,42 +121,42 @@ G(call_gen_code):
ldws,ma -4(%r1), %r16
ldws,ma -4(%r1), %r17
ldws,ma -4(%r1), %r18
- fldds,ma -8(%r1), %fr12
- fldds,ma -8(%r1), %fr13
- fldds,ma -8(%r1), %fr14
- fldds,ma -8(%r1), %fr15
- fldds,ma -8(%r1), %fr16
- fldds,ma -8(%r1), %fr17
- fldds,ma -8(%r1), %fr18
- fldds,ma -8(%r1), %fr19
- fldds,ma -8(%r1), %fr20
- fldds,ma -8(%r1), %fr21
- fldds,ma -8(%r1), %fr22
- fldds,ma -8(%r1), %fr23
- fldds,ma -8(%r1), %fr24
- fldds,ma -8(%r1), %fr25
- fldds,ma -8(%r1), %fr26
- fldds,ma -8(%r1), %fr27
- fldds,ma -8(%r1), %fr28
- fldds,ma -8(%r1), %fr29
- fldds,ma -8(%r1), %fr30
- fldds,ma -8(%r1), %fr31
+ fldds,ma -8(%r1), %fr12
+ fldds,ma -8(%r1), %fr13
+ fldds,ma -8(%r1), %fr14
+ fldds,ma -8(%r1), %fr15
+ fldds,ma -8(%r1), %fr16
+ fldds,ma -8(%r1), %fr17
+ fldds,ma -8(%r1), %fr18
+ fldds,ma -8(%r1), %fr19
+ fldds,ma -8(%r1), %fr20
+ fldds,ma -8(%r1), %fr21
+ fldds,ma -8(%r1), %fr22
+ fldds,ma -8(%r1), %fr23
+ fldds,ma -8(%r1), %fr24
+ fldds,ma -8(%r1), %fr25
+ fldds,ma -8(%r1), %fr26
+ fldds,ma -8(%r1), %fr27
+ fldds,ma -8(%r1), %fr28
+ fldds,ma -8(%r1), %fr29
+ fldds,ma -8(%r1), %fr30
+ fldds,ma -8(%r1), %fr31
- ldo -256(%r30), %r30
- ldw -20(%r30), %r2
+ ldo -256(%r30), %r30
+ ldw -20(%r30), %r2
bv 0(%r2)
nop
ENDPROC
- .align CODE_ALIGN
- EXPORT_CODE(caml_c_call)
+ .align CODE_ALIGN
+ EXPORT_CODE(caml_c_call)
G(caml_c_call):
STARTPROC
#ifdef SYS_hpux
bl $$dyncall, %r0
nop
#else
- bv 0(%r22)
+ bv 0(%r22)
nop
#endif
ENDPROC
diff --git a/testsuite/tests/asmcomp/i386.S b/testsuite/tests/asmcomp/i386.S
index fc75b1f1f8..94e44c773f 100644
--- a/testsuite/tests/asmcomp/i386.S
+++ b/testsuite/tests/asmcomp/i386.S
@@ -15,7 +15,8 @@
/* Linux with ELF binaries does not prefix identifiers with _.
Linux with a.out binaries, FreeBSD, and NextStep do. */
-#ifdef SYS_linux_elf
+#if defined(SYS_linux_elf) || defined(SYS_bsd_elf) \
+ || defined(SYS_solaris) || defined(SYS_beos) || defined(SYS_gnu)
#define G(x) x
#define FUNCTION_ALIGN 16
#else
diff --git a/testsuite/tests/asmcomp/i386nt.asm b/testsuite/tests/asmcomp/i386nt.asm
index 75ae8ce737..80af32ffd0 100644
--- a/testsuite/tests/asmcomp/i386nt.asm
+++ b/testsuite/tests/asmcomp/i386nt.asm
@@ -1,67 +1,67 @@
-;*********************************************************************
-;
-; OCaml
-;
-; Xavier Leroy, projet Cristal, INRIA Rocquencourt
-;
-; Copyright 1996 Institut National de Recherche en Informatique et
-; en Automatique. All rights reserved. This file is distributed
-; under the terms of the Q Public License version 1.0.
-;
-;*********************************************************************
+;*********************************************************************;
+; ;
+; OCaml ;
+; ;
+; Xavier Leroy, projet Cristal, INRIA Rocquencourt ;
+; ;
+; Copyright 1996 Institut National de Recherche en Informatique et ;
+; en Automatique. All rights reserved. This file is distributed ;
+; under the terms of the Q Public License version 1.0. ;
+; ;
+;*********************************************************************;
; $Id$
- .386
- .MODEL FLAT
+ .386
+ .MODEL FLAT
.CODE
PUBLIC _call_gen_code
ALIGN 4
_call_gen_code:
- push ebp
- mov ebp, esp
- push ebx
- push esi
- push edi
- mov eax, [ebp+12]
- mov ebx, [ebp+16]
- mov ecx, [ebp+20]
- mov edx, [ebp+24]
- call DWORD PTR [ebp+8]
- pop edi
- pop esi
- pop ebx
- pop ebp
- ret
+ push ebp
+ mov ebp, esp
+ push ebx
+ push esi
+ push edi
+ mov eax, [ebp+12]
+ mov ebx, [ebp+16]
+ mov ecx, [ebp+20]
+ mov edx, [ebp+24]
+ call DWORD PTR [ebp+8]
+ pop edi
+ pop esi
+ pop ebx
+ pop ebp
+ ret
PUBLIC _caml_c_call
ALIGN 4
_caml_c_call:
- ffree st(0)
- ffree st(1)
- ffree st(2)
- ffree st(3)
- jmp eax
+ ffree st(0)
+ ffree st(1)
+ ffree st(2)
+ ffree st(3)
+ jmp eax
PUBLIC _caml_call_gc
PUBLIC _caml_alloc
PUBLIC _caml_alloc1
PUBLIC _caml_alloc2
- PUBLIC _caml_alloc3
+ PUBLIC _caml_alloc3
_caml_call_gc:
_caml_alloc:
_caml_alloc1:
_caml_alloc2:
_caml_alloc3:
- int 3
+ int 3
.DATA
- PUBLIC _caml_exception_pointer
-_caml_exception_pointer dword 0
- PUBLIC _young_ptr
-_young_ptr dword 0
- PUBLIC _young_limit
-_young_limit dword 0
+ PUBLIC _caml_exception_pointer
+_caml_exception_pointer dword 0
+ PUBLIC _young_ptr
+_young_ptr dword 0
+ PUBLIC _young_limit
+_young_limit dword 0
END
diff --git a/testsuite/tests/asmcomp/ia64.S b/testsuite/tests/asmcomp/ia64.S
index 68d649b531..028c622f9d 100644
--- a/testsuite/tests/asmcomp/ia64.S
+++ b/testsuite/tests/asmcomp/ia64.S
@@ -26,7 +26,7 @@
.proc call_gen_code#
call_gen_code:
- /* Allocate 64 "out" registers (for the Caml code) and no locals */
+ /* Allocate 64 "out" registers (for the OCaml code) and no locals */
alloc r3 = ar.pfs, 0, 0, 64, 0
/* Save PFS, return address and GP on stack */
diff --git a/testsuite/tests/asmcomp/m68k.S b/testsuite/tests/asmcomp/m68k.S
index f15ddcbb40..f24ff404e7 100644
--- a/testsuite/tests/asmcomp/m68k.S
+++ b/testsuite/tests/asmcomp/m68k.S
@@ -19,7 +19,7 @@
| int * int * address -> void
| int * int -> void
| unit -> unit
-| Hence arg1 -> d0, arg2 -> d1, arg3 -> a0,
+| Hence arg1 -> d0, arg2 -> d1, arg3 -> a0,
| and we need a special case for int -> double
.text
diff --git a/testsuite/tests/asmcomp/main.ml b/testsuite/tests/asmcomp/main.ml
index 0555daed8d..09539f9353 100644
--- a/testsuite/tests/asmcomp/main.ml
+++ b/testsuite/tests/asmcomp/main.ml
@@ -57,4 +57,3 @@ let main() =
] compile_file usage
let _ = (*Printexc.catch*) main (); exit 0
-
diff --git a/testsuite/tests/asmcomp/mainarith.c b/testsuite/tests/asmcomp/mainarith.c
index a71be4961c..3bda5ddeaf 100644
--- a/testsuite/tests/asmcomp/mainarith.c
+++ b/testsuite/tests/asmcomp/mainarith.c
@@ -304,4 +304,3 @@ int main(int argc, char **argv)
}
return 0;
}
-
diff --git a/testsuite/tests/asmcomp/parsecmm.mly b/testsuite/tests/asmcomp/parsecmm.mly
index 87db7a5fea..c19adf1c3d 100644
--- a/testsuite/tests/asmcomp/parsecmm.mly
+++ b/testsuite/tests/asmcomp/parsecmm.mly
@@ -149,7 +149,8 @@ phrase:
fundecl:
LPAREN FUNCTION STRING LPAREN params RPAREN sequence RPAREN
{ List.iter (fun (id, ty) -> unbind_ident id) $5;
- {fun_name = $3; fun_args = $5; fun_body = $7; fun_fast = true} }
+ {fun_name = $3; fun_args = $5; fun_body = $7; fun_fast = true;
+ fun_dbg = Debuginfo.none} }
;
params:
oneparam params { $1 :: $2 }
@@ -324,4 +325,3 @@ dataitem:
| SKIP INTCONST { Cskip $2 }
| ALIGN INTCONST { Calign $2 }
;
-
diff --git a/testsuite/tests/asmcomp/power-aix.S b/testsuite/tests/asmcomp/power-aix.S
index ee8a09698d..0752100f59 100644
--- a/testsuite/tests/asmcomp/power-aix.S
+++ b/testsuite/tests/asmcomp/power-aix.S
@@ -123,7 +123,7 @@
.globl .caml_c_call
.caml_c_call:
# Preserve RTOC and return address in callee-save registers
-# The C function will preserve them, and the Caml code does not
+# The C function will preserve them, and the OCaml code does not
# expect them to be preserved
# Return address is in 25, RTOC is in 26
mflr 25
diff --git a/testsuite/tests/asmcomp/sparc.S b/testsuite/tests/asmcomp/sparc.S
index 5f83bf0f22..362c6f1355 100644
--- a/testsuite/tests/asmcomp/sparc.S
+++ b/testsuite/tests/asmcomp/sparc.S
@@ -12,7 +12,7 @@
/* $Id$ */
-#ifndef SYS_solaris
+#if defined(SYS_solaris) || defined(SYS_elf)
#define Call_gen_code _call_gen_code
#define Caml_c_call _caml_c_call
#else
diff --git a/testsuite/tests/asmcomp/tagged-fib.cmm b/testsuite/tests/asmcomp/tagged-fib.cmm
index 5ee234d9ff..67d4cba2bd 100644
--- a/testsuite/tests/asmcomp/tagged-fib.cmm
+++ b/testsuite/tests/asmcomp/tagged-fib.cmm
@@ -16,4 +16,3 @@
(if (< n 5)
3
(- (+ (app "fib" (- n 2) int) (app "fib" (- n 4) int)) 1)))
-
diff --git a/testsuite/tests/asmcomp/tagged-integr.cmm b/testsuite/tests/asmcomp/tagged-integr.cmm
index 6f7562878e..663633d7a5 100644
--- a/testsuite/tests/asmcomp/tagged-integr.cmm
+++ b/testsuite/tests/asmcomp/tagged-integr.cmm
@@ -42,4 +42,3 @@
(store float "low" 0.0)
(store float "hi" 1.0)
(load float (app "integr" "square" "low" "hi" n addr)))
-
diff --git a/testsuite/tests/basic-float/tfloat_record.ml b/testsuite/tests/basic-float/tfloat_record.ml
index 4d197f5de5..996640a00e 100644
--- a/testsuite/tests/basic-float/tfloat_record.ml
+++ b/testsuite/tests/basic-float/tfloat_record.ml
@@ -2,4 +2,3 @@ let s = { Float_record.f = Float_record.make 1.0 };;
print_float (Float_record.from s.Float_record.f);;
print_newline ();;
-
diff --git a/testsuite/tests/basic-io-2/io.ml b/testsuite/tests/basic-io-2/io.ml
index f843e70846..c457054dc7 100644
--- a/testsuite/tests/basic-io-2/io.ml
+++ b/testsuite/tests/basic-io-2/io.ml
@@ -11,8 +11,8 @@ let test msg funct f1 f2 =
(* File copy with constant-sized chunks *)
let copy_file sz infile ofile =
- let ic = open_in infile in
- let oc = open_out ofile in
+ let ic = open_in_bin infile in
+ let oc = open_out_bin ofile in
let buffer = String.create sz in
let rec copy () =
let n = input ic buffer 0 sz in
@@ -27,8 +27,8 @@ let copy_file sz infile ofile =
(* File copy with random-sized chunks *)
let copy_random sz infile ofile =
- let ic = open_in infile in
- let oc = open_out ofile in
+ let ic = open_in_bin infile in
+ let oc = open_out_bin ofile in
let buffer = String.create sz in
let rec copy () =
let s = 1 + Random.int sz in
@@ -44,8 +44,8 @@ let copy_random sz infile ofile =
(* File copy line per line *)
let copy_line infile ofile =
- let ic = open_in infile in
- let oc = open_out ofile in
+ let ic = open_in_bin infile in
+ let oc = open_out_bin ofile in
try
while true do
output_string oc (input_line ic); output_char oc '\n'
@@ -73,7 +73,7 @@ let copy_seek chunksize infile ofile =
(* Create long lines of text *)
let make_lines ofile =
- let oc = open_out ofile in
+ let oc = open_out_bin ofile in
for i = 1 to 256 do
output_string oc (String.make (i*64) '.'); output_char oc '\n'
done;
diff --git a/testsuite/tests/basic-more/bounds.ml b/testsuite/tests/basic-more/bounds.ml
index 7fe52a1f57..edaa0c8a2c 100644
--- a/testsuite/tests/basic-more/bounds.ml
+++ b/testsuite/tests/basic-more/bounds.ml
@@ -24,5 +24,3 @@ let _ =
print_string "Trail:";
List.iter (fun n -> print_string " "; print_int n) !trail;
print_newline()
-
-
diff --git a/testsuite/tests/basic-more/morematch.ml b/testsuite/tests/basic-more/morematch.ml
index e45234d008..3b274d482e 100644
--- a/testsuite/tests/basic-more/morematch.ml
+++ b/testsuite/tests/basic-more/morematch.ml
@@ -51,13 +51,13 @@ test "deux" g 6 5 ;
test "deux" g 9 7 ; ()
;;
-
+
let g x = match x with
1 -> 1
| 2 -> 2
| 3 -> 3
| 4 | 5 -> 4
-| 6 -> 5
+| 6 -> 5
| 7 | 8 -> 6
| 9 -> 7
| _ -> 8;;
@@ -70,7 +70,7 @@ let g x= match x with
| 2 -> 2
| 3 -> 3
| 4 | 5 -> 4
-| 6 -> 5
+| 6 -> 5
| 4|5|7 -> 100
| 7 | 8 -> 6
| 9 -> 7
@@ -251,7 +251,7 @@ test "fin" f (D (C,1)) (D (A,1)) ;
test "fin" f (E (C,A)) (D (A,0)) ; ()
;;
-type length =
+type length =
Char of int | Pixel of int | Percent of int | No of string | Default
let length = function
@@ -550,7 +550,7 @@ test "flatgarde" flatgarde (2,4) 3 ; ()
(* Les bugs de jerome *)
type f =
- | ABSENT
+ | ABSENT
| FILE
| SYMLINK
| DIRECTORY
@@ -584,27 +584,27 @@ let replicaContent2shortString rc =
;;
-test "jerome_constr"
+test "jerome_constr"
replicaContent2shortString (ABSENT, Unchanged) " " ;
-test "jerome_constr"
+test "jerome_constr"
replicaContent2shortString (ABSENT, Deleted) "deleted " ;
-test "jerome_constr"
+test "jerome_constr"
replicaContent2shortString (FILE, Modified) "changed " ;
-test "jerome_constr"
+test "jerome_constr"
replicaContent2shortString (DIRECTORY, PropsChanged) "props " ;
-test "jerome_constr"
+test "jerome_constr"
replicaContent2shortString (FILE, Deleted) "assert false" ;
-test "jerome_constr"
+test "jerome_constr"
replicaContent2shortString (SYMLINK, Deleted) "assert false" ;
-test "jerome_constr"
+test "jerome_constr"
replicaContent2shortString (SYMLINK, PropsChanged) "assert false" ;
-test "jerome_constr"
+test "jerome_constr"
replicaContent2shortString (DIRECTORY, Deleted) "assert false" ;
-test "jerome_constr"
+test "jerome_constr"
replicaContent2shortString (ABSENT, Created) "assert false" ;
-test "jerome_constr"
+test "jerome_constr"
replicaContent2shortString (ABSENT, Modified) "assert false" ;
-test "jerome_constr"
+test "jerome_constr"
replicaContent2shortString (ABSENT, PropsChanged) "assert false" ;
;;
@@ -631,27 +631,27 @@ let replicaContent2shortString rc =
;;
-test "jerome_variant"
+test "jerome_variant"
replicaContent2shortString (`ABSENT, `Unchanged) " " ;
-test "jerome_variant"
+test "jerome_variant"
replicaContent2shortString (`ABSENT, `Deleted) "deleted " ;
-test "jerome_variant"
+test "jerome_variant"
replicaContent2shortString (`FILE, `Modified) "changed " ;
-test "jerome_variant"
+test "jerome_variant"
replicaContent2shortString (`DIRECTORY, `PropsChanged) "props " ;
-test "jerome_variant"
+test "jerome_variant"
replicaContent2shortString (`FILE, `Deleted) "assert false" ;
-test "jerome_variant"
+test "jerome_variant"
replicaContent2shortString (`SYMLINK, `Deleted) "assert false" ;
-test "jerome_variant"
+test "jerome_variant"
replicaContent2shortString (`SYMLINK, `PropsChanged) "assert false" ;
-test "jerome_variant"
+test "jerome_variant"
replicaContent2shortString (`DIRECTORY, `Deleted) "assert false" ;
-test "jerome_variant"
+test "jerome_variant"
replicaContent2shortString (`ABSENT, `Created) "assert false" ;
-test "jerome_variant"
+test "jerome_variant"
replicaContent2shortString (`ABSENT, `Modified) "assert false" ;
-test "jerome_variant"
+test "jerome_variant"
replicaContent2shortString (`ABSENT, `PropsChanged) "assert false" ;
;;
@@ -972,10 +972,10 @@ match n with
type habert_a=
| A of habert_c
| B of habert_c
-
-and habert_c= {lvar:int; lassoc: habert_c;lnb:int}
-
-
+
+and habert_c= {lvar:int; lassoc: habert_c;lnb:int}
+
+
let habert=function
| (A {lnb=i}|B {lnb=i}) when i=0 -> 1
| A {lassoc=({lnb=j});lnb=i} -> 2
@@ -1000,13 +1000,13 @@ type type_expr = [
| `TVariant of string list
| `TBlock of int
| `TCopy of type_expr
- ]
+ ]
and recurs_type_expr = [
| `TTuple of type_expr list
| `TConstr of type_expr list
| `TVariant of string list
- ]
+ ]
let rec maf te =
@@ -1129,7 +1129,7 @@ type bg = [
| `False
| `True
]
-
+
type vg = [
| `A
| `B
@@ -1142,7 +1142,7 @@ type tg = {
x : bg;
}
-let predg x = true
+let predg x = true
let rec gilles o = match o with
| {v = (`U data | `V data); x = `False} when predg o -> 1
diff --git a/testsuite/tests/basic-more/tbuffer.ml b/testsuite/tests/basic-more/tbuffer.ml
index d48268db21..b834857584 100644
--- a/testsuite/tests/basic-more/tbuffer.ml
+++ b/testsuite/tests/basic-more/tbuffer.ml
@@ -24,4 +24,3 @@ Buffer.clear b;
Buffer.add_substitute b identity pat1;
test (String.length (Buffer.contents b) = n1)
;;
-
diff --git a/testsuite/tests/basic-more/tbuffer.reference b/testsuite/tests/basic-more/tbuffer.reference
index e41ae64944..f0f683477f 100644
--- a/testsuite/tests/basic-more/tbuffer.reference
+++ b/testsuite/tests/basic-more/tbuffer.reference
@@ -1,2 +1,2 @@
-0 1
+ 0 1
All tests succeeded.
diff --git a/testsuite/tests/basic-more/testrandom.ml b/testsuite/tests/basic-more/testrandom.ml
index 150d408898..8a7ab475cf 100644
--- a/testsuite/tests/basic-more/testrandom.ml
+++ b/testsuite/tests/basic-more/testrandom.ml
@@ -1,13 +1,12 @@
open Random
-let _ =
+let _ =
for i = 0 to 20 do
- print_float (float 1000.); print_char ' '
+ print_char ' '; print_int (int 1000);
done;
print_newline (); print_newline ();
for i = 0 to 20 do
- print_int (int 1000); print_char ' '
+ print_char ' '; print_float (float 1000.);
done
let _ = exit 0
-
diff --git a/testsuite/tests/basic-more/testrandom.reference b/testsuite/tests/basic-more/testrandom.reference
index f063674d90..943addd1bd 100644
--- a/testsuite/tests/basic-more/testrandom.reference
+++ b/testsuite/tests/basic-more/testrandom.reference
@@ -1,4 +1,4 @@
-270.251355065 597.822945853 287.052171181 625.315015859 241.029649126 559.742196387 932.074421229 756.637587326 360.006556146 987.177314953 190.217751234 758.516786217 59.8488223602 328.350439075 172.627051105 944.543207513 629.424106752 868.196647048 174.382120878 78.1259713643 34.3270777955
+ 344 685 182 641 439 500 104 20 921 370 217 885 949 678 615 412 401 606 428 869 289
-683 782 740 270 835 136 791 168 324 222 156 835 328 636 233 153 671 69 95 357 92
+ 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
All tests succeeded.
diff --git a/testsuite/tests/basic-more/tformat.reference b/testsuite/tests/basic-more/tformat.reference
index 117423261c..819c5ba693 100644
--- a/testsuite/tests/basic-more/tformat.reference
+++ b/testsuite/tests/basic-more/tformat.reference
@@ -1,2 +1,2 @@
-0
+ 0
All tests succeeded.
diff --git a/testsuite/tests/basic-more/tprintf.ml b/testsuite/tests/basic-more/tprintf.ml
index 518859da2c..8bbc9f7151 100644
--- a/testsuite/tests/basic-more/tprintf.ml
+++ b/testsuite/tests/basic-more/tprintf.ml
@@ -42,7 +42,7 @@ test (test1 ());;
let test2 () = true
(* sprintf "%1$d\n" 5 1 = " 1\n" &&
sprintf "%01$d\n" 5 1 = "00001\n" *);;
-
+
test (test2 ());;
(* Testing meta format string printing. *)
diff --git a/testsuite/tests/basic-more/tprintf.reference b/testsuite/tests/basic-more/tprintf.reference
index d804a0b893..1fb209d42c 100644
--- a/testsuite/tests/basic-more/tprintf.reference
+++ b/testsuite/tests/basic-more/tprintf.reference
@@ -1,2 +1,2 @@
-0 1 2 3 4 5
+ 0 1 2 3 4 5
All tests succeeded.
diff --git a/testsuite/tests/basic/bigints.ml b/testsuite/tests/basic/bigints.ml
index 0b101ffa1f..23e571c3fc 100644
--- a/testsuite/tests/basic/bigints.ml
+++ b/testsuite/tests/basic/bigints.ml
@@ -1,12 +1,25 @@
let _ =
- print_int 1000000000; print_newline();
- print_int 10000000000; print_newline();
- print_int 100000000000; print_newline();
- print_int 1000000000000; print_newline();
- print_int 10000000000000; print_newline();
- print_int 100000000000000; print_newline();
- print_int 1000000000000000; print_newline();
- print_int 10000000000000000; print_newline();
- print_int 100000000000000000; print_newline();
- print_int 1000000000000000000; print_newline()
-
+ match Sys.word_size with
+ | 32 ->
+ print_int (1 * 1000000000); print_newline();
+ print_string "10000000000"; print_newline();
+ print_string "100000000000"; print_newline();
+ print_string "1000000000000"; print_newline();
+ print_string "10000000000000"; print_newline();
+ print_string "100000000000000"; print_newline();
+ print_string "1000000000000000"; print_newline();
+ print_string "10000000000000000"; print_newline();
+ print_string "100000000000000000"; print_newline();
+ print_string "1000000000000000000"; print_newline();
+ | 64 ->
+ print_int (1 * 1000000000); print_newline();
+ print_int (10 * 1000000000); print_newline();
+ print_int (100 * 1000000000); print_newline();
+ print_int (1000 * 1000000000); print_newline();
+ print_int (10000 * 1000000000); print_newline();
+ print_int (100000 * 1000000000); print_newline();
+ print_int (1000000 * 1000000000); print_newline();
+ print_int (10000000 * 1000000000); print_newline();
+ print_int (100000000 * 1000000000); print_newline();
+ print_int (1000000000 * 1000000000); print_newline()
+ | _ -> assert false
diff --git a/testsuite/tests/basic/boxedints.ml b/testsuite/tests/basic/boxedints.ml
index 19574a1a4b..a84e65dee9 100644
--- a/testsuite/tests/basic/boxedints.ml
+++ b/testsuite/tests/basic/boxedints.ml
@@ -28,30 +28,30 @@ let test test_number answer correct_answer =
module type TESTSIG = sig
type t
module Ops : sig
- val neg: t -> t
- val add: t -> t -> t
- val sub: t -> t -> t
- val mul: t -> t -> t
- val div: t -> t -> t
- val rem: t -> t -> t
- val logand: t -> t -> t
- val logor: t -> t -> t
- val logxor: t -> t -> t
- val shift_left: t -> int -> t
- val shift_right: t -> int -> t
- val shift_right_logical: t -> int -> t
- val of_int: int -> t
- val to_int: t -> int
- val of_float: float -> t
+ val neg: t -> t
+ val add: t -> t -> t
+ val sub: t -> t -> t
+ val mul: t -> t -> t
+ val div: t -> t -> t
+ val rem: t -> t -> t
+ val logand: t -> t -> t
+ val logor: t -> t -> t
+ val logxor: t -> t -> t
+ val shift_left: t -> int -> t
+ val shift_right: t -> int -> t
+ val shift_right_logical: t -> int -> t
+ val of_int: int -> t
+ val to_int: t -> int
+ val of_float: float -> t
val to_float: t -> float
val zero: t
val one: t
val minus_one: t
val min_int: t
val max_int: t
- val format : string -> t -> string
+ val format : string -> t -> string
val to_string: t -> string
- val of_string: string -> t
+ val of_string: string -> t
end
val testcomp: t -> t -> bool*bool*bool*bool*bool*bool*int
val skip_float_tests: bool
@@ -166,6 +166,7 @@ struct
9, 127531236, -365;
10, 1234567, 12345678;
11, 1234567, -12345678];
+ test 12 (div min_int (of_int (-1))) min_int;
testing_function "mod";
List.iter
@@ -181,6 +182,7 @@ struct
9, 127531236, -365;
10, 1234567, 12345678;
11, 1234567, -12345678];
+ test 12 (rem min_int (of_int (-1))) (of_int 0);
testing_function "and";
List.iter
@@ -345,7 +347,7 @@ struct
test 5 (add (of_int (-123)) (of_int 456)) (of_int 333);
test 6 (add (of_int 123) (of_int (-456))) (of_int (-333));
test 7 (add (of_int (-123)) (of_int (-456))) (of_int (-579));
- test 8 (add (of_string "0x1234567812345678")
+ test 8 (add (of_string "0x1234567812345678")
(of_string "0x9ABCDEF09ABCDEF"))
(of_string "0x1be024671be02467");
test 9 (add max_int max_int) (of_int (-2));
@@ -362,7 +364,7 @@ struct
test 5 (sub (of_int (-123)) (of_int 456)) (of_int (-579));
test 6 (sub (of_int 123) (of_int (-456))) (of_int 579);
test 7 (sub (of_int (-123)) (of_int (-456))) (of_int 333);
- test 8 (sub (of_string "0x1234567812345678")
+ test 8 (sub (of_string "0x1234567812345678")
(of_string "0x9ABCDEF09ABCDEF"))
(of_string "0x888888908888889");
test 9 (sub max_int min_int) minus_one;
@@ -400,6 +402,7 @@ struct
9, 127531236, -365;
10, 1234567, 12345678;
11, 1234567, -12345678];
+ test 12 (div min_int (of_int (-1))) min_int;
testing_function "mod";
List.iter
@@ -415,6 +418,7 @@ struct
9, 127531236, -365;
10, 1234567, 12345678;
11, 1234567, -12345678];
+ test 12 (rem min_int (of_int (-1))) (of_int 0);
testing_function "and";
List.iter
@@ -524,7 +528,7 @@ let _ =
begin match Sys.word_size with
32 ->
let module C =
- Test32(struct type t = nativeint
+ Test32(struct type t = nativeint
module Ops = Nativeint
let testcomp = testcomp_nativeint
let skip_float_tests = true end)
@@ -533,7 +537,7 @@ let _ =
let module C =
Test64(struct type t = nativeint
module Ops = Nativeint
- let testcomp = testcomp_nativeint
+ let testcomp = testcomp_nativeint
let skip_float_tests = true end)
in ()
| _ ->
diff --git a/testsuite/tests/basic/boxedints.reference b/testsuite/tests/basic/boxedints.reference
index fe08bb2b81..009390faee 100644
--- a/testsuite/tests/basic/boxedints.reference
+++ b/testsuite/tests/basic/boxedints.reference
@@ -16,9 +16,9 @@ sub
mul
1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12... 13...
div
- 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11...
+ 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12...
mod
- 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11...
+ 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12...
and
1... 2... 3... 4... 5...
or
@@ -55,9 +55,9 @@ sub
mul
1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12... 13...
div
- 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11...
+ 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12...
mod
- 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11...
+ 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12...
and
1... 2... 3... 4... 5...
or
@@ -90,9 +90,9 @@ sub
mul
1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12... 13...
div
- 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11...
+ 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12...
mod
- 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11...
+ 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12...
and
1... 2... 3... 4... 5...
or
diff --git a/testsuite/tests/basic/equality.ml b/testsuite/tests/basic/equality.ml
index f69120c9ac..ebf5cf438b 100644
--- a/testsuite/tests/basic/equality.ml
+++ b/testsuite/tests/basic/equality.ml
@@ -102,4 +102,3 @@ let _ =
test 53 eqtrue (testcmpfloat 0.0 0.0);
test 54 eqtrue (testcmpfloat 1.0 0.0);
test 55 eqtrue (testcmpfloat 0.0 1.0)
-
diff --git a/testsuite/tests/basic/includestruct.ml b/testsuite/tests/basic/includestruct.ml
index 182272c1ba..15708bf970 100644
--- a/testsuite/tests/basic/includestruct.ml
+++ b/testsuite/tests/basic/includestruct.ml
@@ -65,7 +65,7 @@ module D =
include F(struct end)
let test() = print_t A; print_newline(); print_t (B 42); print_newline()
end
-
+
let _ =
D.test();
D.print_t D.A; print_newline(); D.print_t (D.B 42); print_newline()
@@ -89,4 +89,3 @@ module G =
let _ =
begin try raise (G.Exn "foo") with G.Exn s -> print_string s end;
print_int ((new G.c)#m); print_newline()
-
diff --git a/testsuite/tests/basic/maps.ml b/testsuite/tests/basic/maps.ml
index ffbaa041cb..f021e00cce 100644
--- a/testsuite/tests/basic/maps.ml
+++ b/testsuite/tests/basic/maps.ml
@@ -25,4 +25,3 @@ let () =
print_endline "Inter";
show (IntMap.merge (fun _ l r -> match l, r with Some x, Some y when x = y -> Some x | _ -> None) m1 m2);
()
-
diff --git a/testsuite/tests/basic/patmatch.ml b/testsuite/tests/basic/patmatch.ml
index 1cc37c1c67..64e56174e0 100644
--- a/testsuite/tests/basic/patmatch.ml
+++ b/testsuite/tests/basic/patmatch.ml
@@ -91,7 +91,7 @@ let _ =
done;
for i = 0 to 255 do
let c = Char.chr i in
- printf "k(%s) = %s\t" (escaped c) (k c)
+ printf "\tk(%s) = %s" (escaped c) (k c)
done;
printf "\n";
printf "p([|\"hello\"|]) = %s\n" (p [|"hello"|]);
@@ -103,6 +103,3 @@ let _ =
printf "l([|2;3|]) = %d\n" (l [|2;3|]);
printf "l([|4;5;6|]) = %d\n" (l [|4;5;6|]);
exit 0
-
-
-
diff --git a/testsuite/tests/basic/patmatch.reference b/testsuite/tests/basic/patmatch.reference
index eb7dc97886..125c466fd1 100644
--- a/testsuite/tests/basic/patmatch.reference
+++ b/testsuite/tests/basic/patmatch.reference
@@ -57,7 +57,7 @@ h({) = ?
h(|) = ?
h(}) = ?
h(~) = ?
-k(\000) = othr k(\001) = othr k(\002) = othr k(\003) = othr k(\004) = othr k(\005) = othr k(\006) = othr k(\007) = othr k(\b) = othr k(\t) = blk k(\n) = blk k(\011) = othr k(\012) = othr k(\r) = blk k(\014) = othr k(\015) = othr k(\016) = othr k(\017) = othr k(\018) = othr k(\019) = othr k(\020) = othr k(\021) = othr k(\022) = othr k(\023) = othr k(\024) = othr k(\025) = othr k(\026) = othr k(\027) = othr k(\028) = othr k(\029) = othr k(\030) = othr k(\031) = othr k( ) = blk k(!) = oper k(\034) = othr k(#) = oper k($) = oper k(%) = oper k(&) = oper k(\') = othr k(\040) = othr k(\041) = othr k(*) = oper k(+) = oper k(\044) = othr k(\045) = othr k(\046) = othr k(/) = oper k(0) = dig k(1) = dig k(2) = dig k(3) = dig k(4) = dig k(5) = dig k(6) = dig k(7) = dig k(8) = dig k(9) = dig k(:) = oper k(\059) = othr k(<) = oper k(=) = oper k(>) = oper k(?) = oper k(@) = oper k(A) = letr k(B) = letr k(C) = letr k(D) = letr k(E) = letr k(F) = letr k(G) = letr k(H) = letr k(I) = letr k(J) = letr k(K) = letr k(L) = letr k(M) = letr k(N) = letr k(O) = letr k(P) = letr k(Q) = letr k(R) = letr k(S) = letr k(T) = letr k(U) = letr k(V) = letr k(W) = letr k(X) = letr k(Y) = letr k(Z) = letr k(\091) = othr k(\\) = oper k(\093) = othr k(^) = oper k(\095) = othr k(\096) = othr k(a) = letr k(b) = letr k(c) = letr k(d) = letr k(e) = letr k(f) = letr k(g) = letr k(h) = letr k(i) = letr k(j) = letr k(k) = letr k(l) = letr k(m) = letr k(n) = letr k(o) = letr k(p) = letr k(q) = letr k(r) = letr k(s) = letr k(t) = letr k(u) = letr k(v) = letr k(w) = letr k(x) = letr k(y) = letr k(z) = letr k(\123) = othr k(|) = oper k(\125) = othr k(~) = oper k(\127) = othr k(\128) = othr k(\129) = othr k(\130) = othr k(\131) = othr k(\132) = othr k(\133) = othr k(\134) = othr k(\135) = othr k(\136) = othr k(\137) = othr k(\138) = othr k(\139) = othr k(\140) = othr k(\141) = othr k(\142) = othr k(\143) = othr k(\144) = othr k(\145) = othr k(\146) = othr k(\147) = othr k(\148) = othr k(\149) = othr k(\150) = othr k(\151) = othr k(\152) = othr k(\153) = othr k(\154) = othr k(\155) = othr k(\156) = othr k(\157) = othr k(\158) = othr k(\159) = othr k(\160) = othr k(\161) = othr k(\162) = othr k(\163) = othr k(\164) = othr k(\165) = othr k(\166) = othr k(\167) = othr k(\168) = othr k(\169) = othr k(\170) = othr k(\171) = othr k(\172) = othr k(\173) = othr k(\174) = othr k(\175) = othr k(\176) = othr k(\177) = othr k(\178) = othr k(\179) = othr k(\180) = othr k(\181) = othr k(\182) = othr k(\183) = othr k(\184) = othr k(\185) = othr k(\186) = othr k(\187) = othr k(\188) = othr k(\189) = othr k(\190) = othr k(\191) = othr k(\192) = letr k(\193) = letr k(\194) = letr k(\195) = letr k(\196) = letr k(\197) = letr k(\198) = letr k(\199) = letr k(\200) = letr k(\201) = letr k(\202) = letr k(\203) = letr k(\204) = letr k(\205) = letr k(\206) = letr k(\207) = letr k(\208) = letr k(\209) = letr k(\210) = letr k(\211) = letr k(\212) = letr k(\213) = letr k(\214) = letr k(\215) = letr k(\216) = letr k(\217) = letr k(\218) = letr k(\219) = letr k(\220) = letr k(\221) = letr k(\222) = letr k(\223) = letr k(\224) = letr k(\225) = letr k(\226) = letr k(\227) = letr k(\228) = letr k(\229) = letr k(\230) = letr k(\231) = letr k(\232) = letr k(\233) = letr k(\234) = letr k(\235) = letr k(\236) = letr k(\237) = letr k(\238) = letr k(\239) = letr k(\240) = letr k(\241) = letr k(\242) = letr k(\243) = letr k(\244) = letr k(\245) = letr k(\246) = letr k(\247) = letr k(\248) = letr k(\249) = letr k(\250) = letr k(\251) = letr k(\252) = letr k(\253) = letr k(\254) = letr k(\255) = letr
+ k(\000) = othr k(\001) = othr k(\002) = othr k(\003) = othr k(\004) = othr k(\005) = othr k(\006) = othr k(\007) = othr k(\b) = othr k(\t) = blk k(\n) = blk k(\011) = othr k(\012) = othr k(\r) = blk k(\014) = othr k(\015) = othr k(\016) = othr k(\017) = othr k(\018) = othr k(\019) = othr k(\020) = othr k(\021) = othr k(\022) = othr k(\023) = othr k(\024) = othr k(\025) = othr k(\026) = othr k(\027) = othr k(\028) = othr k(\029) = othr k(\030) = othr k(\031) = othr k( ) = blk k(!) = oper k(\034) = othr k(#) = oper k($) = oper k(%) = oper k(&) = oper k(\') = othr k(\040) = othr k(\041) = othr k(*) = oper k(+) = oper k(\044) = othr k(\045) = othr k(\046) = othr k(/) = oper k(0) = dig k(1) = dig k(2) = dig k(3) = dig k(4) = dig k(5) = dig k(6) = dig k(7) = dig k(8) = dig k(9) = dig k(:) = oper k(\059) = othr k(<) = oper k(=) = oper k(>) = oper k(?) = oper k(@) = oper k(A) = letr k(B) = letr k(C) = letr k(D) = letr k(E) = letr k(F) = letr k(G) = letr k(H) = letr k(I) = letr k(J) = letr k(K) = letr k(L) = letr k(M) = letr k(N) = letr k(O) = letr k(P) = letr k(Q) = letr k(R) = letr k(S) = letr k(T) = letr k(U) = letr k(V) = letr k(W) = letr k(X) = letr k(Y) = letr k(Z) = letr k(\091) = othr k(\\) = oper k(\093) = othr k(^) = oper k(\095) = othr k(\096) = othr k(a) = letr k(b) = letr k(c) = letr k(d) = letr k(e) = letr k(f) = letr k(g) = letr k(h) = letr k(i) = letr k(j) = letr k(k) = letr k(l) = letr k(m) = letr k(n) = letr k(o) = letr k(p) = letr k(q) = letr k(r) = letr k(s) = letr k(t) = letr k(u) = letr k(v) = letr k(w) = letr k(x) = letr k(y) = letr k(z) = letr k(\123) = othr k(|) = oper k(\125) = othr k(~) = oper k(\127) = othr k(\128) = othr k(\129) = othr k(\130) = othr k(\131) = othr k(\132) = othr k(\133) = othr k(\134) = othr k(\135) = othr k(\136) = othr k(\137) = othr k(\138) = othr k(\139) = othr k(\140) = othr k(\141) = othr k(\142) = othr k(\143) = othr k(\144) = othr k(\145) = othr k(\146) = othr k(\147) = othr k(\148) = othr k(\149) = othr k(\150) = othr k(\151) = othr k(\152) = othr k(\153) = othr k(\154) = othr k(\155) = othr k(\156) = othr k(\157) = othr k(\158) = othr k(\159) = othr k(\160) = othr k(\161) = othr k(\162) = othr k(\163) = othr k(\164) = othr k(\165) = othr k(\166) = othr k(\167) = othr k(\168) = othr k(\169) = othr k(\170) = othr k(\171) = othr k(\172) = othr k(\173) = othr k(\174) = othr k(\175) = othr k(\176) = othr k(\177) = othr k(\178) = othr k(\179) = othr k(\180) = othr k(\181) = othr k(\182) = othr k(\183) = othr k(\184) = othr k(\185) = othr k(\186) = othr k(\187) = othr k(\188) = othr k(\189) = othr k(\190) = othr k(\191) = othr k(\192) = letr k(\193) = letr k(\194) = letr k(\195) = letr k(\196) = letr k(\197) = letr k(\198) = letr k(\199) = letr k(\200) = letr k(\201) = letr k(\202) = letr k(\203) = letr k(\204) = letr k(\205) = letr k(\206) = letr k(\207) = letr k(\208) = letr k(\209) = letr k(\210) = letr k(\211) = letr k(\212) = letr k(\213) = letr k(\214) = letr k(\215) = letr k(\216) = letr k(\217) = letr k(\218) = letr k(\219) = letr k(\220) = letr k(\221) = letr k(\222) = letr k(\223) = letr k(\224) = letr k(\225) = letr k(\226) = letr k(\227) = letr k(\228) = letr k(\229) = letr k(\230) = letr k(\231) = letr k(\232) = letr k(\233) = letr k(\234) = letr k(\235) = letr k(\236) = letr k(\237) = letr k(\238) = letr k(\239) = letr k(\240) = letr k(\241) = letr k(\242) = letr k(\243) = letr k(\244) = letr k(\245) = letr k(\246) = letr k(\247) = letr k(\248) = letr k(\249) = letr k(\250) = letr k(\251) = letr k(\252) = letr k(\253) = letr k(\254) = letr k(\255) = letr
p([|"hello"|]) = hello
p([|1.0|]) = 1.000000
q([|2|]) = 2
diff --git a/testsuite/tests/basic/recvalues.ml b/testsuite/tests/basic/recvalues.ml
index c00ced8273..df32f5e702 100644
--- a/testsuite/tests/basic/recvalues.ml
+++ b/testsuite/tests/basic/recvalues.ml
@@ -8,7 +8,7 @@ let _ =
then print_string "Test 1: passed\n"
else print_string "Test 1: FAILED\n";
let one = 1 in
- let rec y = (one, one+1) :: y in
+ let rec y = (one, one+1) :: y in
if match y with
(1,2) :: y' -> y == y'
| _ -> false
diff --git a/testsuite/tests/basic/tailcalls.ml b/testsuite/tests/basic/tailcalls.ml
index 23b7353598..7e37ea714c 100644
--- a/testsuite/tests/basic/tailcalls.ml
+++ b/testsuite/tests/basic/tailcalls.ml
@@ -18,7 +18,7 @@ let indtailcall8 fn a b c d e f g h =
fn a b c d e f g h
let indtailcall16 fn a b c d e f g h i j k l m n o p =
- fn a b c d e f g h i j k l m n o p
+ fn a b c d e f g h i j k l m n o p
let _ =
print_int (tailcall4 10000000 0 0 0); print_newline();
diff --git a/testsuite/tests/callback/Makefile b/testsuite/tests/callback/Makefile
index a89056685a..0db946a1ed 100644
--- a/testsuite/tests/callback/Makefile
+++ b/testsuite/tests/callback/Makefile
@@ -12,7 +12,7 @@ run-byte: common
@$(OCAMLC) -c tcallback.ml
@$(OCAMLC) -o ./program -custom unix.cma callbackprim.$(O) tcallback.cmo
@./program > bytecode.result
- @$(DIFF) reference bytecode.result || (echo " => failed" && exit 1)
+ @$(DIFF) reference bytecode.result || (echo " => failed" && exit 1)
@echo " => passed"
run-opt: common
@@ -24,7 +24,7 @@ run-opt: common
$(DIFF) reference native.result || (echo " => failed" && exit 1); \
echo " => passed"; \
fi
-
+
promote: defaultpromote
clean: defaultclean
diff --git a/testsuite/tests/callback/tcallback.ml b/testsuite/tests/callback/tcallback.ml
index 32914119bd..e0f66fe506 100644
--- a/testsuite/tests/callback/tcallback.ml
+++ b/testsuite/tests/callback/tcallback.ml
@@ -65,4 +65,3 @@ let _ =
print_string(tripwire mycamlparam); print_newline();
Sys.set_signal Sys.sigusr1 (Sys.Signal_handle sighandler);
print_string(callbacksig ()); print_newline()
-
diff --git a/testsuite/tests/embedded/Makefile b/testsuite/tests/embedded/Makefile
index ed33143461..ec2308dd7d 100644
--- a/testsuite/tests/embedded/Makefile
+++ b/testsuite/tests/embedded/Makefile
@@ -13,7 +13,7 @@ run:
@./program > program.result
@$(DIFF) program.reference program.result > /dev/null || (echo " => failed" && exit 1)
@echo " => passed"
-
+
promote: defaultpromote
clean: defaultclean
diff --git a/testsuite/tests/embedded/cmcaml.ml b/testsuite/tests/embedded/cmcaml.ml
index 4ebed1e7df..65c7a610e8 100644
--- a/testsuite/tests/embedded/cmcaml.ml
+++ b/testsuite/tests/embedded/cmcaml.ml
@@ -1,4 +1,4 @@
-(* Caml part of the code *)
+(* OCaml part of the code *)
let rec fib n =
if n < 2 then 1 else fib(n-1) + fib(n-2)
diff --git a/testsuite/tests/embedded/cmmain.c b/testsuite/tests/embedded/cmmain.c
index 87647ac50d..6c27fe1e9d 100644
--- a/testsuite/tests/embedded/cmmain.c
+++ b/testsuite/tests/embedded/cmmain.c
@@ -9,7 +9,7 @@ extern char * format_result(int n);
int main(int argc, char ** argv)
{
- printf("Initializing Caml code...\n");
+ printf("Initializing OCaml code...\n");
#ifdef NO_BYTECODE_FILE
caml_startup(argv);
#else
diff --git a/testsuite/tests/embedded/program.reference b/testsuite/tests/embedded/program.reference
index e2752b724f..4f27810ca9 100644
--- a/testsuite/tests/embedded/program.reference
+++ b/testsuite/tests/embedded/program.reference
@@ -1,4 +1,4 @@
-Initializing Caml code...
+Initializing OCaml code...
Back in C code...
Computing fib(20)...
Result = 10946
diff --git a/testsuite/tests/gc-roots/globrootsprim.c b/testsuite/tests/gc-roots/globrootsprim.c
index f58fff1cc3..32a61a7cce 100644
--- a/testsuite/tests/gc-roots/globrootsprim.c
+++ b/testsuite/tests/gc-roots/globrootsprim.c
@@ -52,5 +52,3 @@ value gb_generational_remove(value vblock)
caml_remove_generational_global_root(&(Block_val(vblock)->v));
return Val_unit;
}
-
-
diff --git a/testsuite/tests/letrec/backreferences.result b/testsuite/tests/letrec/backreferences.reference
index e69de29bb2..e69de29bb2 100644
--- a/testsuite/tests/letrec/backreferences.result
+++ b/testsuite/tests/letrec/backreferences.reference
diff --git a/testsuite/tests/letrec/class_1.result b/testsuite/tests/letrec/class_1.reference
index e69de29bb2..e69de29bb2 100644
--- a/testsuite/tests/letrec/class_1.result
+++ b/testsuite/tests/letrec/class_1.reference
diff --git a/testsuite/tests/letrec/float_block_2.result b/testsuite/tests/letrec/float_block_2.reference
index e69de29bb2..e69de29bb2 100644
--- a/testsuite/tests/letrec/float_block_2.result
+++ b/testsuite/tests/letrec/float_block_2.reference
diff --git a/testsuite/tests/letrec/lists.result b/testsuite/tests/letrec/lists.reference
index e69de29bb2..e69de29bb2 100644
--- a/testsuite/tests/letrec/lists.result
+++ b/testsuite/tests/letrec/lists.reference
diff --git a/testsuite/tests/letrec/mixing_value_closures_1.result b/testsuite/tests/letrec/mixing_value_closures_1.reference
index e69de29bb2..e69de29bb2 100644
--- a/testsuite/tests/letrec/mixing_value_closures_1.result
+++ b/testsuite/tests/letrec/mixing_value_closures_1.reference
diff --git a/testsuite/tests/letrec/mixing_value_closures_2.result b/testsuite/tests/letrec/mixing_value_closures_2.reference
index e69de29bb2..e69de29bb2 100644
--- a/testsuite/tests/letrec/mixing_value_closures_2.result
+++ b/testsuite/tests/letrec/mixing_value_closures_2.reference
diff --git a/testsuite/tests/letrec/mutual_functions.result b/testsuite/tests/letrec/mutual_functions.reference
index e69de29bb2..e69de29bb2 100644
--- a/testsuite/tests/letrec/mutual_functions.result
+++ b/testsuite/tests/letrec/mutual_functions.reference
diff --git a/testsuite/tests/lib-bigarray-2/bigarrf.f b/testsuite/tests/lib-bigarray-2/bigarrf.f
index 5c2462c2ef..ff52de1d9f 100644
--- a/testsuite/tests/lib-bigarray-2/bigarrf.f
+++ b/testsuite/tests/lib-bigarray-2/bigarrf.f
@@ -24,4 +24,3 @@
300 format(/1X, I3, 2X, 10F6.1/)
200 continue
end
-
diff --git a/testsuite/tests/lib-bigarray-2/bigarrfml.ml b/testsuite/tests/lib-bigarray-2/bigarrfml.ml
index c915622840..562cfc8a74 100644
--- a/testsuite/tests/lib-bigarray-2/bigarrfml.ml
+++ b/testsuite/tests/lib-bigarray-2/bigarrfml.ml
@@ -60,4 +60,3 @@ let _ =
test 2 a.{2,1} 201.0;
test 3 a.{1,2} 102.0;
test 4 a.{5,4} 504.0;
-
diff --git a/testsuite/tests/lib-bigarray-2/bigarrfstub.c b/testsuite/tests/lib-bigarray-2/bigarrfstub.c
index 87bd67b7bc..be142f6a92 100644
--- a/testsuite/tests/lib-bigarray-2/bigarrfstub.c
+++ b/testsuite/tests/lib-bigarray-2/bigarrfstub.c
@@ -57,4 +57,3 @@ value fortran_printtab(value ba)
printtab_(Data_bigarray_val(ba), &dimx, &dimy);
return Val_unit;
}
-
diff --git a/testsuite/tests/lib-bigarray/bigarrays.ml b/testsuite/tests/lib-bigarray/bigarrays.ml
index 85901400eb..9c790a1a6a 100644
--- a/testsuite/tests/lib-bigarray/bigarrays.ml
+++ b/testsuite/tests/lib-bigarray/bigarrays.ml
@@ -139,14 +139,14 @@ let _ =
let from_list kind vals =
let a = Array1.create kind c_layout (List.length vals) in
let rec set i = function
- [] -> ()
+ [] -> ()
| hd :: tl -> a.{i} <- hd; set (i+1) tl in
set 0 vals;
a in
let from_list_fortran kind vals =
let a = Array1.create kind fortran_layout (List.length vals) in
let rec set i = function
- [] -> ()
+ [] -> ()
| hd :: tl -> a.{i} <- hd; set (i+1) tl in
set 1 vals;
a in
@@ -157,7 +157,7 @@ let _ =
for i = 0 to 2 do test (i+1) a.{i} i done;
test 4 true (try ignore a.{3}; false with Invalid_argument _ -> true);
test 5 true (try ignore a.{-1}; false with Invalid_argument _ -> true);
-
+
let b = Array1.create float64 fortran_layout 3 in
for i = 1 to 3 do b.{i} <- float i done;
for i = 1 to 3 do test (5 + i) b.{i} (float i) done;
@@ -180,7 +180,7 @@ let _ =
let a = Array1.create int c_layout 3 in
for i = 0 to 2 do Array1.unsafe_set a i i done;
for i = 0 to 2 do test (i+1) (Array1.unsafe_get a i) i done;
-
+
let b = Array1.create float64 fortran_layout 3 in
for i = 1 to 3 do Array1.unsafe_set b i (float i) done;
for i = 1 to 3 do test (5 + i) (Array1.unsafe_get b i) (float i) done;
@@ -459,7 +459,7 @@ let _ =
test 3 true (try ignore a.{-1,0}; false with Invalid_argument _ -> true);
test 4 true (try ignore a.{0,3}; false with Invalid_argument _ -> true);
test 5 true (try ignore a.{0,-1}; false with Invalid_argument _ -> true);
-
+
let b = Array2.create float32 fortran_layout 3 3 in
for i = 1 to 3 do for j = 1 to 3 do b.{i,j} <- float(i-j) done done;
let ok = ref true in
@@ -480,7 +480,7 @@ let _ =
for j = 0 to 2 do if Array2.unsafe_get a i j <> i-j then ok := false done
done;
test 1 true !ok;
-
+
let b = Array2.create float32 fortran_layout 3 3 in
for i = 1 to 3 do for j = 1 to 3 do Array2.unsafe_set b i j (float(i-j)) done done;
let ok = ref true in
@@ -611,7 +611,7 @@ let _ =
if Int32.to_int a.{i,j,k} <> (i lsl 4) + (j lsl 2) + k then ok := false
done done done;
test 1 true !ok;
-
+
let b = Array3.create int64 fortran_layout 2 3 4 in
for i = 1 to 2 do for j = 1 to 3 do for k = 1 to 4 do
b.{i,j,k} <- Int64.of_int((i lsl 4) + (j lsl 2) + k)
@@ -764,7 +764,7 @@ let _ =
Sys.remove mapped_file;
()
-
+
(********* End of test *********)
let _ =
diff --git a/testsuite/tests/lib-bigarray/fftba.ml b/testsuite/tests/lib-bigarray/fftba.ml
index 10c22f1db4..f7149252c7 100644
--- a/testsuite/tests/lib-bigarray/fftba.ml
+++ b/testsuite/tests/lib-bigarray/fftba.ml
@@ -22,17 +22,17 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
(py : (float, float64_elt, c_layout) Array1.t) np =
let i = ref 2 in
let m = ref 1 in
-
+
while (!i < np) do
- i := !i + !i;
+ i := !i + !i;
m := !m + 1
done;
- let n = !i in
-
+ let n = !i in
+
if n <> np then begin
for i = np+1 to n do
- px.{i} <- 0.0;
+ px.{i} <- 0.0;
py.{i} <- 0.0
done;
print_string "Use "; print_int n;
@@ -41,7 +41,7 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
let n2 = ref(n+n) in
for k = 1 to !m-1 do
- n2 := !n2 / 2;
+ n2 := !n2 / 2;
let n4 = !n2 / 4 in
let e = tpi /. float !n2 in
@@ -54,7 +54,7 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
let ss3 = sin(a3) in
let is = ref j in
let id = ref(2 * !n2) in
-
+
while !is < n do
let i0r = ref !is in
while !i0r < n do
@@ -74,13 +74,13 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
let r1 = r1 +. s2 in
let s2 = r2 -. s1 in
let r2 = r2 +. s1 in
- px.{i2} <- r1*.cc1 -. s2*.ss1;
+ px.{i2} <- r1*.cc1 -. s2*.ss1;
py.{i2} <- -.s2*.cc1 -. r1*.ss1;
px.{i3} <- s3*.cc3 +. r2*.ss3;
py.{i3} <- r2*.cc3 -. s3*.ss3;
i0r := i0 + !id
done;
- is := 2 * !id - !n2 + j;
+ is := 2 * !id - !n2 + j;
id := 4 * !id
done
done
@@ -92,7 +92,7 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
let is = ref 1 in
let id = ref 4 in
-
+
while !is < n do
let i0r = ref !is in
while !i0r <= n do
@@ -106,7 +106,7 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
py.{i1} <- r1 -. py.{i1};
i0r := i0 + !id
done;
- is := 2 * !id - 1;
+ is := 2 * !id - 1;
id := 4 * !id
done;
@@ -115,11 +115,11 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
(*************************)
let j = ref 1 in
-
+
for i = 1 to n - 1 do
if i < !j then begin
let xt = px.{!j} in
- px.{!j} <- px.{i};
+ px.{!j} <- px.{i};
px.{i} <- xt;
let xt = py.{!j} in
py.{!j} <- py.{i};
@@ -127,7 +127,7 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
end;
let k = ref(n / 2) in
while !k < !j do
- j := !j - !k;
+ j := !j - !k;
k := !k / 2
done;
j := !j + !k
@@ -173,12 +173,12 @@ let test np =
for i = 0 to np-1 do
let a = abs_float(pxr.{i+1} -. float i) in
if !zr < a then begin
- zr := a;
+ zr := a;
kr := i
end;
let a = abs_float(pxi.{i+1}) in
if !zi < a then begin
- zi := a;
+ zi := a;
ki := i
end
done;
@@ -194,4 +194,3 @@ let test np =
let _ =
let np = ref 16 in for i = 1 to 13 do test !np; np := !np*2 done
-
diff --git a/testsuite/tests/lib-bigarray/pr5115.ml b/testsuite/tests/lib-bigarray/pr5115.ml
index 69cdca64d9..e75215cf75 100644
--- a/testsuite/tests/lib-bigarray/pr5115.ml
+++ b/testsuite/tests/lib-bigarray/pr5115.ml
@@ -10,4 +10,3 @@ let _ =
let y = Array1.of_array float64 fortran_layout [| 1. |] in
(f y).{1};
(f y).{1} <- 3.14
-
diff --git a/testsuite/tests/lib-digest/md5.ml b/testsuite/tests/lib-digest/md5.ml
index 6d4e6e0641..27aebf2a38 100644
--- a/testsuite/tests/lib-digest/md5.ml
+++ b/testsuite/tests/lib-digest/md5.ml
@@ -211,7 +211,7 @@ let _ =
if (Array.length Sys.argv) > 1 && (Sys.argv.(1) = "-benchmark") then begin
let s = String.make 50000 'a' in
let num_iter = 1000 in
- time "Caml implementation" num_iter
+ time "OCaml implementation" num_iter
(fun () ->
let ctx = init() in
update ctx s 0 (String.length s);
diff --git a/testsuite/tests/lib-dynlink-bytecode/.ignore b/testsuite/tests/lib-dynlink-bytecode/.ignore
index f22ec66027..789e3e0531 100644
--- a/testsuite/tests/lib-dynlink-bytecode/.ignore
+++ b/testsuite/tests/lib-dynlink-bytecode/.ignore
@@ -1,3 +1,5 @@
main
static
custom
+custom.exe
+marshal.data
diff --git a/testsuite/tests/lib-dynlink-bytecode/Makefile b/testsuite/tests/lib-dynlink-bytecode/Makefile
index a510325bce..089d17a5c4 100644
--- a/testsuite/tests/lib-dynlink-bytecode/Makefile
+++ b/testsuite/tests/lib-dynlink-bytecode/Makefile
@@ -3,6 +3,7 @@ BASEDIR=../..
default: compile run
compile:
+ @$(OCAMLC) -c registry.ml
@for file in stub*.c; do \
$(OCAMLC) -c $$file; \
$(OCAMLMKLIB) -o `echo $$file | sed -e 's/stub/plug/' | sed -e 's/\.c//'` `basename $$file c`o; \
@@ -12,9 +13,9 @@ compile:
$(OCAMLMKLIB) -o `basename $$file .ml` `basename $$file ml`cmo; \
done
@$(OCAMLC) -c main.ml
- @$(OCAMLC) -o main dynlink.cma main.cmo
- @$(OCAMLC) -o static -linkall plug1.cma plug2.cma -use-runtime $(PREFIX)/bin/ocamlrun
- @$(OCAMLC) -o custom -custom -linkall plug2.cma plug1.cma -I .
+ @$(OCAMLC) -o main dynlink.cma registry.cmo main.cmo
+ @$(OCAMLC) -o static -linkall registry.cmo plug1.cma plug2.cma -use-runtime $(PREFIX)/bin/ocamlrun
+ @$(OCAMLC) -o custom -custom -linkall registry.cmo plug2.cma plug1.cma -I .
run:
@printf " ... testing 'main'"
@@ -31,10 +32,10 @@ run:
@export LD_LIBRARY_PATH=`pwd` && ./custom > custom.result
@$(DIFF) custom.reference custom.result > /dev/null || (echo " => failed" && exit 1)
@echo " => passed"
-
+
promote: defaultpromote
clean: defaultclean
- @rm -f ./main ./static ./custom *.result
+ @rm -f ./main ./static ./custom *.result marshal.data
include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/lib-dynlink-bytecode/custom.reference b/testsuite/tests/lib-dynlink-bytecode/custom.reference
index f7eeb3aeb3..c9d2b57582 100644
--- a/testsuite/tests/lib-dynlink-bytecode/custom.reference
+++ b/testsuite/tests/lib-dynlink-bytecode/custom.reference
@@ -1,5 +1,5 @@
-ABCDEF
This is stub2, calling stub1:
This is stub1!
Ok!
This is stub1!
+ABCDEF
diff --git a/testsuite/tests/lib-dynlink-bytecode/main.ml b/testsuite/tests/lib-dynlink-bytecode/main.ml
index bd980f1022..725ee80c9d 100644
--- a/testsuite/tests/lib-dynlink-bytecode/main.ml
+++ b/testsuite/tests/lib-dynlink-bytecode/main.ml
@@ -1,17 +1,37 @@
+let f x = print_string "This is Main.f\n"; x
+
+let () = Registry.register f
+
+let _ =
Dynlink.init ();
Dynlink.allow_unsafe_modules true;
for i = 1 to Array.length Sys.argv - 1 do
let name = Sys.argv.(i) in
Printf.printf "Loading %s\n" name; flush stdout;
- try
+ try
if name.[0] = '-'
- then Dynlink.loadfile_private
- (String.sub name 1 (String.length name - 1))
+ then Dynlink.loadfile_private
+ (String.sub name 1 (String.length name - 1))
else Dynlink.loadfile name
with
| Dynlink.Error err ->
- Printf.printf "Dynlink error: %s\n"
- (Dynlink.error_message err)
+ Printf.printf "Dynlink error: %s\n"
+ (Dynlink.error_message err)
| exn ->
- Printf.printf "Error: %s\n" (Printexc.to_string exn)
- done
+ Printf.printf "Error: %s\n" (Printexc.to_string exn)
+ done;
+ flush stdout;
+ try
+ let oc = open_out_bin "marshal.data" in
+ Marshal.to_channel oc (Registry.get_functions()) [Marshal.Closures];
+ close_out oc;
+ let ic = open_in_bin "marshal.data" in
+ let l = (Marshal.from_channel ic : (int -> int) list) in
+ close_in ic;
+ List.iter
+ (fun f ->
+ let res = f 0 in
+ Printf.printf "Result is: %d\n" res)
+ l
+ with Failure s ->
+ Printf.printf "Failure: %s\n" s
diff --git a/testsuite/tests/lib-dynlink-bytecode/main.reference b/testsuite/tests/lib-dynlink-bytecode/main.reference
index df46049bf3..577292f9aa 100644
--- a/testsuite/tests/lib-dynlink-bytecode/main.reference
+++ b/testsuite/tests/lib-dynlink-bytecode/main.reference
@@ -1,7 +1,13 @@
Loading plug1.cma
+This is stub1!
ABCDEF
Loading plug2.cma
-This is stub1!
This is stub2, calling stub1:
This is stub1!
Ok!
+This is Plug2.f
+Result is: 2
+This is Plug1.f
+Result is: 1
+This is Main.f
+Result is: 0
diff --git a/testsuite/tests/lib-dynlink-bytecode/plug1.ml b/testsuite/tests/lib-dynlink-bytecode/plug1.ml
index 3246045170..d0490689fb 100644
--- a/testsuite/tests/lib-dynlink-bytecode/plug1.ml
+++ b/testsuite/tests/lib-dynlink-bytecode/plug1.ml
@@ -1,4 +1,7 @@
external stub1: unit -> string = "stub1"
+let f x = print_string "This is Plug1.f\n"; x + 1
+
+let () = Registry.register f
let () = print_endline (stub1 ())
diff --git a/testsuite/tests/lib-dynlink-bytecode/plug2.ml b/testsuite/tests/lib-dynlink-bytecode/plug2.ml
index 05f4fdaeda..350374e5b8 100644
--- a/testsuite/tests/lib-dynlink-bytecode/plug2.ml
+++ b/testsuite/tests/lib-dynlink-bytecode/plug2.ml
@@ -1,4 +1,7 @@
external stub2: unit -> unit = "stub2"
+let f x = print_string "This is Plug2.f\n"; x + 2
+
+let () = Registry.register f
let () = stub2 ()
diff --git a/testsuite/tests/lib-dynlink-bytecode/registry.ml b/testsuite/tests/lib-dynlink-bytecode/registry.ml
new file mode 100644
index 0000000000..e0f76423dd
--- /dev/null
+++ b/testsuite/tests/lib-dynlink-bytecode/registry.ml
@@ -0,0 +1,7 @@
+let functions = ref ([]: (int -> int) list)
+
+let register f =
+ functions := f :: !functions
+
+let get_functions () =
+ !functions
diff --git a/testsuite/tests/lib-dynlink-bytecode/static.reference b/testsuite/tests/lib-dynlink-bytecode/static.reference
index 32281bcf45..4faa129c34 100644
--- a/testsuite/tests/lib-dynlink-bytecode/static.reference
+++ b/testsuite/tests/lib-dynlink-bytecode/static.reference
@@ -1,5 +1,5 @@
-ABCDEF
This is stub1!
+ABCDEF
This is stub2, calling stub1:
This is stub1!
Ok!
diff --git a/testsuite/tests/lib-dynlink-bytecode/stub1.c b/testsuite/tests/lib-dynlink-bytecode/stub1.c
index 18ddf3f136..dcae562a41 100644
--- a/testsuite/tests/lib-dynlink-bytecode/stub1.c
+++ b/testsuite/tests/lib-dynlink-bytecode/stub1.c
@@ -5,7 +5,7 @@
value stub1() {
CAMLlocal1(x);
- printf("This is stub1!\n");
+ printf("This is stub1!\n"); fflush(stdout);
x = caml_copy_string("ABCDEF");
return x;
}
diff --git a/testsuite/tests/lib-dynlink-bytecode/stub2.c b/testsuite/tests/lib-dynlink-bytecode/stub2.c
index a118673543..4c6e6e3c21 100644
--- a/testsuite/tests/lib-dynlink-bytecode/stub2.c
+++ b/testsuite/tests/lib-dynlink-bytecode/stub2.c
@@ -6,8 +6,8 @@
extern value stub1();
value stub2() {
- printf("This is stub2, calling stub1:\n");
+ printf("This is stub2, calling stub1:\n"); fflush(stdout);
stub1();
- printf("Ok!\n");
+ printf("Ok!\n"); fflush(stdout);
return Val_unit;
}
diff --git a/testsuite/tests/lib-dynlink-csharp/Makefile b/testsuite/tests/lib-dynlink-csharp/Makefile
index c65b044e8e..b202772728 100644
--- a/testsuite/tests/lib-dynlink-csharp/Makefile
+++ b/testsuite/tests/lib-dynlink-csharp/Makefile
@@ -14,7 +14,7 @@ prepare:
bytecode:
@printf " ... testing 'bytecode':"
- @if [ ! `which $(CSC) > /dev/null` ]; then \
+ @if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
echo " => passed"; \
else \
$(OCAMLC) -output-obj -o main.dll dynlink.cma main.ml entry.c; \
@@ -25,7 +25,7 @@ bytecode:
bytecode-dll:
@printf " ... testing 'bytecode-dll':"
- @if [ ! `which $(CSC) > /dev/null` ]; then \
+ @if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
echo " => passed"; \
else \
$(OCAMLC) -output-obj -o main_obj.$(O) dynlink.cma entry.c main.ml; \
@@ -37,7 +37,7 @@ bytecode-dll:
native:
@printf " ... testing 'native':"
- @if [ ! `which $(CSC) > /dev/null` ]; then \
+ @if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
echo " => passed"; \
else \
$(OCAMLOPT) -output-obj -o main.dll dynlink.cmxa entry.c main.ml; \
@@ -48,7 +48,7 @@ native:
native-dll:
@printf " ... testing 'native-dll':"
- @if [ ! `which $(CSC) > /dev/null` ]; then \
+ @if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
echo " => passed"; \
else \
$(OCAMLOPT) -output-obj -o main_obj.$(O) dynlink.cmxa entry.c main.ml; \
diff --git a/testsuite/tests/lib-dynlink-csharp/bytecode.reference b/testsuite/tests/lib-dynlink-csharp/bytecode.reference
index 65592193a1..a76daa2309 100644
--- a/testsuite/tests/lib-dynlink-csharp/bytecode.reference
+++ b/testsuite/tests/lib-dynlink-csharp/bytecode.reference
@@ -1,4 +1,4 @@
-Now starting the Caml engine.
+Now starting the OCaml engine.
Main is running.
Loading ../../../otherlibs/bigarray/bigarray.cma
I'm the plugin.
diff --git a/testsuite/tests/lib-dynlink-csharp/main.cs b/testsuite/tests/lib-dynlink-csharp/main.cs
index a03bfd60ab..5cbb8e8689 100755
--- a/testsuite/tests/lib-dynlink-csharp/main.cs
+++ b/testsuite/tests/lib-dynlink-csharp/main.cs
@@ -5,7 +5,7 @@ public class M {
public static extern void start_caml_engine();
public static void Main() {
- System.Console.WriteLine("Now starting the Caml engine.");
+ System.Console.WriteLine("Now starting the OCaml engine.");
start_caml_engine();
}
}
diff --git a/testsuite/tests/lib-dynlink-csharp/main.ml b/testsuite/tests/lib-dynlink-csharp/main.ml
index fd48914a6f..ad46188277 100755
--- a/testsuite/tests/lib-dynlink-csharp/main.ml
+++ b/testsuite/tests/lib-dynlink-csharp/main.ml
@@ -17,7 +17,6 @@ let () =
"../../../otherlibs/bigarray/bigarray.cma",
"plugin.cmo"
in
- load s1;
+ load s1;
load s2;
print_endline "OK."
-
diff --git a/testsuite/tests/lib-dynlink-csharp/native.reference b/testsuite/tests/lib-dynlink-csharp/native.reference
index b6c9e5c430..684f979a8f 100644
--- a/testsuite/tests/lib-dynlink-csharp/native.reference
+++ b/testsuite/tests/lib-dynlink-csharp/native.reference
@@ -1,4 +1,4 @@
-Now starting the Caml engine.
+Now starting the OCaml engine.
Main is running.
Loading ../../../otherlibs/bigarray/bigarray.cmxs
I'm the plugin.
diff --git a/testsuite/tests/lib-dynlink-csharp/plugin.ml b/testsuite/tests/lib-dynlink-csharp/plugin.ml
index 39c46f3a1c..aacf9f21bc 100755
--- a/testsuite/tests/lib-dynlink-csharp/plugin.ml
+++ b/testsuite/tests/lib-dynlink-csharp/plugin.ml
@@ -1,4 +1,4 @@
let f x = x.{2}
-
+
let () =
print_endline "I'm the plugin."
diff --git a/testsuite/tests/lib-dynlink-native/.ignore b/testsuite/tests/lib-dynlink-native/.ignore
index 4efb7cbc77..775ccb418f 100644
--- a/testsuite/tests/lib-dynlink-native/.ignore
+++ b/testsuite/tests/lib-dynlink-native/.ignore
@@ -1,3 +1,5 @@
mypack.pack.s
result
main
+main.exe
+marshal.data
diff --git a/testsuite/tests/lib-dynlink-native/Makefile b/testsuite/tests/lib-dynlink-native/Makefile
index 902717e784..9aac1dbeca 100644
--- a/testsuite/tests/lib-dynlink-native/Makefile
+++ b/testsuite/tests/lib-dynlink-native/Makefile
@@ -16,7 +16,7 @@ compile: $(PLUGINS) main mylib.so
run:
@printf " ... testing 'main'"
- @./main plugin_thread.so > result
+ @./main plugin.so plugin2.so plugin_thread.so > result
@$(DIFF) reference result > /dev/null || (echo " => failed" && exit 1)
@echo " => passed"
diff --git a/testsuite/tests/lib-dynlink-native/api.ml b/testsuite/tests/lib-dynlink-native/api.ml
index 843a1c78f7..cd735abe3a 100644
--- a/testsuite/tests/lib-dynlink-native/api.ml
+++ b/testsuite/tests/lib-dynlink-native/api.ml
@@ -1,7 +1,7 @@
let mods = ref []
let reg_mod name =
- if List.mem name !mods then
+ if List.mem name !mods then
Printf.printf "Reloading module %s\n" name
else (
mods := name :: !mods;
@@ -14,5 +14,7 @@ let cbs = ref []
let add_cb f = cbs := f :: !cbs
let runall () = List.iter (fun f -> f ()) !cbs
+(*
let () =
at_exit runall
+*)
diff --git a/testsuite/tests/lib-dynlink-native/b.ml b/testsuite/tests/lib-dynlink-native/b.ml
index 58149e22f1..afa1bef051 100755
--- a/testsuite/tests/lib-dynlink-native/b.ml
+++ b/testsuite/tests/lib-dynlink-native/b.ml
@@ -2,4 +2,3 @@ let () =
print_endline "B is running";
incr A.x;
Printf.printf "A.x = %i\n" !A.x
-
diff --git a/testsuite/tests/lib-dynlink-native/bug.ml b/testsuite/tests/lib-dynlink-native/bug.ml
index 02828378d0..31c0f02595 100644
--- a/testsuite/tests/lib-dynlink-native/bug.ml
+++ b/testsuite/tests/lib-dynlink-native/bug.ml
@@ -1,2 +1,2 @@
-let () = try raise (Invalid_argument "X") with Invalid_argument s ->
+let () = try raise (Invalid_argument "X") with Invalid_argument s ->
raise (Invalid_argument (s ^ s))
diff --git a/testsuite/tests/lib-dynlink-native/main.ml b/testsuite/tests/lib-dynlink-native/main.ml
index b21253fb2d..8c738aeb70 100644
--- a/testsuite/tests/lib-dynlink-native/main.ml
+++ b/testsuite/tests/lib-dynlink-native/main.ml
@@ -1,20 +1,32 @@
+let () =
+ Api.add_cb (fun () -> print_endline "Callback from main")
+
let () =
Dynlink.init ();
Dynlink.allow_unsafe_modules true;
for i = 1 to Array.length Sys.argv - 1 do
let name = Sys.argv.(i) in
Printf.printf "Loading %s\n" name; flush stdout;
- try
+ try
if name.[0] = '-'
- then Dynlink.loadfile_private
- (String.sub name 1 (String.length name - 1))
+ then Dynlink.loadfile_private
+ (String.sub name 1 (String.length name - 1))
else Dynlink.loadfile name
with
| Dynlink.Error err ->
- Printf.printf "Dynlink error: %s\n"
- (Dynlink.error_message err)
+ Printf.printf "Dynlink error: %s\n"
+ (Dynlink.error_message err)
| exn ->
- Printf.printf "Error: %s\n" (Printexc.to_string exn)
- done
-
-
+ Printf.printf "Error: %s\n" (Printexc.to_string exn)
+ done;
+ flush stdout;
+ try
+ let oc = open_out_bin "marshal.data" in
+ Marshal.to_channel oc !Api.cbs [Marshal.Closures];
+ close_out oc;
+ let ic = open_in_bin "marshal.data" in
+ let l = (Marshal.from_channel ic : (unit -> unit) list) in
+ close_in ic;
+ List.iter (fun f -> f()) l
+ with Failure s ->
+ Printf.printf "Failure: %s\n" s
diff --git a/testsuite/tests/lib-dynlink-native/packed1.ml b/testsuite/tests/lib-dynlink-native/packed1.ml
index 8f00e39dab..2ee8363391 100644
--- a/testsuite/tests/lib-dynlink-native/packed1.ml
+++ b/testsuite/tests/lib-dynlink-native/packed1.ml
@@ -3,4 +3,3 @@ let () =
let bla = Sys.argv.(0) ^ "XXX"
let mykey = Sys.argv.(0)
-
diff --git a/testsuite/tests/lib-dynlink-native/plugin.ml b/testsuite/tests/lib-dynlink-native/plugin.ml
index 501f1bfd32..d9b0574f1b 100644
--- a/testsuite/tests/lib-dynlink-native/plugin.ml
+++ b/testsuite/tests/lib-dynlink-native/plugin.ml
@@ -6,5 +6,6 @@ let facts = [ fact 1; fact 2; fact 3; fact (Random.int 4) ]
let () =
Api.reg_mod "Plugin";
- print_endline "COUCOU";
+ Api.add_cb (fun () -> print_endline "Callback from plugin");
+ print_endline "COUCOU";
()
diff --git a/testsuite/tests/lib-dynlink-native/plugin2.ml b/testsuite/tests/lib-dynlink-native/plugin2.ml
index daecace842..109c129d1a 100644
--- a/testsuite/tests/lib-dynlink-native/plugin2.ml
+++ b/testsuite/tests/lib-dynlink-native/plugin2.ml
@@ -2,7 +2,7 @@
let () =
Api.reg_mod "Plugin2";
+ Api.add_cb (fun () -> print_endline "Callback from plugin2");
(* let i = ex 3 in*)
List.iter (fun i -> Printf.printf "%i\n" i) Plugin.facts;
- Printf.printf "XXX\n";
- raise Exit
+ Printf.printf "XXX\n"
diff --git a/testsuite/tests/lib-dynlink-native/plugin4.ml b/testsuite/tests/lib-dynlink-native/plugin4.ml
index ccf4642fbb..a9f86e60a2 100644
--- a/testsuite/tests/lib-dynlink-native/plugin4.ml
+++ b/testsuite/tests/lib-dynlink-native/plugin4.ml
@@ -1,5 +1,3 @@
let () =
Printf.printf "time = %f\n" (Unix.time ());
Api.reg_mod "Plugin"
-
-
diff --git a/testsuite/tests/lib-dynlink-native/plugin_ref.ml b/testsuite/tests/lib-dynlink-native/plugin_ref.ml
index 06001241c6..60f127357c 100644
--- a/testsuite/tests/lib-dynlink-native/plugin_ref.ml
+++ b/testsuite/tests/lib-dynlink-native/plugin_ref.ml
@@ -2,10 +2,9 @@ let x = ref 0
let () =
Api.reg_mod "Plugin_ref";
-
- Api.add_cb
+
+ Api.add_cb
(fun () ->
Printf.printf "current value for ref = %i\n" !x;
incr x
)
-
diff --git a/testsuite/tests/lib-dynlink-native/plugin_thread.ml b/testsuite/tests/lib-dynlink-native/plugin_thread.ml
index a66b958f2b..6e3d9d485a 100644
--- a/testsuite/tests/lib-dynlink-native/plugin_thread.ml
+++ b/testsuite/tests/lib-dynlink-native/plugin_thread.ml
@@ -1,21 +1,15 @@
let () =
Api.reg_mod "Plugin_thread";
let _t =
- Thread.create
+ Thread.create
(fun () ->
- for i = 1 to 5 do
- print_endline "Thread"; flush stdout;
- Thread.delay 1.;
- done
+ for i = 1 to 5 do
+ print_endline "Thread"; flush stdout;
+ Thread.delay 1.;
+ done
) ()
in
for i = 1 to 10 do
print_endline "Thread"; flush stdout;
Thread.delay 0.50;
done
-
-
-
-
-
-
diff --git a/testsuite/tests/lib-dynlink-native/reference b/testsuite/tests/lib-dynlink-native/reference
index c6adb139ea..e9e4ee45dd 100644
--- a/testsuite/tests/lib-dynlink-native/reference
+++ b/testsuite/tests/lib-dynlink-native/reference
@@ -1,3 +1,13 @@
+Loading plugin.so
+Registering module Plugin
+COUCOU
+Loading plugin2.so
+Registering module Plugin2
+1
+2
+6
+1
+XXX
Loading plugin_thread.so
Registering module Plugin_thread
Thread
@@ -15,3 +25,6 @@ Thread
Thread
Thread
Thread
+Callback from plugin2
+Callback from plugin
+Callback from main
diff --git a/testsuite/tests/lib-dynlink-native/sub/plugin.ml b/testsuite/tests/lib-dynlink-native/sub/plugin.ml
index 2a41493c04..d7faf9c8e2 100644
--- a/testsuite/tests/lib-dynlink-native/sub/plugin.ml
+++ b/testsuite/tests/lib-dynlink-native/sub/plugin.ml
@@ -4,4 +4,3 @@ let facts = [ fact 1; fact 2; fact 3; fact 4; fact 5 ]
let () =
Api.reg_mod "Plugin'"
-
diff --git a/testsuite/tests/lib-dynlink-native/sub/plugin3.ml b/testsuite/tests/lib-dynlink-native/sub/plugin3.ml
index 7b0b099fe7..82c9e4866e 100644
--- a/testsuite/tests/lib-dynlink-native/sub/plugin3.ml
+++ b/testsuite/tests/lib-dynlink-native/sub/plugin3.ml
@@ -1,3 +1,2 @@
let () =
ignore (Api.f 10)
-
diff --git a/testsuite/tests/lib-hashtbl/hfun.ml b/testsuite/tests/lib-hashtbl/hfun.ml
index 5699587cef..8b8205e7b2 100644
--- a/testsuite/tests/lib-hashtbl/hfun.ml
+++ b/testsuite/tests/lib-hashtbl/hfun.ml
@@ -39,12 +39,3 @@ let _ =
printf "[10..0]\t\t%08x\n" (Hashtbl.hash [10;9;8;7;6;5;4;3;2;1;0]);
()
-
-
-
-
-
-
-
-
-
diff --git a/testsuite/tests/lib-hashtbl/htbl.ml b/testsuite/tests/lib-hashtbl/htbl.ml
index 84a71beb77..f58156962c 100644
--- a/testsuite/tests/lib-hashtbl/htbl.ml
+++ b/testsuite/tests/lib-hashtbl/htbl.ml
@@ -78,6 +78,7 @@ module HofM (M: Map.S) : Hashtbl.S with type key = M.key =
type 'a t = (key, 'a) Hashtbl.t
let create s = Hashtbl.create s
let clear = Hashtbl.clear
+ let reset = Hashtbl.reset
let copy = Hashtbl.copy
let add = Hashtbl.add
let remove = Hashtbl.remove
@@ -189,4 +190,3 @@ let _ =
TSP.test (pair_data d);
printf "-- Lists of strings\n%!";
TSL.test (list_data d)
-
diff --git a/testsuite/tests/lib-marshal/intext.ml b/testsuite/tests/lib-marshal/intext.ml
index 5af1e252e3..80fe5b7704 100644
--- a/testsuite/tests/lib-marshal/intext.ml
+++ b/testsuite/tests/lib-marshal/intext.ml
@@ -1,5 +1,7 @@
(* Test for output_value / input_value *)
+let max_data_depth = 500000
+
type t = A | B of int | C of float | D of string | E of char
| F of t | G of t * t | H of int * t | I of t * float | J
@@ -425,6 +427,103 @@ let rec check_big n x =
| _ -> false
end
+(* Test for really deep data structures *)
+let test_deep () =
+ (* Right-leaning *)
+ let rec loop acc i =
+ if i < max_data_depth
+ then loop (i :: acc) (i+1)
+ else acc in
+ let x = loop [] 0 in
+ let s = Marshal.to_string x [] in
+ test 425 (Marshal.from_string s 0 = x);
+ (* Left-leaning *)
+ let rec loop acc i =
+ if i < max_data_depth
+ then loop (G(acc, B i)) (i+1)
+ else acc in
+ let x = loop A 0 in
+ let s = Marshal.to_string x [] in
+ test 426 (Marshal.from_string s 0 = x)
+
+(* Test for objects *)
+class foo = object (self : 'self)
+ val data1 = "foo"
+ val data2 = "bar"
+ val data3 = 42L
+ method test1 = data1 ^ data2
+ method test2 = false
+ method test3 = self#test1
+ method test4 = data3
+end
+
+class bar = object (self : 'self)
+ inherit foo as super
+ val! data2 = "test5"
+ val data4 = "test3"
+ val data5 = "test4"
+ method test1 =
+ data1
+ ^ data2
+ ^ data4
+ ^ data5
+ ^ Int64.to_string self#test4
+end
+
+class foobar = object (self : 'self)
+ inherit foo as super
+ inherit! bar
+end
+
+(* Test for objects *)
+let test_objects () =
+ let x = new foo in
+ let s = Marshal.to_string x [Marshal.Closures] in
+ let x = Marshal.from_string s 0 in
+ test 500 (x#test1 = "foobar");
+ test 501 (x#test2 = false);
+ test 502 (x#test3 = "foobar");
+ test 503 (x#test4 = 42L);
+ let x = new bar in
+ let s = Marshal.to_string x [Marshal.Closures] in
+ let x = Marshal.from_string s 0 in
+ test 504 (x#test1 = "footest5test3test442");
+ test 505 (x#test2 = false);
+ test 506 (x#test3 = "footest5test3test442");
+ test 507 (x#test4 = 42L);
+ let x0 = new foobar in
+ let s = Marshal.to_string x0 [Marshal.Closures] in
+ let x = Marshal.from_string s 0 in
+ test 508 (x#test1 = "footest5test3test442");
+ test 509 (x#test2 = false);
+ test 510 (x#test3 = "footest5test3test442");
+ test 511 (x#test4 = 42L);
+ test 512 (Oo.id x = Oo.id x0 + 1) (* PR#5610 *)
+
+(* Test for infix pointers *)
+let test_infix () =
+ let t = true and
+ f = false in
+ let rec odd n =
+ if n = 0
+ then f
+ else even (n-1)
+ and even n =
+ if n = 0
+ then t
+ else odd (n-1)
+ in
+ let s = Marshal.to_string (odd, even) [Marshal.Closures] in
+ let (odd', even': (int -> bool) * (int -> bool)) = Marshal.from_string s 0 in
+ test 600 (odd' 41 = true);
+ test 601 (odd' 41 = odd 41);
+ test 602 (odd' 142 = false);
+ test 603 (odd' 142 = odd 142);
+ test 604 (even' 41 = false);
+ test 605 (even' 41 = even 41);
+ test 606 (even' 142 = true);
+ test 607 (even' 142 = even 142)
+
let main() =
if Array.length Sys.argv <= 2 then begin
test_out "intext.data"; test_in "intext.data";
@@ -433,7 +532,10 @@ let main() =
test_string();
test_buffer();
test_size();
- test_block()
+ test_block();
+ test_deep();
+ test_objects();
+ test_infix ()
end else
if Sys.argv.(1) = "make" then begin
let n = int_of_string Sys.argv.(2) in
diff --git a/testsuite/tests/lib-marshal/intext.reference b/testsuite/tests/lib-marshal/intext.reference
index 8def6706e7..6933ef3512 100644
--- a/testsuite/tests/lib-marshal/intext.reference
+++ b/testsuite/tests/lib-marshal/intext.reference
@@ -147,3 +147,26 @@ Test 421 passed.
Test 422 passed.
Test 423 passed.
Test 424 passed.
+Test 425 passed.
+Test 426 passed.
+Test 500 passed.
+Test 501 passed.
+Test 502 passed.
+Test 503 passed.
+Test 504 passed.
+Test 505 passed.
+Test 506 passed.
+Test 507 passed.
+Test 508 passed.
+Test 509 passed.
+Test 510 passed.
+Test 511 passed.
+Test 512 passed.
+Test 600 passed.
+Test 601 passed.
+Test 602 passed.
+Test 603 passed.
+Test 604 passed.
+Test 605 passed.
+Test 606 passed.
+Test 607 passed.
diff --git a/testsuite/tests/lib-marshal/intextaux.c b/testsuite/tests/lib-marshal/intextaux.c
index 9225b90bc2..fca1fb385d 100644
--- a/testsuite/tests/lib-marshal/intextaux.c
+++ b/testsuite/tests/lib-marshal/intextaux.c
@@ -3,7 +3,7 @@
value marshal_to_block(value vbuf, value vlen, value v, value vflags)
{
- return Val_long(output_value_to_block(v, vflags,
+ return Val_long(output_value_to_block(v, vflags,
(char *) vbuf, Long_val(vlen)));
}
diff --git a/testsuite/tests/lib-num/test_big_ints.ml b/testsuite/tests/lib-num/test_big_ints.ml
index badc521601..9d7262060b 100644
--- a/testsuite/tests/lib-num/test_big_ints.ml
+++ b/testsuite/tests/lib-num/test_big_ints.ml
@@ -56,52 +56,52 @@ testing_function "add_big_int";;
test 1
eq_big_int (add_big_int zero_big_int zero_big_int, zero_big_int);;
test 2
-eq_big_int (add_big_int zero_big_int (big_int_of_int 1),
+eq_big_int (add_big_int zero_big_int (big_int_of_int 1),
big_int_of_int 1);;
test 3
-eq_big_int (add_big_int (big_int_of_int 1) zero_big_int,
+eq_big_int (add_big_int (big_int_of_int 1) zero_big_int,
big_int_of_int 1);;
test 4
-eq_big_int (add_big_int zero_big_int (big_int_of_int (-1)),
+eq_big_int (add_big_int zero_big_int (big_int_of_int (-1)),
big_int_of_int (-1));;
test 5
-eq_big_int (add_big_int (big_int_of_int (-1)) zero_big_int,
+eq_big_int (add_big_int (big_int_of_int (-1)) zero_big_int,
big_int_of_int (-1));;
test 6
-eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int 1),
+eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int 1),
big_int_of_int 2);;
test 7
-eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int 2),
+eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int 2),
big_int_of_int 3);;
test 8
-eq_big_int (add_big_int (big_int_of_int 2) (big_int_of_int 1),
+eq_big_int (add_big_int (big_int_of_int 2) (big_int_of_int 1),
big_int_of_int 3);;
test 9
-eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int (-1)),
+eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int (-1)),
big_int_of_int (-2));;
test 10
-eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int (-2)),
+eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int (-2)),
big_int_of_int (-3));;
test 11
-eq_big_int (add_big_int (big_int_of_int (-2)) (big_int_of_int (-1)),
+eq_big_int (add_big_int (big_int_of_int (-2)) (big_int_of_int (-1)),
big_int_of_int (-3));;
test 12
-eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int (-1)),
+eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int (-1)),
zero_big_int);;
test 13
-eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int 1),
+eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int 1),
zero_big_int);;
test 14
-eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int (-2)),
+eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int (-2)),
big_int_of_int (-1));;
test 15
-eq_big_int (add_big_int (big_int_of_int (-2)) (big_int_of_int 1),
+eq_big_int (add_big_int (big_int_of_int (-2)) (big_int_of_int 1),
big_int_of_int (-1));;
test 16
-eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int 2),
+eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int 2),
big_int_of_int 1);;
test 17
-eq_big_int (add_big_int (big_int_of_int 2) (big_int_of_int (-1)),
+eq_big_int (add_big_int (big_int_of_int 2) (big_int_of_int (-1)),
big_int_of_int 1);;
@@ -110,52 +110,52 @@ testing_function "sub_big_int";;
test 1
eq_big_int (sub_big_int zero_big_int zero_big_int, zero_big_int);;
test 2
-eq_big_int (sub_big_int zero_big_int (big_int_of_int 1),
+eq_big_int (sub_big_int zero_big_int (big_int_of_int 1),
big_int_of_int (-1));;
test 3
-eq_big_int (sub_big_int (big_int_of_int 1) zero_big_int,
+eq_big_int (sub_big_int (big_int_of_int 1) zero_big_int,
big_int_of_int 1);;
test 4
-eq_big_int (sub_big_int zero_big_int (big_int_of_int (-1)),
+eq_big_int (sub_big_int zero_big_int (big_int_of_int (-1)),
big_int_of_int 1);;
test 5
-eq_big_int (sub_big_int (big_int_of_int (-1)) zero_big_int,
+eq_big_int (sub_big_int (big_int_of_int (-1)) zero_big_int,
big_int_of_int (-1));;
test 6
-eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int 1),
+eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int 1),
zero_big_int);;
test 7
-eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int 2),
+eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int 2),
big_int_of_int (-1));;
test 8
-eq_big_int (sub_big_int (big_int_of_int 2) (big_int_of_int 1),
+eq_big_int (sub_big_int (big_int_of_int 2) (big_int_of_int 1),
big_int_of_int 1);;
test 9
-eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int (-1)),
+eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int (-1)),
zero_big_int);;
test 10
-eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int (-2)),
+eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int (-2)),
big_int_of_int 1);;
test 11
-eq_big_int (sub_big_int (big_int_of_int (-2)) (big_int_of_int (-1)),
+eq_big_int (sub_big_int (big_int_of_int (-2)) (big_int_of_int (-1)),
big_int_of_int (-1));;
test 12
-eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int (-1)),
+eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int (-1)),
big_int_of_int 2);;
test 13
-eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int 1),
+eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int 1),
big_int_of_int (-2));;
test 14
-eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int (-2)),
+eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int (-2)),
big_int_of_int 3);;
test 15
-eq_big_int (sub_big_int (big_int_of_int (-2)) (big_int_of_int 1),
+eq_big_int (sub_big_int (big_int_of_int (-2)) (big_int_of_int 1),
big_int_of_int (-3));;
test 16
-eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int 2),
+eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int 2),
big_int_of_int (-3));;
test 17
-eq_big_int (sub_big_int (big_int_of_int 2) (big_int_of_int (-1)),
+eq_big_int (sub_big_int (big_int_of_int 2) (big_int_of_int (-1)),
big_int_of_int 3);;
testing_function "mult_int_big_int";;
@@ -172,21 +172,21 @@ eq_big_int (mult_int_big_int 2 (big_int_of_int 3), big_int_of_int 6);;
testing_function "mult_big_int";;
test 1
-eq_big_int (mult_big_int zero_big_int zero_big_int,
+eq_big_int (mult_big_int zero_big_int zero_big_int,
zero_big_int);;
test 2
-eq_big_int (mult_big_int (big_int_of_int 2) (big_int_of_int 3),
+eq_big_int (mult_big_int (big_int_of_int 2) (big_int_of_int 3),
big_int_of_int 6);;
test 3
-eq_big_int (mult_big_int (big_int_of_int 2) (big_int_of_int (-3)),
+eq_big_int (mult_big_int (big_int_of_int 2) (big_int_of_int (-3)),
big_int_of_int (-6));;
-test 4
-eq_big_int (mult_big_int (big_int_of_string "12724951")
- (big_int_of_string "81749606400"),
+test 4
+eq_big_int (mult_big_int (big_int_of_string "12724951")
+ (big_int_of_string "81749606400"),
big_int_of_string "1040259735709286400");;
-test 5
-eq_big_int (mult_big_int (big_int_of_string "26542080")
- (big_int_of_string "81749606400"),
+test 5
+eq_big_int (mult_big_int (big_int_of_string "26542080")
+ (big_int_of_string "81749606400"),
big_int_of_string "2169804593037312000");;
testing_function "quomod_big_int";;
@@ -201,14 +201,14 @@ let (quotient, modulo) =
test 3 eq_big_int (quotient, big_int_of_int (-1)) &&
test 4 eq_big_int (modulo, zero_big_int);;
-let (quotient, modulo) =
+let (quotient, modulo) =
quomod_big_int (big_int_of_int (-1)) (big_int_of_int 1) in
- test 5 eq_big_int (quotient, big_int_of_int (-1)) &&
+ test 5 eq_big_int (quotient, big_int_of_int (-1)) &&
test 6 eq_big_int (modulo, zero_big_int);;
-let (quotient, modulo) =
+let (quotient, modulo) =
quomod_big_int (big_int_of_int 3) (big_int_of_int 2) in
- test 7 eq_big_int (quotient, big_int_of_int 1) &&
+ test 7 eq_big_int (quotient, big_int_of_int 1) &&
test 8 eq_big_int (modulo, big_int_of_int 1);;
let (quotient, modulo) =
@@ -221,12 +221,12 @@ let (quotient, modulo) =
test 11 eq_big_int (quotient, big_int_of_int (-2)) &&
test 12 eq_big_int (modulo, big_int_of_int 1);;
-let (quotient, modulo) =
+let (quotient, modulo) =
quomod_big_int (big_int_of_int 1) (big_int_of_int 2) in
- test 13 eq_big_int (quotient, zero_big_int) &&
+ test 13 eq_big_int (quotient, zero_big_int) &&
test 14 eq_big_int (modulo, big_int_of_int 1);;
-let (quotient, modulo) =
+let (quotient, modulo) =
quomod_big_int (big_int_of_int (-1)) (big_int_of_int 3) in
test 15 eq_big_int (quotient, minus_big_int unit_big_int) &&
test 16 eq_big_int (modulo, big_int_of_int 2);;
@@ -236,22 +236,22 @@ failwith_test 17
Division_by_zero
;;
-let (quotient, modulo) =
+let (quotient, modulo) =
quomod_big_int (big_int_of_int 10) (big_int_of_int 20) in
test 18 eq_big_int (quotient, big_int_of_int 0) &&
test 19 eq_big_int (modulo, big_int_of_int 10);;
-let (quotient, modulo) =
+let (quotient, modulo) =
quomod_big_int (big_int_of_int (-10)) (big_int_of_int 20) in
test 20 eq_big_int (quotient, big_int_of_int (-1)) &&
test 21 eq_big_int (modulo, big_int_of_int 10);;
-let (quotient, modulo) =
+let (quotient, modulo) =
quomod_big_int (big_int_of_int 10) (big_int_of_int (-20)) in
test 22 eq_big_int (quotient, big_int_of_int 0) &&
test 23 eq_big_int (modulo, big_int_of_int 10);;
-let (quotient, modulo) =
+let (quotient, modulo) =
quomod_big_int (big_int_of_int (-10)) (big_int_of_int (-20)) in
test 24 eq_big_int (quotient, big_int_of_int 1) &&
test 25 eq_big_int (modulo, big_int_of_int 10);;
@@ -260,28 +260,28 @@ let (quotient, modulo) =
testing_function "gcd_big_int";;
test 1
-eq_big_int (gcd_big_int zero_big_int zero_big_int,
+eq_big_int (gcd_big_int zero_big_int zero_big_int,
zero_big_int);;
test 2
-eq_big_int (gcd_big_int zero_big_int (big_int_of_int 1),
+eq_big_int (gcd_big_int zero_big_int (big_int_of_int 1),
big_int_of_int 1);;
test 3
-eq_big_int (gcd_big_int (big_int_of_int 1) zero_big_int,
+eq_big_int (gcd_big_int (big_int_of_int 1) zero_big_int,
big_int_of_int 1);;
test 4
-eq_big_int (gcd_big_int (big_int_of_int 1) (big_int_of_int 2),
+eq_big_int (gcd_big_int (big_int_of_int 1) (big_int_of_int 2),
big_int_of_int 1);;
test 5
-eq_big_int (gcd_big_int (big_int_of_int 2) (big_int_of_int 1),
+eq_big_int (gcd_big_int (big_int_of_int 2) (big_int_of_int 1),
big_int_of_int 1);;
test 6
-eq_big_int (gcd_big_int (big_int_of_int 1) (big_int_of_int 1),
+eq_big_int (gcd_big_int (big_int_of_int 1) (big_int_of_int 1),
big_int_of_int 1);;
test 7
-eq_big_int (gcd_big_int (big_int_of_int 9) (big_int_of_int 16),
+eq_big_int (gcd_big_int (big_int_of_int 9) (big_int_of_int 16),
big_int_of_int 1);;
test 8
-eq_big_int (gcd_big_int (big_int_of_int 12) (big_int_of_int 16),
+eq_big_int (gcd_big_int (big_int_of_int 12) (big_int_of_int 16),
big_int_of_int 4);;
for i = 9 to 28 do
@@ -404,7 +404,7 @@ let bi1 = big_int_of_string (implode (rev l)) in
let bi2 = big_int_of_string (implode (rev ("3" :: tl l))) in
test 10
-eq_big_int (bi1, (add_big_int (mult_big_int bi2 (big_int_of_string "10"))
+eq_big_int (bi1, (add_big_int (mult_big_int bi2 (big_int_of_string "10"))
(big_int_of_string "2")))
(* test 11
&&
@@ -444,7 +444,7 @@ test 2
eq_big_int (big_int_of_nat (power_base_int 10 8), big_int_of_int 100000000)
;;
test 3
-eq_big_int (big_int_of_nat (power_base_int 2 (length_of_int + 2)),
+eq_big_int (big_int_of_nat (power_base_int 2 (length_of_int + 2)),
big_int_of_nat (let nat = make_nat 2 in
set_digit_nat nat 1 1;
nat))
@@ -933,12 +933,11 @@ test 3 eq_int (Hashtbl.hash (minus_big_int unit_big_int),
161678167);;
test 4 eq_int (Hashtbl.hash (big_int_of_string "123456789123456789"),
755417385);;
-test 5 eq_int (Hashtbl.hash (sub_big_int
+test 5 eq_int (Hashtbl.hash (sub_big_int
(big_int_of_string "123456789123456789")
(big_int_of_string "123456789123456789")),
955772237);;
-test 6 eq_int (Hashtbl.hash (sub_big_int
+test 6 eq_int (Hashtbl.hash (sub_big_int
(big_int_of_string "123456789123456789")
(big_int_of_string "123456789123456788")),
992063522);;
-
diff --git a/testsuite/tests/lib-num/test_nats.ml b/testsuite/tests/lib-num/test_nats.ml
index b47b39f8ee..739ed37e90 100644
--- a/testsuite/tests/lib-num/test_nats.ml
+++ b/testsuite/tests/lib-num/test_nats.ml
@@ -3,7 +3,7 @@ open Nat;;
(* Can compare nats less than 2**32 *)
let equal_nat n1 n2 =
- eq_nat n1 0 (num_digits_nat n1 0 1)
+ eq_nat n1 0 (num_digits_nat n1 0 1)
n2 0 (num_digits_nat n2 0 1);;
testing_function "num_digits_nat";;
@@ -108,10 +108,10 @@ let set_mult_digit_nat n1 d1 l1 n2 d2 l2 n3 d3 =
let s = "3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333" in
test 21 equal_nat (
nat_of_string s,
-(let nat = make_nat 15 in
+(let nat = make_nat 15 in
set_digit_nat nat 0 3;
- set_mult_digit_nat nat 0 15
- (nat_of_string (String.sub s 0 135)) 0 14
+ set_mult_digit_nat nat 0 15
+ (nat_of_string (String.sub s 0 135)) 0 14
(nat_of_int 10) 0;
nat))
;;
diff --git a/testsuite/tests/lib-num/test_nums.ml b/testsuite/tests/lib-num/test_nums.ml
index b26001bc76..24b5d264a5 100644
--- a/testsuite/tests/lib-num/test_nums.ml
+++ b/testsuite/tests/lib-num/test_nums.ml
@@ -12,10 +12,10 @@ eq_num (add_num (Int 1) (Int 3), Int 4);;
test 2
eq_num (add_num (Int 1) (Big_int (big_int_of_int 3)), Int 4);;
test 3
-eq_num (add_num (Int 1) (Ratio (ratio_of_string "3/4")),
+eq_num (add_num (Int 1) (Ratio (ratio_of_string "3/4")),
Ratio (ratio_of_string "7/4"));;
test 4
-eq_num (add_num (Big_int (big_int_of_int 1)) (Ratio (ratio_of_string "3/4")),
+eq_num (add_num (Big_int (big_int_of_int 1)) (Ratio (ratio_of_string "3/4")),
Ratio (ratio_of_string "7/4"));;
test 5
eq_num (add_num (Big_int (big_int_of_int 1)) (Big_int (big_int_of_int 3)),
@@ -27,10 +27,10 @@ test 7
eq_num (add_num (Ratio (ratio_of_string "2/3")) (Ratio (ratio_of_string "3/4")),
Ratio (ratio_of_string "17/12"));;
test 8
-eq_num (add_num (Int least_int) (Int 1),
+eq_num (add_num (Int least_int) (Int 1),
Int (- (pred biggest_int)));;
test 9
-eq_num (add_num (Int biggest_int) (Int 1),
+eq_num (add_num (Int biggest_int) (Int 1),
Big_int (minus_big_int (pred_big_int (big_int_of_int least_int))));;
testing_function "sub_num";;
@@ -40,10 +40,10 @@ eq_num (sub_num (Int 1) (Int 3), Int (-2));;
test 2
eq_num (sub_num (Int 1) (Big_int (big_int_of_int 3)), Int (-2));;
test 3
-eq_num (sub_num (Int 1) (Ratio (ratio_of_string "3/4")),
+eq_num (sub_num (Int 1) (Ratio (ratio_of_string "3/4")),
Ratio (ratio_of_string "1/4"));;
test 4
-eq_num (sub_num (Big_int (big_int_of_int 1)) (Ratio (ratio_of_string "3/4")),
+eq_num (sub_num (Big_int (big_int_of_int 1)) (Ratio (ratio_of_string "3/4")),
Ratio (ratio_of_string "1/4"));;
test 5
eq_num (sub_num (Big_int (big_int_of_int 1)) (Big_int (big_int_of_int 3)),
@@ -55,7 +55,7 @@ test 8
eq_num (sub_num (Ratio (ratio_of_string "2/3")) (Ratio (ratio_of_string "3/4")),
Ratio (ratio_of_string "-1/12"));;
test 9
-eq_num (sub_num (Int least_int) (Int (-1)),
+eq_num (sub_num (Int least_int) (Int (-1)),
Int (- (pred biggest_int)));;
test 10
eq_num (sub_num (Int (-1)) (Int biggest_int), pred_num (Int least_int));;
@@ -68,12 +68,12 @@ test 2
eq_num (mult_num (Int 127) (Int (int_of_string "257")),
Int (int_of_string "32639"));;
test 3
-eq_num (mult_num (Int 257) (Int (int_of_string "260")),
+eq_num (mult_num (Int 257) (Int (int_of_string "260")),
Big_int (big_int_of_string "66820"));;
test 4
eq_num (mult_num (Int 2) (Big_int (big_int_of_int 3)), Int 6);;
test 5
-eq_num (mult_num (Int 10) (Ratio (ratio_of_string "3/4")),
+eq_num (mult_num (Int 10) (Ratio (ratio_of_string "3/4")),
Ratio (ratio_of_string "15/2"));;
test 6
eq_num (mult_num (Big_int (big_int_of_int 10)) (Ratio (ratio_of_string "3/4")),
@@ -93,31 +93,31 @@ testing_function "div_num";;
test 1
eq_num (div_num (Int 6) (Int 3), Int 2);;
test 2
-eq_num (div_num (Int (int_of_string "32639"))
+eq_num (div_num (Int (int_of_string "32639"))
(Int (int_of_string "257")), Int 127);;
test 3
-eq_num (div_num (Big_int (big_int_of_string "66820"))
- (Int (int_of_string "257")),
+eq_num (div_num (Big_int (big_int_of_string "66820"))
+ (Int (int_of_string "257")),
Int 260);;
test 4
eq_num (div_num (Int 6) (Big_int (big_int_of_int 3)), Int 2);;
test 5
-eq_num (div_num (Ratio (ratio_of_string "15/2"))
+eq_num (div_num (Ratio (ratio_of_string "15/2"))
(Int 10),
- Ratio (ratio_of_string "3/4"));;
+ Ratio (ratio_of_string "3/4"));;
test 6
eq_num (div_num (Big_int (big_int_of_int 6)) (Big_int (big_int_of_int 3)),
Int 2);;
-test 7
-eq_num (div_num (Ratio (ratio_of_string "15/2"))
+test 7
+eq_num (div_num (Ratio (ratio_of_string "15/2"))
(Big_int (big_int_of_int 10)),
Ratio (ratio_of_string "3/4"));;
test 8
-eq_num (div_num (Ratio (ratio_of_string "15/2"))
+eq_num (div_num (Ratio (ratio_of_string "15/2"))
(Ratio (ratio_of_string "3/4")),
Big_int (big_int_of_int 10));;
test 9
-eq_num (div_num (Ratio (ratio_of_string "1/2"))
+eq_num (div_num (Ratio (ratio_of_string "1/2"))
(Ratio (ratio_of_string "3/4")),
Ratio (ratio_of_string "2/3"));;
@@ -137,7 +137,7 @@ testing_function "num_of_ratio";;
test 1
eq_num (num_of_ratio (ratio_of_string "4/2"), Int 2);;
test 2
-eq_num (num_of_ratio (ratio_of_string "11811160075/11"),
+eq_num (num_of_ratio (ratio_of_string "11811160075/11"),
Big_int (big_int_of_string "1073741825"));;
test 3
eq_num (num_of_ratio (ratio_of_string "123456789012/1234"),
@@ -205,13 +205,13 @@ test 2 eq (f1 1, false);;
test 3 eq (f1 (0/1), true);;
-test 4 eq (f1 (let n = num_of_string "2000000000000000000000000" in n-n) ,
+test 4 eq (f1 (let n = num_of_string "2000000000000000000000000" in n-n) ,
true);;
-test 5 eq (f1 (let n = num_of_string "2000000000000000000000000" in n/n-1) ,
+test 5 eq (f1 (let n = num_of_string "2000000000000000000000000" in n/n-1) ,
true);;
-test 6 eq (f1 (let n = num_of_string "2000000000000000000000000" in n+1) ,
+test 6 eq (f1 (let n = num_of_string "2000000000000000000000000" in n+1) ,
false);;
test 7 eq (f1 (1/2), false);;
diff --git a/testsuite/tests/lib-printf/Makefile b/testsuite/tests/lib-printf/Makefile
new file mode 100644
index 0000000000..94c404726f
--- /dev/null
+++ b/testsuite/tests/lib-printf/Makefile
@@ -0,0 +1,7 @@
+#MODULES=
+MAIN_MODULE=tprintf
+ADD_COMPFLAGS=-I $(BASEDIR)/lib
+ADD_MODULES=testing
+
+include ../../makefiles/Makefile.one
+include ../../makefiles/Makefile.common
diff --git a/testsuite/tests/lib-printf/tprintf.ml b/testsuite/tests/lib-printf/tprintf.ml
new file mode 100644
index 0000000000..1e2762287f
--- /dev/null
+++ b/testsuite/tests/lib-printf/tprintf.ml
@@ -0,0 +1,468 @@
+(*************************************************************************)
+(* *)
+(* OCaml *)
+(* *)
+(* Damien Doligez, projet Gallium, INRIA Rocquencourt *)
+(* *)
+(* Copyright 2011 Institut National de Recherche en Informatique et *)
+(* en Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the Q Public License version 1.0. *)
+(* *)
+(*************************************************************************)
+
+(* $Id: tscanf.ml 10713 2010-10-08 11:53:19Z doligez $ *)
+
+(*
+
+A test file for the Printf module.
+
+*)
+
+open Testing;;
+open Printf;;
+
+try
+
+ printf "d/i positive\n%!";
+ test (sprintf "%d/%i" 42 43 = "42/43");
+ test (sprintf "%-4d/%-5i" 42 43 = "42 /43 ");
+ test (sprintf "%04d/%05i" 42 43 = "0042/00043");
+ test (sprintf "%+d/%+i" 42 43 = "+42/+43");
+ test (sprintf "% d/% i" 42 43 = " 42/ 43");
+ test (sprintf "%#d/%#i" 42 43 = "42/43");
+ test (sprintf "%4d/%5i" 42 43 = " 42/ 43");
+ test (sprintf "%*d/%*i" 4 42 5 43 = " 42/ 43");
+ test (sprintf "%-0+#4d/%-0 #5i" 42 43 = "+42 / 43 ");
+
+ printf "\nd/i negative\n%!";
+ test (sprintf "%d/%i" (-42) (-43) = "-42/-43");
+ test (sprintf "%-4d/%-5i" (-42) (-43) = "-42 /-43 ");
+ test (sprintf "%04d/%05i" (-42) (-43) = "-042/-0043");
+ test (sprintf "%+d/%+i" (-42) (-43) = "-42/-43");
+ test (sprintf "% d/% i" (-42) (-43) = "-42/-43");
+ test (sprintf "%#d/%#i" (-42) (-43) = "-42/-43");
+ test (sprintf "%4d/%5i" (-42) (-43) = " -42/ -43");
+ test (sprintf "%*d/%*i" 4 (-42) 5 (-43) = " -42/ -43");
+ test (sprintf "%-0+ #4d/%-0+ #5i" (-42) (-43) = "-42 /-43 ");
+
+ printf "\nu positive\n%!";
+ test (sprintf "%u" 42 = "42");
+ test (sprintf "%-4u" 42 = "42 ");
+ test (sprintf "%04u" 42 = "0042");
+ test (sprintf "%+u" 42 = "42");
+ test (sprintf "% u" 42 = "42");
+ test (sprintf "%#u" 42 = "42");
+ test (sprintf "%4u" 42 = " 42");
+ test (sprintf "%*u" 4 42 = " 42");
+ test (sprintf "%-0+ #6d" 42 = "+42 ");
+
+ printf "\nu negative\n%!";
+ begin match Sys.word_size with
+ | 32 ->
+ test (sprintf "%u" (-1) = "2147483647");
+ | 64 ->
+ test (sprintf "%u" (-1) = "9223372036854775807");
+ | _ -> test false
+ end;
+
+ printf "\nx positive\n%!";
+ test (sprintf "%x" 42 = "2a");
+ test (sprintf "%-4x" 42 = "2a ");
+ test (sprintf "%04x" 42 = "002a");
+ test (sprintf "%+x" 42 = "2a");
+ test (sprintf "% x" 42 = "2a");
+ test (sprintf "%#x" 42 = "0x2a");
+ test (sprintf "%4x" 42 = " 2a");
+ test (sprintf "%*x" 5 42 = " 2a");
+ test (sprintf "%-0+ #*x" 5 42 = "0x2a ");
+
+ printf "\nx negative\n%!";
+ begin match Sys.word_size with
+ | 32 ->
+ test (sprintf "%x" (-42) = "7fffffd6");
+ | 64 ->
+ test (sprintf "%x" (-42) = "7fffffffffffffd6");
+ | _ -> test false
+ end;
+
+ printf "\nX positive\n%!";
+ test (sprintf "%X" 42 = "2A");
+ test (sprintf "%-4X" 42 = "2A ");
+ test (sprintf "%04X" 42 = "002A");
+ test (sprintf "%+X" 42 = "2A");
+ test (sprintf "% X" 42 = "2A");
+ test (sprintf "%#X" 42 = "0X2A");
+ test (sprintf "%4X" 42 = " 2A");
+ test (sprintf "%*X" 5 42 = " 2A");
+ test (sprintf "%-0+ #*X" 5 42 = "0X2A ");
+
+ printf "\nx negative\n%!";
+ begin match Sys.word_size with
+ | 32 ->
+ test (sprintf "%X" (-42) = "7FFFFFD6");
+ | 64 ->
+ test (sprintf "%X" (-42) = "7FFFFFFFFFFFFFD6");
+ | _ -> test false
+ end;
+
+ printf "\no positive\n%!";
+ test (sprintf "%o" 42 = "52");
+ test (sprintf "%-4o" 42 = "52 ");
+ test (sprintf "%04o" 42 = "0052");
+ test (sprintf "%+o" 42 = "52");
+ test (sprintf "% o" 42 = "52");
+ test (sprintf "%#o" 42 = "052");
+ test (sprintf "%4o" 42 = " 52");
+ test (sprintf "%*o" 5 42 = " 52");
+ test (sprintf "%-0+ #*o" 5 42 = "052 ");
+
+ printf "\no negative\n%!";
+ begin match Sys.word_size with
+ | 32 ->
+ test (sprintf "%o" (-42) = "17777777726");
+ | 64 ->
+ test (sprintf "%o" (-42) = "777777777777777777726");
+ | _ -> test false
+ end;
+
+ printf "\ns\n%!";
+ test (sprintf "%s" "foo" = "foo");
+ test (sprintf "%-5s" "foo" = "foo ");
+ test (sprintf "%05s" "foo" = " foo");
+ test (sprintf "%+s" "foo" = "foo");
+ test (sprintf "% s" "foo" = "foo");
+ test (sprintf "%#s" "foo" = "foo");
+ test (sprintf "%5s" "foo" = " foo");
+ test (sprintf "%1s" "foo" = "foo");
+ test (sprintf "%*s" 6 "foo" = " foo");
+ test (sprintf "%*s" 2 "foo" = "foo");
+ test (sprintf "%-0+ #5s" "foo" = "foo ");
+ test (sprintf "%s@" "foo" = "foo@");
+ test (sprintf "%s@inria.fr" "foo" = "foo@inria.fr");
+ test (sprintf "%s@%s" "foo" "inria.fr" = "foo@inria.fr");
+
+ printf "\nS\n%!";
+ test (sprintf "%S" "fo\"o" = "\"fo\\\"o\"");
+(* test (sprintf "%-5S" "foo" = "\"foo\" "); padding not done *)
+(* test (sprintf "%05S" "foo" = " \"foo\""); padding not done *)
+ test (sprintf "%+S" "foo" = "\"foo\"");
+ test (sprintf "% S" "foo" = "\"foo\"");
+ test (sprintf "%#S" "foo" = "\"foo\"");
+(* test (sprintf "%5S" "foo" = " \"foo\""); padding not done *)
+ test (sprintf "%1S" "foo" = "\"foo\"");
+(* test (sprintf "%*S" 6 "foo" = " \"foo\""); padding not done *)
+ test (sprintf "%*S" 2 "foo" = "\"foo\"");
+(* test (sprintf "%-0+ #5S" "foo" = "\"foo\" "); padding not done *)
+ test (sprintf "%S@" "foo" = "\"foo\"@");
+ test (sprintf "%S@inria.fr" "foo" = "\"foo\"@inria.fr");
+ test (sprintf "%S@%S" "foo" "inria.fr" = "\"foo\"@\"inria.fr\"");
+
+ printf "\nc\n%!";
+ test (sprintf "%c" 'c' = "c");
+(* test (sprintf "%-4c" 'c' = "c "); padding not done *)
+(* test (sprintf "%04c" 'c' = " c"); padding not done *)
+ test (sprintf "%+c" 'c' = "c");
+ test (sprintf "% c" 'c' = "c");
+ test (sprintf "%#c" 'c' = "c");
+(* test (sprintf "%4c" 'c' = " c"); padding not done *)
+(* test (sprintf "%*c" 2 'c' = " c"); padding not done *)
+(* test (sprintf "%-0+ #4c" 'c' = "c "); padding not done *)
+
+ printf "\nC\n%!";
+ test (sprintf "%C" 'c' = "'c'");
+ test (sprintf "%C" '\'' = "'\\''");
+(* test (sprintf "%-4C" 'c' = "c "); padding not done *)
+(* test (sprintf "%04C" 'c' = " c"); padding not done *)
+ test (sprintf "%+C" 'c' = "'c'");
+ test (sprintf "% C" 'c' = "'c'");
+ test (sprintf "%#C" 'c' = "'c'");
+(* test (sprintf "%4C" 'c' = " c"); padding not done *)
+(* test (sprintf "%*C" 2 'c' = " c"); padding not done *)
+(* test (sprintf "%-0+ #4C" 'c' = "c "); padding not done *)
+
+ printf "\nf\n%!";
+ test (sprintf "%f" (-42.42) = "-42.420000");
+ test (sprintf "%-13f" (-42.42) = "-42.420000 ");
+ test (sprintf "%013f" (-42.42) = "-00042.420000");
+ test (sprintf "%+f" 42.42 = "+42.420000");
+ test (sprintf "% f" 42.42 = " 42.420000");
+ test (sprintf "%#f" 42.42 = "42.420000");
+ test (sprintf "%13f" 42.42 = " 42.420000");
+ test (sprintf "%*f" 12 42.42 = " 42.420000");
+ test (sprintf "%-0+ #12f" 42.42 = "+42.420000 ");
+ test (sprintf "%.3f" (-42.42) = "-42.420");
+ test (sprintf "%-13.3f" (-42.42) = "-42.420 ");
+ test (sprintf "%013.3f" (-42.42) = "-00000042.420");
+ test (sprintf "%+.3f" 42.42 = "+42.420");
+ test (sprintf "% .3f" 42.42 = " 42.420");
+ test (sprintf "%#.3f" 42.42 = "42.420");
+ test (sprintf "%13.3f" 42.42 = " 42.420");
+ test (sprintf "%*.*f" 12 3 42.42 = " 42.420");
+ test (sprintf "%-0+ #12.3f" 42.42 = "+42.420 ");
+
+ printf "\nF\n%!";
+ test (sprintf "%F" 42.42 = "42.42");
+ test (sprintf "%F" 42.42e42 = "4.242e+43");
+ test (sprintf "%F" 42.00 = "42.");
+ test (sprintf "%F" 0.042 = "0.042");
+(* no padding, no precision
+ test (sprintf "%.3F" 42.42 = "42.420");
+ test (sprintf "%12.3F" 42.42e42 = " 4.242e+43");
+ test (sprintf "%.3F" 42.00 = "42.000");
+ test (sprintf "%.3F" 0.0042 = "0.004");
+*)
+
+ printf "\ne\n%!";
+ test (sprintf "%e" (-42.42) = "-4.242000e+01");
+ test (sprintf "%-15e" (-42.42) = "-4.242000e+01 ");
+ test (sprintf "%015e" (-42.42) = "-004.242000e+01");
+ test (sprintf "%+e" 42.42 = "+4.242000e+01");
+ test (sprintf "% e" 42.42 = " 4.242000e+01");
+ test (sprintf "%#e" 42.42 = "4.242000e+01");
+ test (sprintf "%15e" 42.42 = " 4.242000e+01");
+ test (sprintf "%*e" 14 42.42 = " 4.242000e+01");
+ test (sprintf "%-0+ #14e" 42.42 = "+4.242000e+01 ");
+ test (sprintf "%.3e" (-42.42) = "-4.242e+01");
+ test (sprintf "%-15.3e" (-42.42) = "-4.242e+01 ");
+ test (sprintf "%015.3e" (-42.42) = "-000004.242e+01");
+ test (sprintf "%+.3e" 42.42 = "+4.242e+01");
+ test (sprintf "% .3e" 42.42 = " 4.242e+01");
+ test (sprintf "%#.3e" 42.42 = "4.242e+01");
+ test (sprintf "%15.3e" 42.42 = " 4.242e+01");
+ test (sprintf "%*.*e" 11 3 42.42 = " 4.242e+01");
+ test (sprintf "%-0+ #14.3e" 42.42 = "+4.242e+01 ");
+
+ printf "\nE\n%!";
+ test (sprintf "%E" (-42.42) = "-4.242000E+01");
+ test (sprintf "%-15E" (-42.42) = "-4.242000E+01 ");
+ test (sprintf "%015E" (-42.42) = "-004.242000E+01");
+ test (sprintf "%+E" 42.42 = "+4.242000E+01");
+ test (sprintf "% E" 42.42 = " 4.242000E+01");
+ test (sprintf "%#E" 42.42 = "4.242000E+01");
+ test (sprintf "%15E" 42.42 = " 4.242000E+01");
+ test (sprintf "%*E" 14 42.42 = " 4.242000E+01");
+ test (sprintf "%-0+ #14E" 42.42 = "+4.242000E+01 ");
+ test (sprintf "%.3E" (-42.42) = "-4.242E+01");
+ test (sprintf "%-15.3E" (-42.42) = "-4.242E+01 ");
+ test (sprintf "%015.3E" (-42.42) = "-000004.242E+01");
+ test (sprintf "%+.3E" 42.42 = "+4.242E+01");
+ test (sprintf "% .3E" 42.42 = " 4.242E+01");
+ test (sprintf "%#.3E" 42.42 = "4.242E+01");
+ test (sprintf "%15.3E" 42.42 = " 4.242E+01");
+ test (sprintf "%*.*E" 11 3 42.42 = " 4.242E+01");
+ test (sprintf "%-0+ #14.3E" 42.42 = "+4.242E+01 ");
+
+(* %g gives strange results that correspond to neither %f nor %e
+ printf "\ng\n%!";
+ test (sprintf "%g" (-42.42) = "-42.42000");
+ test (sprintf "%-15g" (-42.42) = "-42.42000 ");
+ test (sprintf "%015g" (-42.42) = "-00000042.42000");
+ test (sprintf "%+g" 42.42 = "+42.42000");
+ test (sprintf "% g" 42.42 = " 42.42000");
+ test (sprintf "%#g" 42.42 = "42.42000");
+ test (sprintf "%15g" 42.42 = " 42.42000");
+ test (sprintf "%*g" 14 42.42 = " 42.42000");
+ test (sprintf "%-0+ #14g" 42.42 = "+42.42000 ");
+ test (sprintf "%.3g" (-42.42) = "-42.420");
+*)
+
+(* Same for %G
+ printf "\nG\n%!";
+*)
+
+ printf "\nB\n%!";
+ test (sprintf "%B" true = "true");
+ test (sprintf "%B" false = "false");
+
+ printf "\nld/li positive\n%!";
+ test (sprintf "%ld/%li" 42l 43l = "42/43");
+ test (sprintf "%-4ld/%-5li" 42l 43l = "42 /43 ");
+ test (sprintf "%04ld/%05li" 42l 43l = "0042/00043");
+ test (sprintf "%+ld/%+li" 42l 43l = "+42/+43");
+ test (sprintf "% ld/% li" 42l 43l = " 42/ 43");
+ test (sprintf "%#ld/%#li" 42l 43l = "42/43");
+ test (sprintf "%4ld/%5li" 42l 43l = " 42/ 43");
+ test (sprintf "%*ld/%*li" 4 42l 5 43l = " 42/ 43");
+ test (sprintf "%-0+#4ld/%-0 #5li" 42l 43l = "+42 / 43 ");
+
+ printf "\nld/li negative\n%!";
+ test (sprintf "%ld/%li" (-42l) (-43l) = "-42/-43");
+ test (sprintf "%-4ld/%-5li" (-42l) (-43l) = "-42 /-43 ");
+ test (sprintf "%04ld/%05li" (-42l) (-43l) = "-042/-0043");
+ test (sprintf "%+ld/%+li" (-42l) (-43l) = "-42/-43");
+ test (sprintf "% ld/% li" (-42l) (-43l) = "-42/-43");
+ test (sprintf "%#ld/%#li" (-42l) (-43l) = "-42/-43");
+ test (sprintf "%4ld/%5li" (-42l) (-43l) = " -42/ -43");
+ test (sprintf "%*ld/%*li" 4 (-42l) 5 (-43l) = " -42/ -43");
+ test (sprintf "%-0+ #4ld/%-0+ #5li" (-42l) (-43l) = "-42 /-43 ");
+
+ printf "\nlu positive\n%!";
+ test (sprintf "%lu" 42l = "42");
+ test (sprintf "%-4lu" 42l = "42 ");
+ test (sprintf "%04lu" 42l = "0042");
+ test (sprintf "%+lu" 42l = "42");
+ test (sprintf "% lu" 42l = "42");
+ test (sprintf "%#lu" 42l = "42");
+ test (sprintf "%4lu" 42l = " 42");
+ test (sprintf "%*lu" 4 42l = " 42");
+ test (sprintf "%-0+ #6ld" 42l = "+42 ");
+
+ printf "\nlu negative\n%!";
+ test (sprintf "%lu" (-1l) = "4294967295");
+
+ printf "\nlx positive\n%!";
+ test (sprintf "%lx" 42l = "2a");
+ test (sprintf "%-4lx" 42l = "2a ");
+ test (sprintf "%04lx" 42l = "002a");
+ test (sprintf "%+lx" 42l = "2a");
+ test (sprintf "% lx" 42l = "2a");
+ test (sprintf "%#lx" 42l = "0x2a");
+ test (sprintf "%4lx" 42l = " 2a");
+ test (sprintf "%*lx" 5 42l = " 2a");
+ test (sprintf "%-0+ #*lx" 5 42l = "0x2a ");
+
+ printf "\nlx negative\n%!";
+ test (sprintf "%lx" (-42l) = "ffffffd6");
+
+ printf "\nlX positive\n%!";
+ test (sprintf "%lX" 42l = "2A");
+ test (sprintf "%-4lX" 42l = "2A ");
+ test (sprintf "%04lX" 42l = "002A");
+ test (sprintf "%+lX" 42l = "2A");
+ test (sprintf "% lX" 42l = "2A");
+ test (sprintf "%#lX" 42l = "0X2A");
+ test (sprintf "%4lX" 42l = " 2A");
+ test (sprintf "%*lX" 5 42l = " 2A");
+ test (sprintf "%-0+ #*lX" 5 42l = "0X2A ");
+
+ printf "\nlx negative\n%!";
+ test (sprintf "%lX" (-42l) = "FFFFFFD6");
+
+ printf "\nlo positive\n%!";
+ test (sprintf "%lo" 42l = "52");
+ test (sprintf "%-4lo" 42l = "52 ");
+ test (sprintf "%04lo" 42l = "0052");
+ test (sprintf "%+lo" 42l = "52");
+ test (sprintf "% lo" 42l = "52");
+ test (sprintf "%#lo" 42l = "052");
+ test (sprintf "%4lo" 42l = " 52");
+ test (sprintf "%*lo" 5 42l = " 52");
+ test (sprintf "%-0+ #*lo" 5 42l = "052 ");
+
+ printf "\nlo negative\n%!";
+ test (sprintf "%lo" (-42l) = "37777777726");
+
+ (* Nativeint not tested: looks like too much work, and anyway it should
+ work like Int32 or Int64. *)
+
+ printf "\nLd/Li positive\n%!";
+ test (sprintf "%Ld/%Li" 42L 43L = "42/43");
+ test (sprintf "%-4Ld/%-5Li" 42L 43L = "42 /43 ");
+ test (sprintf "%04Ld/%05Li" 42L 43L = "0042/00043");
+ test (sprintf "%+Ld/%+Li" 42L 43L = "+42/+43");
+ test (sprintf "% Ld/% Li" 42L 43L = " 42/ 43");
+ test (sprintf "%#Ld/%#Li" 42L 43L = "42/43");
+ test (sprintf "%4Ld/%5Li" 42L 43L = " 42/ 43");
+ test (sprintf "%*Ld/%*Li" 4 42L 5 43L = " 42/ 43");
+ test (sprintf "%-0+#4Ld/%-0 #5Li" 42L 43L = "+42 / 43 ");
+
+ printf "\nLd/Li negative\n%!";
+ test (sprintf "%Ld/%Li" (-42L) (-43L) = "-42/-43");
+ test (sprintf "%-4Ld/%-5Li" (-42L) (-43L) = "-42 /-43 ");
+ test (sprintf "%04Ld/%05Li" (-42L) (-43L) = "-042/-0043");
+ test (sprintf "%+Ld/%+Li" (-42L) (-43L) = "-42/-43");
+ test (sprintf "% Ld/% Li" (-42L) (-43L) = "-42/-43");
+ test (sprintf "%#Ld/%#Li" (-42L) (-43L) = "-42/-43");
+ test (sprintf "%4Ld/%5Li" (-42L) (-43L) = " -42/ -43");
+ test (sprintf "%*Ld/%*Li" 4 (-42L) 5 (-43L) = " -42/ -43");
+ test (sprintf "%-0+ #4Ld/%-0+ #5Li" (-42L) (-43L) = "-42 /-43 ");
+
+ printf "\nLu positive\n%!";
+ test (sprintf "%Lu" 42L = "42");
+ test (sprintf "%-4Lu" 42L = "42 ");
+ test (sprintf "%04Lu" 42L = "0042");
+ test (sprintf "%+Lu" 42L = "42");
+ test (sprintf "% Lu" 42L = "42");
+ test (sprintf "%#Lu" 42L = "42");
+ test (sprintf "%4Lu" 42L = " 42");
+ test (sprintf "%*Lu" 4 42L = " 42");
+ test (sprintf "%-0+ #6Ld" 42L = "+42 ");
+
+ printf "\nLu negative\n%!";
+ test (sprintf "%Lu" (-1L) = "18446744073709551615");
+
+ printf "\nLx positive\n%!";
+ test (sprintf "%Lx" 42L = "2a");
+ test (sprintf "%-4Lx" 42L = "2a ");
+ test (sprintf "%04Lx" 42L = "002a");
+ test (sprintf "%+Lx" 42L = "2a");
+ test (sprintf "% Lx" 42L = "2a");
+ test (sprintf "%#Lx" 42L = "0x2a");
+ test (sprintf "%4Lx" 42L = " 2a");
+ test (sprintf "%*Lx" 5 42L = " 2a");
+ test (sprintf "%-0+ #*Lx" 5 42L = "0x2a ");
+
+ printf "\nLx negative\n%!";
+ test (sprintf "%Lx" (-42L) = "ffffffffffffffd6");
+
+ printf "\nLX positive\n%!";
+ test (sprintf "%LX" 42L = "2A");
+ test (sprintf "%-4LX" 42L = "2A ");
+ test (sprintf "%04LX" 42L = "002A");
+ test (sprintf "%+LX" 42L = "2A");
+ test (sprintf "% LX" 42L = "2A");
+ test (sprintf "%#LX" 42L = "0X2A");
+ test (sprintf "%4LX" 42L = " 2A");
+ test (sprintf "%*LX" 5 42L = " 2A");
+ test (sprintf "%-0+ #*LX" 5 42L = "0X2A ");
+
+ printf "\nLx negative\n%!";
+ test (sprintf "%LX" (-42L) = "FFFFFFFFFFFFFFD6");
+
+ printf "\nLo positive\n%!";
+ test (sprintf "%Lo" 42L = "52");
+ test (sprintf "%-4Lo" 42L = "52 ");
+ test (sprintf "%04Lo" 42L = "0052");
+ test (sprintf "%+Lo" 42L = "52");
+ test (sprintf "% Lo" 42L = "52");
+ test (sprintf "%#Lo" 42L = "052");
+ test (sprintf "%4Lo" 42L = " 52");
+ test (sprintf "%*Lo" 5 42L = " 52");
+ test (sprintf "%-0+ #*Lo" 5 42L = "052 ");
+
+ printf "\nLo negative\n%!";
+ test (sprintf "%Lo" (-42L) = "1777777777777777777726");
+
+ printf "\na\n%!";
+ let x = ref () in
+ let f () y = if y == x then "ok" else "wrong" in
+ test (sprintf "%a" f x = "ok");
+
+ printf "\nt\n%!";
+ let f () = "ok" in
+ test (sprintf "%t" f = "ok");
+
+(* Does not work as expected. Should be fixed to work like %s.
+ printf "\n{...%%}\n%!";
+ let f = format_of_string "%f/%s" in
+ test (sprintf "%{%f%s%}" f = "%f/%s");
+*)
+
+ printf "\n(...%%)\n%!";
+ let f = format_of_string "%d/foo/%s" in
+ test (sprintf "%(%d%s%)" f 42 "bar" = "42/foo/bar");
+
+ printf "\n! %% @ , and constants\n%!";
+ test (sprintf "%!" = "");
+ test (sprintf "%%" = "%");
+ test (sprintf "%@" = "@");
+ test (sprintf "%," = "");
+ test (sprintf "@" = "@");
+ test (sprintf "@@" = "@@");
+ test (sprintf "@%%" = "@%");
+
+ printf "\nend of tests\n%!";
+with e ->
+ printf "unexpected exception: %s\n%!" (Printexc.to_string e);
+ test false;
+;;
diff --git a/testsuite/tests/lib-printf/tprintf.reference b/testsuite/tests/lib-printf/tprintf.reference
new file mode 100644
index 0000000000..c30013eb63
--- /dev/null
+++ b/testsuite/tests/lib-printf/tprintf.reference
@@ -0,0 +1,89 @@
+d/i positive
+ 0 1 2 3 4 5 6 7 8
+d/i negative
+ 9 10 11 12 13 14 15 16 17
+u positive
+ 18 19 20 21 22 23 24 25 26
+u negative
+ 27
+x positive
+ 28 29 30 31 32 33 34 35 36
+x negative
+ 37
+X positive
+ 38 39 40 41 42 43 44 45 46
+x negative
+ 47
+o positive
+ 48 49 50 51 52 53 54 55 56
+o negative
+ 57
+s
+ 58 59 60 61 62 63 64 65 66 67 68 69 70 71
+S
+ 72 73 74 75 76 77 78 79 80
+c
+ 81 82 83 84
+C
+ 85 86 87 88 89
+f
+ 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
+F
+ 108 109 110 111
+e
+ 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
+E
+ 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
+B
+ 148 149
+ld/li positive
+ 150 151 152 153 154 155 156 157 158
+ld/li negative
+ 159 160 161 162 163 164 165 166 167
+lu positive
+ 168 169 170 171 172 173 174 175 176
+lu negative
+ 177
+lx positive
+ 178 179 180 181 182 183 184 185 186
+lx negative
+ 187
+lX positive
+ 188 189 190 191 192 193 194 195 196
+lx negative
+ 197
+lo positive
+ 198 199 200 201 202 203 204 205 206
+lo negative
+ 207
+Ld/Li positive
+ 208 209 210 211 212 213 214 215 216
+Ld/Li negative
+ 217 218 219 220 221 222 223 224 225
+Lu positive
+ 226 227 228 229 230 231 232 233 234
+Lu negative
+ 235
+Lx positive
+ 236 237 238 239 240 241 242 243 244
+Lx negative
+ 245
+LX positive
+ 246 247 248 249 250 251 252 253 254
+Lx negative
+ 255
+Lo positive
+ 256 257 258 259 260 261 262 263 264
+Lo negative
+ 265
+a
+ 266
+t
+ 267
+(...%)
+ 268
+! % @ , and constants
+ 269 270 271 272 273 274 275
+end of tests
+
+All tests succeeded.
diff --git a/testsuite/tests/lib-scanf-2/Makefile b/testsuite/tests/lib-scanf-2/Makefile
index 216b396301..7362fad9ca 100644
--- a/testsuite/tests/lib-scanf-2/Makefile
+++ b/testsuite/tests/lib-scanf-2/Makefile
@@ -2,10 +2,11 @@ BASEDIR=../..
default: compile run
-compile: tscanf2_io.cmo tscanf2_io.cmx
+compile: tscanf2_io.cmo
@$(OCAMLC) unix.cma tscanf2_io.cmo -o master.byte tscanf2_master.ml
@$(OCAMLC) tscanf2_io.cmo -o slave.byte tscanf2_slave.ml
@if [ -z "$(BYTECODE_ONLY)" ]; then \
+ $(MAKE) tscanf2_io.cmx; \
$(OCAMLOPT) unix.cmxa tscanf2_io.cmx -o master.native tscanf2_master.ml; \
$(OCAMLOPT) tscanf2_io.cmx -o slave.native tscanf2_slave.ml; \
fi
diff --git a/testsuite/tests/lib-scanf/.ignore b/testsuite/tests/lib-scanf/.ignore
new file mode 100644
index 0000000000..a940814e01
--- /dev/null
+++ b/testsuite/tests/lib-scanf/.ignore
@@ -0,0 +1 @@
+tscanf_data
diff --git a/testsuite/tests/lib-scanf/tscanf.ml b/testsuite/tests/lib-scanf/tscanf.ml
index d929eb7474..8eb7d99361 100644
--- a/testsuite/tests/lib-scanf/tscanf.ml
+++ b/testsuite/tests/lib-scanf/tscanf.ml
@@ -265,15 +265,15 @@ test (test10 ())
(* %[] style *)
let test11 () =
- sscanf "Pierre Weis 70" "%s %s %s"
+ sscanf "Pierre\tWeis\t70" "%s %s %s"
(fun prenom nom poids ->
prenom = "Pierre" && nom = "Weis" && int_of_string poids = 70)
&&
- sscanf "Jean-Luc de Léage 68" "%[^ ] %[^ ] %d"
+ sscanf "Jean-Luc\tde Léage\t68" "%[^\t] %[^\t] %d"
(fun prenom nom poids ->
prenom = "Jean-Luc" && nom = "de Léage" && poids = 68)
&&
- sscanf "Daniel de Rauglaudre 66" "%s@\t %s@\t %d"
+ sscanf "Daniel\tde Rauglaudre\t66" "%s@\t %s@\t %d"
(fun prenom nom poids ->
prenom = "Daniel" && nom = "de Rauglaudre" && poids = 66)
;;
@@ -585,7 +585,7 @@ and test27 () =
(test27 ())
;;
-(* To scan a Caml string:
+(* To scan an OCaml string:
the format is "\"%s@\"".
A better way would be to add a %S (String.escaped), a %C (Char.escaped).
This is now available. *)
@@ -950,7 +950,7 @@ test (test340 () && test35 ())
(* The prefered reader functionnals. *)
-(* To read a list as in Caml (elements are ``blank + semicolon + blank''
+(* To read a list as in OCaml (elements are ``blank + semicolon + blank''
separated, and the list is enclosed in brackets). *)
let rec read_elems read_elem accu ib =
kscanf ib (fun ib exc -> accu)
@@ -1444,12 +1444,22 @@ let test57 () =
test (test57 ())
;;
-(*
let test58 () =
+ sscanf "string1%string2" "%s@%%s" id = "string1"
+ && sscanf "string1%string2" "%s@%%%s" (^) = "string1string2"
+ && sscanf "string1@string2" "%[a-z0-9]@%s" (^) = "string1string2"
+ && sscanf "string1@%string2" "%[a-z0-9]%@%%%s" (^) = "string1string2"
;;
test (test58 ())
;;
+
+(*
+let test59 () =
+;;
+
+test (test59 ())
+;;
*)
(* To be continued ...
diff --git a/testsuite/tests/lib-scanf/tscanf.reference b/testsuite/tests/lib-scanf/tscanf.reference
index edeff6725a..18fe92baf8 100644
--- a/testsuite/tests/lib-scanf/tscanf.reference
+++ b/testsuite/tests/lib-scanf/tscanf.reference
@@ -1,2 +1,2 @@
-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
+ 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
All tests succeeded.
diff --git a/testsuite/tests/lib-scanf/tscanf_data b/testsuite/tests/lib-scanf/tscanf_data
deleted file mode 100644
index e4ae5b689a..0000000000
--- a/testsuite/tests/lib-scanf/tscanf_data
+++ /dev/null
@@ -1 +0,0 @@
-"Objective" -> "Caml";
diff --git a/testsuite/tests/lib-set/testmap.ml b/testsuite/tests/lib-set/testmap.ml
index 1197fbf6d0..c54764ea7f 100644
--- a/testsuite/tests/lib-set/testmap.ml
+++ b/testsuite/tests/lib-set/testmap.ml
@@ -103,7 +103,7 @@ let test x v s1 s2 =
check "split"
(let (l, p, r) = M.split x s1 in
- fun i ->
+ fun i ->
if i < x then img i l = img i s1
else if i > x then img i r = img i s1
else p = img i s1)
@@ -120,4 +120,3 @@ let rmap() =
let _ =
Random.init 42;
for i = 1 to 25000 do test (rkey()) (rdata()) (rmap()) (rmap()) done
-
diff --git a/testsuite/tests/lib-set/testset.ml b/testsuite/tests/lib-set/testset.ml
index c4ab0441e0..024342f808 100644
--- a/testsuite/tests/lib-set/testset.ml
+++ b/testsuite/tests/lib-set/testset.ml
@@ -102,7 +102,7 @@ let test x s1 s2 =
check "split"
(let (l, p, r) = S.split x s1 in
- fun i ->
+ fun i ->
if i < x then S.mem i l = S.mem i s1
else if i > x then S.mem i r = S.mem i s1
else p = S.mem i s1)
@@ -117,4 +117,3 @@ let rset() =
let _ =
Random.init 42;
for i = 1 to 25000 do test (relt()) (rset()) (rset()) done
-
diff --git a/testsuite/tests/lib-str/t01.ml b/testsuite/tests/lib-str/t01.ml
index 03c85ea407..ab0c10ebb6 100644
--- a/testsuite/tests/lib-str/t01.ml
+++ b/testsuite/tests/lib-str/t01.ml
@@ -34,7 +34,7 @@ let start_test msg =
let num_failures = ref 0
let test res1 res2 =
- if res1 = res2
+ if res1 = res2
then print_char '.'
else begin print_string " FAIL "; incr num_failures end
@@ -743,7 +743,7 @@ let automated_test() =
test (Str.split_delim (Str.regexp "[ \t]+") " si non e vero\t")
[""; "si"; "non"; "e"; "vero"; ""];
test (Str.full_split (Str.regexp "[ \t]+") " si non\te vero\t")
- [Str.Delim " "; Str.Text "si";
+ [Str.Delim " "; Str.Text "si";
Str.Delim " "; Str.Text "non";
Str.Delim "\t"; Str.Text "e";
Str.Delim " "; Str.Text "vero"; Str.Delim "\t"];
@@ -752,7 +752,7 @@ let automated_test() =
(* See "REX: XML Shallow Parsing with Regular Expressions",
Robert D. Cameron, Simon Fraser University, CMPT TR 1998-17. *)
start_test "XML tokenization";
- begin
+ begin
let _TextSE = "[^<]+" in
let _UntilHyphen = "[^-]*-" in
let _Until2Hyphens = _UntilHyphen ^ "\\([^-]" ^ _UntilHyphen ^ "\\)*-" in
diff --git a/testsuite/tests/lib-stream/Makefile b/testsuite/tests/lib-stream/Makefile
new file mode 100644
index 0000000000..65ecf125bd
--- /dev/null
+++ b/testsuite/tests/lib-stream/Makefile
@@ -0,0 +1,4 @@
+BASEDIR=../..
+MODULES=testing
+include $(BASEDIR)/makefiles/Makefile.several
+include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/lib-stream/count_concat_bug.ml b/testsuite/tests/lib-stream/count_concat_bug.ml
new file mode 100644
index 0000000000..97ec6bce20
--- /dev/null
+++ b/testsuite/tests/lib-stream/count_concat_bug.ml
@@ -0,0 +1,57 @@
+let is_empty s =
+ try Stream.empty s; true with Stream.Failure -> false
+
+let test_icons =
+ let s = Stream.of_string "ab" in
+ let s = Stream.icons 'c' s in
+ Testing.test (Stream.next s = 'c');
+ Testing.test (Stream.next s = 'a');
+ Testing.test (Stream.next s = 'b');
+ Testing.test (is_empty s);
+ ()
+
+let test_lcons =
+ let s = Stream.of_string "ab" in
+ let s = Stream.lcons (fun () -> 'c') s in
+ Testing.test (Stream.next s = 'c');
+ Testing.test (Stream.next s = 'a');
+ Testing.test (Stream.next s = 'b');
+ Testing.test (is_empty s);
+ ()
+
+let test_iapp =
+ let s = Stream.of_string "ab" in
+ let s = Stream.iapp (Stream.of_list ['c']) s in
+ Testing.test (Stream.next s = 'c');
+ Testing.test (Stream.next s = 'a');
+ Testing.test (Stream.next s = 'b');
+ Testing.test (is_empty s);
+ ()
+
+let test_lapp_right =
+ let s1 = Stream.of_list ['c'] in
+ let s2 = Stream.of_string "ab" in
+ let s = Stream.lapp (fun () -> s1) s2 in
+ Testing.test (Stream.next s = 'c');
+ Testing.test (Stream.next s = 'a');
+ Testing.test (Stream.next s = 'b');
+ Testing.test (is_empty s);
+ ()
+
+let test_lapp_left =
+ let s1 = Stream.of_string "bc" in
+ let s2 = Stream.of_list ['a'] in
+ Testing.test (Stream.next s1 = 'b');
+ let s = Stream.lapp (fun () -> s1) s2 in
+ Testing.test (Stream.next s = 'c');
+ Testing.test (Stream.next s = 'a');
+ Testing.test (is_empty s);
+ ()
+
+let test_slazy =
+ let s = Stream.of_string "ab" in
+ Testing.test (Stream.next s = 'a');
+ let s = Stream.slazy (fun () -> s) in
+ Testing.test (Stream.next s = 'b');
+ Testing.test (is_empty s);
+ ()
diff --git a/testsuite/tests/lib-stream/count_concat_bug.reference b/testsuite/tests/lib-stream/count_concat_bug.reference
new file mode 100644
index 0000000000..52e367eabc
--- /dev/null
+++ b/testsuite/tests/lib-stream/count_concat_bug.reference
@@ -0,0 +1,2 @@
+ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
+All tests succeeded.
diff --git a/testsuite/tests/lib-systhreads/testfork.ml b/testsuite/tests/lib-systhreads/testfork.ml
index d0d253b37d..9815435305 100644
--- a/testsuite/tests/lib-systhreads/testfork.ml
+++ b/testsuite/tests/lib-systhreads/testfork.ml
@@ -2,7 +2,7 @@
let compute_thread c = ignore c
(*
- while true do
+ while true do
print_char c; flush stdout;
for i = 1 to 100000 do ignore(ref []) done
done
@@ -28,5 +28,3 @@ let main () =
exit 0
let _ = main()
-
-
diff --git a/testsuite/tests/lib-threads/test1.checker b/testsuite/tests/lib-threads/test1.checker
index cbfe7ce5d8..1d10457284 100644
--- a/testsuite/tests/lib-threads/test1.checker
+++ b/testsuite/tests/lib-threads/test1.checker
@@ -1 +1 @@
-sort test1.result | diff -q test1.reference -
+LC_ALL=C sort test1.result | diff -q test1.reference -
diff --git a/testsuite/tests/lib-threads/test3.runner b/testsuite/tests/lib-threads/test3.runner
index 907135b622..e6d40a2478 100644
--- a/testsuite/tests/lib-threads/test3.runner
+++ b/testsuite/tests/lib-threads/test3.runner
@@ -1,4 +1,4 @@
./program > test3.result &
pid=$!
sleep 5
-kill -9 $pid \ No newline at end of file
+kill -9 $pid
diff --git a/testsuite/tests/lib-threads/test4.checker b/testsuite/tests/lib-threads/test4.checker
index ae27a0d570..b8661a9821 100644
--- a/testsuite/tests/lib-threads/test4.checker
+++ b/testsuite/tests/lib-threads/test4.checker
@@ -1 +1 @@
-sort -u test4.result | diff -q test4.reference -
+LC_ALL=C sort -u test4.result | diff -q test4.reference -
diff --git a/testsuite/tests/lib-threads/test4.runner b/testsuite/tests/lib-threads/test4.runner
index 4f1a16d087..0559da0f80 100644
--- a/testsuite/tests/lib-threads/test4.runner
+++ b/testsuite/tests/lib-threads/test4.runner
@@ -1 +1 @@
-./program < test4.data > test4.result 2> /dev/null || true \ No newline at end of file
+./program < test4.data > test4.result 2> /dev/null || true
diff --git a/testsuite/tests/lib-threads/test5.checker b/testsuite/tests/lib-threads/test5.checker
index 030fcc91e6..e991875718 100644
--- a/testsuite/tests/lib-threads/test5.checker
+++ b/testsuite/tests/lib-threads/test5.checker
@@ -1 +1 @@
-sort -u test5.result | diff -q test5.reference -
+LC_ALL=C sort -u test5.result | diff -q test5.reference -
diff --git a/testsuite/tests/lib-threads/test5.runner b/testsuite/tests/lib-threads/test5.runner
index 877d176e02..6b79d5e2da 100644
--- a/testsuite/tests/lib-threads/test5.runner
+++ b/testsuite/tests/lib-threads/test5.runner
@@ -1,4 +1,4 @@
./program > test5.result &
pid=$!
sleep 1
-kill -9 $pid \ No newline at end of file
+kill -9 $pid
diff --git a/testsuite/tests/lib-threads/test6.checker b/testsuite/tests/lib-threads/test6.checker
index 40ab24f876..d2e9930af5 100644
--- a/testsuite/tests/lib-threads/test6.checker
+++ b/testsuite/tests/lib-threads/test6.checker
@@ -1 +1 @@
-sort -u test6.result | diff -q test6.reference -
+LC_ALL=C sort -u test6.result | diff -q test6.reference -
diff --git a/testsuite/tests/lib-threads/test7.checker b/testsuite/tests/lib-threads/test7.checker
index c5eb2dcd7b..7cdb84123a 100644
--- a/testsuite/tests/lib-threads/test7.checker
+++ b/testsuite/tests/lib-threads/test7.checker
@@ -1 +1 @@
-test `grep -E '^-?[0123456789]+$' test7.result | wc -l` = `cat test7.result | wc -l` \ No newline at end of file
+test `grep -E '^-?[0123456789]+$' test7.result | wc -l` = `cat test7.result | wc -l`
diff --git a/testsuite/tests/lib-threads/testA.checker b/testsuite/tests/lib-threads/testA.checker
index 4c309401d0..9f5d00a879 100644
--- a/testsuite/tests/lib-threads/testA.checker
+++ b/testsuite/tests/lib-threads/testA.checker
@@ -1 +1 @@
-sort testA.result | diff -q testA.reference -
+LC_ALL=C sort testA.result | diff -q testA.reference -
diff --git a/testsuite/tests/lib-threads/testexit.checker b/testsuite/tests/lib-threads/testexit.checker
index 5834e5d005..c1182d6f8e 100644
--- a/testsuite/tests/lib-threads/testexit.checker
+++ b/testsuite/tests/lib-threads/testexit.checker
@@ -1 +1 @@
-sort testexit.result | diff -q testexit.reference -
+LC_ALL=C sort testexit.result | diff -q testexit.reference -
diff --git a/testsuite/tests/lib-threads/testsignal.checker b/testsuite/tests/lib-threads/testsignal.checker
index 2e8ef03a23..e7a5f0614a 100644
--- a/testsuite/tests/lib-threads/testsignal.checker
+++ b/testsuite/tests/lib-threads/testsignal.checker
@@ -1 +1 @@
-sed -e 1q testsignal.result | grep -q '^[ab]*Got ctrl-C, exiting...$'
+sed -e 1q testsignal.result | grep -q '^[ab]*Got ctrl-C, exiting...$'
diff --git a/testsuite/tests/lib-threads/testsignal.runner b/testsuite/tests/lib-threads/testsignal.runner
index 897ef1733a..74c0d54df6 100644
--- a/testsuite/tests/lib-threads/testsignal.runner
+++ b/testsuite/tests/lib-threads/testsignal.runner
@@ -1,4 +1,4 @@
./program > testsignal.result &
pid=$!
sleep 3
-kill -INT $pid \ No newline at end of file
+kill -INT $pid
diff --git a/testsuite/tests/lib-threads/testsignal2.runner b/testsuite/tests/lib-threads/testsignal2.runner
index 0e368a9245..e215ec6ed4 100644
--- a/testsuite/tests/lib-threads/testsignal2.runner
+++ b/testsuite/tests/lib-threads/testsignal2.runner
@@ -3,4 +3,4 @@ pid=$!
sleep 3
kill -INT $pid
sleep 1
-kill -9 $pid || true
+kill -9 $pid 2>&- || true
diff --git a/testsuite/tests/lib-threads/torture.ml b/testsuite/tests/lib-threads/torture.ml
index cfc5783334..02006a7a8f 100644
--- a/testsuite/tests/lib-threads/torture.ml
+++ b/testsuite/tests/lib-threads/torture.ml
@@ -9,9 +9,9 @@ let gc_thread () =
let stdin_thread () =
while true do
- print_string "> "; flush stdout;
+ print_string ">"; flush stdout;
let s = read_line() in
- print_string ">>> "; print_string s; print_newline()
+ print_string " >>> "; print_string s; print_newline()
done
let writer_thread (oc, size) =
diff --git a/testsuite/tests/lib-threads/torture.reference b/testsuite/tests/lib-threads/torture.reference
index cd5f474fb6..f726cc4682 100644
--- a/testsuite/tests/lib-threads/torture.reference
+++ b/testsuite/tests/lib-threads/torture.reference
@@ -1,4 +1,4 @@
> >>> abc
> >>> def
> >>> ghi
-> \ No newline at end of file
+> \ No newline at end of file
diff --git a/testsuite/tests/lib-threads/torture.runner b/testsuite/tests/lib-threads/torture.runner
index f4ad597bff..12ceeb64ac 100644
--- a/testsuite/tests/lib-threads/torture.runner
+++ b/testsuite/tests/lib-threads/torture.runner
@@ -1 +1 @@
-./program < torture.data > torture.result 2> /dev/null || true \ No newline at end of file
+./program < torture.data > torture.result 2> /dev/null || true
diff --git a/testsuite/tests/misc-kb/equations.ml b/testsuite/tests/misc-kb/equations.ml
index 5617bc4f9d..1d905e015d 100644
--- a/testsuite/tests/misc-kb/equations.ml
+++ b/testsuite/tests/misc-kb/equations.ml
@@ -16,7 +16,7 @@
open Terms
-type rule =
+type rule =
{ number: int;
numvars: int;
lhs: term;
@@ -53,7 +53,7 @@ let pretty_rule rule =
let pretty_rules rules = List.iter pretty_rule rules
-
+
(****************** Rewriting **************************)
(* Top-level rewriting. Let eq:L=R be an equation, M be a term such that L<=M.
@@ -112,4 +112,3 @@ let rec mrewrite_all rules m =
mrewrite_all rules (mrewrite1 rules m)
with Failure _ ->
m
-
diff --git a/testsuite/tests/misc-kb/equations.mli b/testsuite/tests/misc-kb/equations.mli
index 0db190b858..49b1a461e7 100644
--- a/testsuite/tests/misc-kb/equations.mli
+++ b/testsuite/tests/misc-kb/equations.mli
@@ -14,7 +14,7 @@
open Terms
-type rule =
+type rule =
{ number: int;
numvars: int;
lhs: term;
diff --git a/testsuite/tests/misc-kb/kb.ml b/testsuite/tests/misc-kb/kb.ml
index ff357b3ff8..5045a31881 100644
--- a/testsuite/tests/misc-kb/kb.ml
+++ b/testsuite/tests/misc-kb/kb.ml
@@ -37,7 +37,7 @@ let rec super m = function
(* Ex :
-let (m,_) = <<F(A,B)>>
+let (m,_) = <<F(A,B)>>
and (n,_) = <<H(F(A,x),F(x,y))>> in super m n
==> [[1],[2,Term ("B",[])]; x <- B
[2],[2,Term ("A",[]); 1,Term ("B",[])]] x <- A y <- B
@@ -109,7 +109,7 @@ let rec get_rule n = function
(* Improved Knuth-Bendix completion procedure *)
-let kb_completion greater =
+let kb_completion greater =
let rec kbrec j rules =
let rec process failures (k,l) eqs =
(****
@@ -165,7 +165,7 @@ let kb_completion greater =
(strict_critical_pairs el (rename rl.numvars el))
else
try
- let rk = get_rule k rules in
+ let rk = get_rule k rules in
let ek = (rk.lhs, rk.rhs) in
process failures (k,l)
(mutual_critical_pairs el (rename rl.numvars ek))
@@ -185,4 +185,3 @@ let kb_complete greater complete_rules rules =
kb_completion greater n complete_rules [] (n,n) eqs in
print_string "Canonical set found :"; print_newline();
pretty_rules (List.rev completed_rules)
-
diff --git a/testsuite/tests/misc-kb/kbmain.ml b/testsuite/tests/misc-kb/kbmain.ml
index 580b715040..a0d4ff715b 100644
--- a/testsuite/tests/misc-kb/kbmain.ml
+++ b/testsuite/tests/misc-kb/kbmain.ml
@@ -72,11 +72,10 @@ let group_precedence op1 op2 =
if r1 = r2 then Equal else
if r1 > r2 then Greater else NotGE
-let group_order = rpo group_precedence lex_ext
+let group_order = rpo group_precedence lex_ext
let greater pair =
match group_order pair with Greater -> true | _ -> false
let _ =
for i = 1 to 20 do kb_complete greater [] geom_rules done
-
diff --git a/testsuite/tests/misc-kb/orderings.ml b/testsuite/tests/misc-kb/orderings.ml
index c81746e309..6da73df8d7 100644
--- a/testsuite/tests/misc-kb/orderings.ml
+++ b/testsuite/tests/misc-kb/orderings.ml
@@ -16,7 +16,7 @@
open Terms
-type ordering =
+type ordering =
Greater
| Equal
| NotGE
@@ -65,10 +65,10 @@ let lex_ext order = function
| ( _ , []) -> Greater
| (x1::l1, x2::l2) ->
match order (x1,x2) with
- Greater -> if List.for_all (fun n' -> gt_ord order (m,n')) l2
+ Greater -> if List.for_all (fun n' -> gt_ord order (m,n')) l2
then Greater else NotGE
| Equal -> lexrec (l1,l2)
- | NotGE -> if List.exists (fun m' -> ge_ord order (m',n)) l1
+ | NotGE -> if List.exists (fun m' -> ge_ord order (m',n)) l1
then Greater else NotGE in
lexrec (sons1, sons2)
| _ -> failwith "lex_ext"
@@ -76,9 +76,9 @@ let lex_ext order = function
(* Recursive path ordering *)
-let rpo op_order ext =
+let rpo op_order ext =
let rec rporec (m,n) =
- if m = n then Equal else
+ if m = n then Equal else
match m with
Var vm -> NotGE
| Term(op1,sons1) ->
@@ -96,4 +96,3 @@ let rpo op_order ext =
if List.exists (fun m' -> ge_ord rporec (m',n)) sons1
then Greater else NotGE
in rporec
-
diff --git a/testsuite/tests/misc-kb/orderings.mli b/testsuite/tests/misc-kb/orderings.mli
index bb44f0832d..d75c58a029 100644
--- a/testsuite/tests/misc-kb/orderings.mli
+++ b/testsuite/tests/misc-kb/orderings.mli
@@ -14,7 +14,7 @@
open Terms
-type ordering =
+type ordering =
Greater
| Equal
| NotGE
diff --git a/testsuite/tests/misc-kb/terms.ml b/testsuite/tests/misc-kb/terms.ml
index 86604f9c5a..f7a1c3e7b7 100644
--- a/testsuite/tests/misc-kb/terms.ml
+++ b/testsuite/tests/misc-kb/terms.ml
@@ -14,7 +14,7 @@
(****************** Term manipulations *****************)
-type term =
+type term =
Var of int
| Term of string * term list
@@ -22,7 +22,7 @@ let rec union l1 l2 =
match l1 with
[] -> l2
| a::r -> if List.mem a l2 then union r l2 else a :: union r l2
-
+
let rec vars = function
Var n -> [n]
@@ -73,7 +73,7 @@ let matching term1 term2 =
(* A naive unification algorithm. *)
-let compsubst subst1 subst2 =
+let compsubst subst1 subst2 =
(List.map (fun (v,t) -> (v, substitute subst1 t)) subst2) @ subst1
@@ -133,5 +133,3 @@ and pretty_close = function
pretty_term m
| m ->
pretty_term m
-
-
diff --git a/testsuite/tests/misc-kb/terms.mli b/testsuite/tests/misc-kb/terms.mli
index 0f6be4c8e8..40c7710818 100644
--- a/testsuite/tests/misc-kb/terms.mli
+++ b/testsuite/tests/misc-kb/terms.mli
@@ -12,7 +12,7 @@
(* $Id$ *)
-type term =
+type term =
Var of int
| Term of string * term list
diff --git a/testsuite/tests/misc-unsafe/almabench.ml b/testsuite/tests/misc-unsafe/almabench.ml
index 73293e9ad9..e5cdf36c3b 100644
--- a/testsuite/tests/misc-unsafe/almabench.ml
+++ b/testsuite/tests/misc-unsafe/almabench.ml
@@ -16,7 +16,7 @@
* Longitudes, Paris, France), as detailed in Astronomy & Astrophysics
* 282, 663 (1994)
*
- * Note that the code herein is design for the purpose of testing
+ * Note that the code herein is design for the purpose of testing
* computational performance; error handling and other such "niceties"
* is virtually non-existent.
*
@@ -68,7 +68,7 @@ and a = [|
[| 19.2184460618; -3716e-10; 979e-10 |];
[| 30.1103868694; -16635e-10; 686e-10 |] |]
-and dlm =
+and dlm =
[| [| 252.25090552; 5381016286.88982; -1.92789 |];
[| 181.97980085; 2106641364.33548; 0.59381 |];
[| 100.46645683; 1295977422.83429; -2.04411 |];
@@ -151,7 +151,7 @@ and sa =
(* tables giving the trigonometric terms to be added to the mean elements of
the mean longitudes . *)
-and kq =
+and kq =
[| [| 3086.0; 15746.0; 69613.0; 59899.0; 75645.0; 88306.0; 12661.0; 2658.0; 0.0; 0.0 |];
[| 21863.0; 32794.0; 10931.0; 73.0; 4387.0; 26934.0; 1473.0; 2157.0; 0.0; 0.0 |];
[| 10.0; 16002.0; 21863.0; 10931.0; 1473.0; 32004.0; 4387.0; 73.0; 0.0; 0.0 |];
@@ -181,15 +181,15 @@ and sl =
[| 71234.0;-41116.0; 5334.0;-4935.0;-1848.0; 66.0; 434.0;-1748.0; 3780.0; -701.0 |];
[| -47645.0; 11647.0; 2166.0; 3194.0; 679.0; 0.0; -244.0; -419.0; -2531.0; 48.0 |] |]
-
+
(* Normalize angle into the range -pi <= A < +pi. *)
let anpm a =
let w = mod_float a twopi in
if abs_float w >= pic then begin
if a < 0.0 then
- w +. twopi
+ w +. twopi
else
- w -. twopi
+ w -. twopi
end else
w
@@ -204,10 +204,10 @@ let planetpv epoch np pv =
and de = e.(np).(0) +. (e.(np).(1) +. e.(np).(2) *. t ) *. t
and dp = anpm ((3600.0 *. pi.(np).(0) +. (pi.(np).(1) +. pi.(np).(2) *. t ) *. t ) *. a2r )
and di = (3600.0 *. dinc.(np).(0) +. (dinc.(np).(1) +. dinc.(np).(2) *. t ) *. t ) *. a2r
- and doh = anpm ((3600.0 *. omega.(np).(0) +. (omega.(np).(1) +. omega.(np).(2) *. t ) *. t ) *. a2r )
- (* apply the trigonometric terms. *)
+ and doh = anpm ((3600.0 *. omega.(np).(0) +. (omega.(np).(1) +. omega.(np).(2) *. t ) *. t ) *. a2r )
+ (* apply the trigonometric terms. *)
and dmu = 0.35953620 *. t in
-
+
(* loop invariant *)
let kp = kp.(np) and kq = kq.(np) and ca = ca.(np) and sa = sa.(np)
and cl = cl.(np) and sl = sl.(np) in
@@ -231,20 +231,20 @@ let planetpv epoch np pv =
(* iterative solution of kepler's equation to get eccentric anomaly. *)
let am = !dl -. dp in
let ae = ref (am +. de *. sin am)
- and k = ref 0 in
+ and k = ref 0 in
let dae = ref ((am -. !ae +. de *. sin !ae) /. (1.0 -. de *. cos !ae)) in
ae := !ae +. !dae;
incr k;
while !k < 10 or abs_float !dae >= 1e-12 do
- dae := (am -. !ae +. de *. sin !ae) /. (1.0 -. de *. cos !ae);
- ae := !ae +. !dae;
- incr k
+ dae := (am -. !ae +. de *. sin !ae) /. (1.0 -. de *. cos !ae);
+ ae := !ae +. !dae;
+ incr k
done;
-
+
(* true anomaly. *)
let ae2 = !ae /. 2.0 in
- let at = 2.0 *. atan2 (sqrt ((1.0 +. de) /. (1.0 -. de)) *. sin ae2) (cos ae2)
- (* distance (au) and speed (radians per day). *)
+ let at = 2.0 *. atan2 (sqrt ((1.0 +. de) /. (1.0 -. de)) *. sin ae2) (cos ae2)
+ (* distance (au) and speed (radians per day). *)
and r = !da *. (1.0 -. de *. cos !ae)
and v = gaussk *. sqrt ((1.0 +. 1.0 /. amas.(np) ) /. (!da *. !da *. !da))
and si2 = sin (di /. 2.0) in
@@ -253,7 +253,7 @@ let planetpv epoch np pv =
and tl = at +. dp in
let xsw = sin tl
and xcw = cos tl in
- let xm2 = 2.0 *. (xp *. xcw -. xq *. xsw )
+ let xm2 = 2.0 *. (xp *. xcw -. xq *. xsw )
and xf = !da /. sqrt (1.0 -. de *. de)
and ci2 = cos (di /. 2.0) in
let xms = (de *. sin dp +. xsw) *. xf
@@ -265,42 +265,42 @@ let planetpv epoch np pv =
and y = r *. (xsw +. xm2 *. xq)
and z = r *. (-.xm2 *. ci2) in
- (* rotate to equatorial. *)
- pv.(0).(0) <- x;
- pv.(0).(1) <- y *. coseps -. z *. sineps;
- pv.(0).(2) <- y *. sineps +. z *. coseps;
+ (* rotate to equatorial. *)
+ pv.(0).(0) <- x;
+ pv.(0).(1) <- y *. coseps -. z *. sineps;
+ pv.(0).(2) <- y *. sineps +. z *. coseps;
- (* velocity (j2000 ecliptic xdot,ydot,zdot in au/d). *)
- let x = v *. ((-1.0 +. 2.0 *. xp *. xp) *. xms +. xpxq2 *. xmc)
- and y = v *. (( 1.0 -. 2.0 *. xq *. xq ) *. xmc -. xpxq2 *. xms)
- and z = v *. (2.0 *. ci2 *. (xp *. xms +. xq *. xmc)) in
+ (* velocity (j2000 ecliptic xdot,ydot,zdot in au/d). *)
+ let x = v *. ((-1.0 +. 2.0 *. xp *. xp) *. xms +. xpxq2 *. xmc)
+ and y = v *. (( 1.0 -. 2.0 *. xq *. xq ) *. xmc -. xpxq2 *. xms)
+ and z = v *. (2.0 *. ci2 *. (xp *. xms +. xq *. xmc)) in
- (* rotate to equatorial *)
- pv.(1).(0) <- x;
- pv.(1).(1) <- y *. coseps -. z *. sineps;
- pv.(1).(2) <- y *. sineps +. z *. coseps
+ (* rotate to equatorial *)
+ pv.(1).(0) <- x;
+ pv.(1).(1) <- y *. coseps -. z *. sineps;
+ pv.(1).(2) <- y *. sineps +. z *. coseps
-(* Computes RA, Declination, and distance from a state vector returned by
+(* Computes RA, Declination, and distance from a state vector returned by
* planetpv. *)
let radecdist state rdd =
(* Distance *)
rdd.(2) <- sqrt (state.(0).(0) *. state.(0).(0)
- +. state.(0).(1) *. state.(0).(1)
- +. state.(0).(2) *. state.(0).(2));
+ +. state.(0).(1) *. state.(0).(1)
+ +. state.(0).(2) *. state.(0).(2));
(* RA *)
rdd.(0) <- atan2 state.(0).(1) state.(0).(0) *. r2h;
if rdd.(0) < 0.0 then rdd.(0) <- rdd.(0) +. 24.0;
-
+
(* Declination *)
rdd.(1) <- asin (state.(0).(2) /. rdd.(2)) *. r2d
-
+
(* Entry point. Calculate RA and Dec for noon on every day in 1900-2100 *)
let _ =
let jd = [| 0.0; 0.0 |]
- and pv = [| [| 0.0; 0.0; 0.0 |]; [| 0.0; 0.0; 0.0 |] |]
+ and pv = [| [| 0.0; 0.0; 0.0 |]; [| 0.0; 0.0; 0.0 |] |]
and position = [| 0.0; 0.0; 0.0 |] in
(* Test *)
jd.(0) <- j2000;
@@ -317,8 +317,8 @@ let _ =
for n = 0 to test_length - 1 do
jd.(0) <- jd.(0) +. 1.0;
for p = 0 to 7 do
- planetpv jd p pv;
- radecdist pv position;
+ planetpv jd p pv;
+ radecdist pv position;
done
done
done
diff --git a/testsuite/tests/misc-unsafe/fft.ml b/testsuite/tests/misc-unsafe/fft.ml
index f0a2ed3289..d9668cb895 100644
--- a/testsuite/tests/misc-unsafe/fft.ml
+++ b/testsuite/tests/misc-unsafe/fft.ml
@@ -19,17 +19,17 @@ let tpi = 2.0 *. pi
let fft px py np =
let i = ref 2 in
let m = ref 1 in
-
+
while (!i < np) do
- i := !i + !i;
+ i := !i + !i;
m := !m + 1
done;
- let n = !i in
-
+ let n = !i in
+
if n <> np then begin
for i = np+1 to n do
- px.(i) <- 0.0;
+ px.(i) <- 0.0;
py.(i) <- 0.0
done;
print_string "Use "; print_int n;
@@ -38,7 +38,7 @@ let fft px py np =
let n2 = ref(n+n) in
for k = 1 to !m-1 do
- n2 := !n2 / 2;
+ n2 := !n2 / 2;
let n4 = !n2 / 4 in
let e = tpi /. float !n2 in
@@ -51,7 +51,7 @@ let fft px py np =
let ss3 = sin(a3) in
let is = ref j in
let id = ref(2 * !n2) in
-
+
while !is < n do
let i0r = ref !is in
while !i0r < n do
@@ -71,13 +71,13 @@ let fft px py np =
let r1 = r1 +. s2 in
let s2 = r2 -. s1 in
let r2 = r2 +. s1 in
- px.(i2) <- r1*.cc1 -. s2*.ss1;
+ px.(i2) <- r1*.cc1 -. s2*.ss1;
py.(i2) <- -.s2*.cc1 -. r1*.ss1;
px.(i3) <- s3*.cc3 +. r2*.ss3;
py.(i3) <- r2*.cc3 -. s3*.ss3;
i0r := i0 + !id
done;
- is := 2 * !id - !n2 + j;
+ is := 2 * !id - !n2 + j;
id := 4 * !id
done
done
@@ -89,7 +89,7 @@ let fft px py np =
let is = ref 1 in
let id = ref 4 in
-
+
while !is < n do
let i0r = ref !is in
while !i0r <= n do
@@ -103,7 +103,7 @@ let fft px py np =
py.(i1) <- r1 -. py.(i1);
i0r := i0 + !id
done;
- is := 2 * !id - 1;
+ is := 2 * !id - 1;
id := 4 * !id
done;
@@ -112,11 +112,11 @@ let fft px py np =
(*************************)
let j = ref 1 in
-
+
for i = 1 to n - 1 do
if i < !j then begin
let xt = px.(!j) in
- px.(!j) <- px.(i);
+ px.(!j) <- px.(i);
px.(i) <- xt;
let xt = py.(!j) in
py.(!j) <- py.(i);
@@ -124,7 +124,7 @@ let fft px py np =
end;
let k = ref(n / 2) in
while !k < !j do
- j := !j - !k;
+ j := !j - !k;
k := !k / 2
done;
j := !j + !k
@@ -170,12 +170,12 @@ let test np =
for i = 0 to np-1 do
let a = abs_float(pxr.(i+1) -. float i) in
if !zr < a then begin
- zr := a;
+ zr := a;
kr := i
end;
let a = abs_float(pxi.(i+1)) in
if !zi < a then begin
- zi := a;
+ zi := a;
ki := i
end
done;
@@ -186,4 +186,3 @@ let test np =
let _ =
let np = ref 16 in for i = 1 to 16 do test !np; np := !np*2 done
-
diff --git a/testsuite/tests/misc/bdd.ml b/testsuite/tests/misc/bdd.ml
index ddf99a7295..0d54bd808b 100644
--- a/testsuite/tests/misc/bdd.ml
+++ b/testsuite/tests/misc/bdd.ml
@@ -12,7 +12,7 @@
(* $Id$ *)
-(* Translated to Caml by Xavier Leroy *)
+(* Translated to OCaml by Xavier Leroy *)
(* Original code written in SML by ... *)
type bdd = One | Zero | Node of bdd * int * int * bdd
@@ -24,8 +24,8 @@ let rec eval bdd vars =
| Node(l, v, _, h) ->
if vars.(v) then eval h vars else eval l vars
-let getId bdd =
- match bdd with
+let getId bdd =
+ match bdd with
Node(_,_,id,_) -> id
| Zero -> 0
| One -> 1
@@ -42,10 +42,10 @@ let resize newSize =
let newSz_1 = newSize-1 in
let newArr = Array.create newSize [] in
let rec copyBucket bucket =
- match bucket with
+ match bucket with
[] -> ()
- | n :: ns ->
- match n with
+ | n :: ns ->
+ match n with
| Node(l,v,_,h) ->
let ind = hashVal (getId l) (getId h) v land newSz_1
in
@@ -80,18 +80,18 @@ let resetUnique () = (
let mkNode low v high =
let idl = getId low in
- let idh = getId high
+ let idh = getId high
in
if idl = idh
then low
else let ind = hashVal idl idh v land (!sz_1) in
let bucket = (!htab).(ind) in
- let rec lookup b =
- match b with
+ let rec lookup b =
+ match b with
[] -> let n = Node(low, v, (incr nodeC; !nodeC), high)
in
insert (getId low) (getId high) v ind bucket n; n
- | n :: ns ->
+ | n :: ns ->
match n with
| Node(l,v',id,h) ->
if v = v' && idl = getId l && idh = getId h
@@ -104,7 +104,7 @@ let mkNode low v high =
type ordering = LESS | EQUAL | GREATER
let cmpVar (x : int) (y : int) =
- if x<y then LESS else if x>y then GREATER else EQUAL
+ if x<y then LESS else if x>y then GREATER else EQUAL
let zero = Zero
let one = One
@@ -123,7 +123,7 @@ let notslot1 = Array.create cacheSize 0
let notslot2 = Array.create cacheSize one
let hash x y = ((x lsl 1)+y) mod cacheSize
-let rec not n =
+let rec not n =
match n with
Zero -> One
| One -> Zero
@@ -134,9 +134,9 @@ match n with
in
notslot1.(h) <- id; notslot2.(h) <- f; f
-let rec and2 n1 n2 =
+let rec and2 n1 n2 =
match n1 with
- Node(l1, v1, i1, r1)
+ Node(l1, v1, i1, r1)
-> (match n2 with
Node(l2, v2, i2, r2)
-> let h = hash i1 i2
@@ -147,8 +147,8 @@ match n1 with
| LESS -> mkNode (and2 l1 n2) v1 (and2 r1 n2)
| GREATER -> mkNode (and2 n1 l2) v2 (and2 n1 r2)
in
- andslot1.(h) <- i1;
- andslot2.(h) <- i2;
+ andslot1.(h) <- i1;
+ andslot2.(h) <- i2;
andslot3.(h) <- f;
f
| Zero -> Zero
@@ -157,9 +157,9 @@ match n1 with
| One -> n2
-let rec xor n1 n2 =
+let rec xor n1 n2 =
match n1 with
- Node(l1, v1, i1, r1)
+ Node(l1, v1, i1, r1)
-> (match n2 with
Node(l2, v2, i2, r2)
-> let h = hash i1 i2
@@ -174,19 +174,19 @@ match n1 with
andslot2.(h) <- i2;
andslot3.(h) <- f;
f
- | Zero -> n1
+ | Zero -> n1
| One -> not n1)
| Zero -> n2
| One -> not n2
-let hwb n =
+let hwb n =
let rec h i j = if i=j
then mkVar i
else xor (and2 (not(mkVar j)) (h i (j-1)))
(and2 (mkVar j) (g i (j-1)))
and g i j = if i=j
then mkVar i
- else xor (and2 (not(mkVar i)) (h (i+1) j))
+ else xor (and2 (not(mkVar i)) (h (i+1) j))
(and2 (mkVar i) (g (i+1) j))
in
h 0 (n-1)
diff --git a/testsuite/tests/misc/boyer.ml b/testsuite/tests/misc/boyer.ml
index 4f4e081300..57912d1bdd 100644
--- a/testsuite/tests/misc/boyer.ml
+++ b/testsuite/tests/misc/boyer.ml
@@ -29,7 +29,7 @@ let rec print_term = function
print_string head.name;
List.iter (fun t -> print_string " "; print_term t) argl;
print_string ")"
-
+
let lemmas = ref ([] : head list)
(* Replacement for property lists *)
@@ -120,13 +120,13 @@ let add t = add_lemma (cterm_to_term t)
let _ =
add (CProp
("equal",
- [CProp ("compile",[CVar 5]);
+ [CProp ("compile",[CVar 5]);
CProp
("reverse",
[CProp ("codegen",[CProp ("optimize",[CVar 5]); CProp ("nil",[])])])]));
add (CProp
("equal",
- [CProp ("eqp",[CVar 23; CVar 24]);
+ [CProp ("eqp",[CVar 23; CVar 24]);
CProp ("equal",[CProp ("fix",[CVar 23]); CProp ("fix",[CVar 24])])]));
add (CProp
("equal",
@@ -139,120 +139,120 @@ add (CProp
[CProp ("ge",[CVar 23; CVar 24]); CProp ("le",[CVar 24; CVar 23])]));
add (CProp
("equal",
- [CProp ("boolean",[CVar 23]);
+ [CProp ("boolean",[CVar 23]);
CProp
("or",
- [CProp ("equal",[CVar 23; CProp ("true",[])]);
+ [CProp ("equal",[CVar 23; CProp ("true",[])]);
CProp ("equal",[CVar 23; CProp ("false",[])])])]));
add (CProp
("equal",
- [CProp ("iff",[CVar 23; CVar 24]);
+ [CProp ("iff",[CVar 23; CVar 24]);
CProp
("and",
- [CProp ("implies",[CVar 23; CVar 24]);
+ [CProp ("implies",[CVar 23; CVar 24]);
CProp ("implies",[CVar 24; CVar 23])])]));
add (CProp
("equal",
- [CProp ("even1",[CVar 23]);
+ [CProp ("even1",[CVar 23]);
CProp
("if",
- [CProp ("zerop",[CVar 23]); CProp ("true",[]);
+ [CProp ("zerop",[CVar 23]); CProp ("true",[]);
CProp ("odd",[CProp ("sub1",[CVar 23])])])]));
add (CProp
("equal",
- [CProp ("countps_",[CVar 11; CVar 15]);
+ [CProp ("countps_",[CVar 11; CVar 15]);
CProp ("countps_loop",[CVar 11; CVar 15; CProp ("zero",[])])]));
add (CProp
("equal",
- [CProp ("fact_",[CVar 8]);
+ [CProp ("fact_",[CVar 8]);
CProp ("fact_loop",[CVar 8; CProp ("one",[])])]));
add (CProp
("equal",
- [CProp ("reverse_",[CVar 23]);
+ [CProp ("reverse_",[CVar 23]);
CProp ("reverse_loop",[CVar 23; CProp ("nil",[])])]));
add (CProp
("equal",
- [CProp ("divides",[CVar 23; CVar 24]);
+ [CProp ("divides",[CVar 23; CVar 24]);
CProp ("zerop",[CProp ("remainder",[CVar 24; CVar 23])])]));
add (CProp
("equal",
- [CProp ("assume_true",[CVar 21; CVar 0]);
+ [CProp ("assume_true",[CVar 21; CVar 0]);
CProp ("cons",[CProp ("cons",[CVar 21; CProp ("true",[])]); CVar 0])]));
add (CProp
("equal",
- [CProp ("assume_false",[CVar 21; CVar 0]);
+ [CProp ("assume_false",[CVar 21; CVar 0]);
CProp ("cons",[CProp ("cons",[CVar 21; CProp ("false",[])]); CVar 0])]));
add (CProp
("equal",
- [CProp ("tautology_checker",[CVar 23]);
+ [CProp ("tautology_checker",[CVar 23]);
CProp ("tautologyp",[CProp ("normalize",[CVar 23]); CProp ("nil",[])])]));
add (CProp
("equal",
- [CProp ("falsify",[CVar 23]);
+ [CProp ("falsify",[CVar 23]);
CProp ("falsify1",[CProp ("normalize",[CVar 23]); CProp ("nil",[])])]));
add (CProp
("equal",
- [CProp ("prime",[CVar 23]);
+ [CProp ("prime",[CVar 23]);
CProp
("and",
- [CProp ("not",[CProp ("zerop",[CVar 23])]);
+ [CProp ("not",[CProp ("zerop",[CVar 23])]);
CProp
("not",
- [CProp ("equal",[CVar 23; CProp ("add1",[CProp ("zero",[])])])]);
+ [CProp ("equal",[CVar 23; CProp ("add1",[CProp ("zero",[])])])]);
CProp ("prime1",[CVar 23; CProp ("sub1",[CVar 23])])])]));
add (CProp
("equal",
- [CProp ("and",[CVar 15; CVar 16]);
+ [CProp ("and",[CVar 15; CVar 16]);
CProp
("if",
- [CVar 15;
- CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]);
+ [CVar 15;
+ CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]);
CProp ("false",[])])]));
add (CProp
("equal",
- [CProp ("or",[CVar 15; CVar 16]);
+ [CProp ("or",[CVar 15; CVar 16]);
CProp
("if",
- [CVar 15; CProp ("true",[]);
- CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]);
+ [CVar 15; CProp ("true",[]);
+ CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]);
CProp ("false",[])])]));
add (CProp
("equal",
- [CProp ("not",[CVar 15]);
+ [CProp ("not",[CVar 15]);
CProp ("if",[CVar 15; CProp ("false",[]); CProp ("true",[])])]));
add (CProp
("equal",
- [CProp ("implies",[CVar 15; CVar 16]);
+ [CProp ("implies",[CVar 15; CVar 16]);
CProp
("if",
- [CVar 15;
- CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]);
+ [CVar 15;
+ CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]);
CProp ("true",[])])]));
add (CProp
("equal",
- [CProp ("fix",[CVar 23]);
+ [CProp ("fix",[CVar 23]);
CProp ("if",[CProp ("numberp",[CVar 23]); CVar 23; CProp ("zero",[])])]));
add (CProp
("equal",
- [CProp ("if",[CProp ("if",[CVar 0; CVar 1; CVar 2]); CVar 3; CVar 4]);
+ [CProp ("if",[CProp ("if",[CVar 0; CVar 1; CVar 2]); CVar 3; CVar 4]);
CProp
("if",
- [CVar 0; CProp ("if",[CVar 1; CVar 3; CVar 4]);
+ [CVar 0; CProp ("if",[CVar 1; CVar 3; CVar 4]);
CProp ("if",[CVar 2; CVar 3; CVar 4])])]));
add (CProp
("equal",
- [CProp ("zerop",[CVar 23]);
+ [CProp ("zerop",[CVar 23]);
CProp
("or",
- [CProp ("equal",[CVar 23; CProp ("zero",[])]);
+ [CProp ("equal",[CVar 23; CProp ("zero",[])]);
CProp ("not",[CProp ("numberp",[CVar 23])])])]));
add (CProp
("equal",
- [CProp ("plus",[CProp ("plus",[CVar 23; CVar 24]); CVar 25]);
+ [CProp ("plus",[CProp ("plus",[CVar 23; CVar 24]); CVar 25]);
CProp ("plus",[CVar 23; CProp ("plus",[CVar 24; CVar 25])])]));
add (CProp
("equal",
- [CProp ("equal",[CProp ("plus",[CVar 0; CVar 1]); CProp ("zero",[])]);
+ [CProp ("equal",[CProp ("plus",[CVar 0; CVar 1]); CProp ("zero",[])]);
CProp ("and",[CProp ("zerop",[CVar 0]); CProp ("zerop",[CVar 1])])]));
add (CProp
("equal",[CProp ("difference",[CVar 23; CVar 23]); CProp ("zero",[])]));
@@ -260,90 +260,90 @@ add (CProp
("equal",
[CProp
("equal",
- [CProp ("plus",[CVar 0; CVar 1]); CProp ("plus",[CVar 0; CVar 2])]);
+ [CProp ("plus",[CVar 0; CVar 1]); CProp ("plus",[CVar 0; CVar 2])]);
CProp ("equal",[CProp ("fix",[CVar 1]); CProp ("fix",[CVar 2])])]));
add (CProp
("equal",
[CProp
- ("equal",[CProp ("zero",[]); CProp ("difference",[CVar 23; CVar 24])]);
+ ("equal",[CProp ("zero",[]); CProp ("difference",[CVar 23; CVar 24])]);
CProp ("not",[CProp ("gt",[CVar 24; CVar 23])])]));
add (CProp
("equal",
- [CProp ("equal",[CVar 23; CProp ("difference",[CVar 23; CVar 24])]);
+ [CProp ("equal",[CVar 23; CProp ("difference",[CVar 23; CVar 24])]);
CProp
("and",
- [CProp ("numberp",[CVar 23]);
+ [CProp ("numberp",[CVar 23]);
CProp
("or",
- [CProp ("equal",[CVar 23; CProp ("zero",[])]);
+ [CProp ("equal",[CVar 23; CProp ("zero",[])]);
CProp ("zerop",[CVar 24])])])]));
add (CProp
("equal",
[CProp
("meaning",
- [CProp ("plus_tree",[CProp ("append",[CVar 23; CVar 24])]); CVar 0]);
+ [CProp ("plus_tree",[CProp ("append",[CVar 23; CVar 24])]); CVar 0]);
CProp
("plus",
- [CProp ("meaning",[CProp ("plus_tree",[CVar 23]); CVar 0]);
+ [CProp ("meaning",[CProp ("plus_tree",[CVar 23]); CVar 0]);
CProp ("meaning",[CProp ("plus_tree",[CVar 24]); CVar 0])])]));
add (CProp
("equal",
[CProp
("meaning",
- [CProp ("plus_tree",[CProp ("plus_fringe",[CVar 23])]); CVar 0]);
+ [CProp ("plus_tree",[CProp ("plus_fringe",[CVar 23])]); CVar 0]);
CProp ("fix",[CProp ("meaning",[CVar 23; CVar 0])])]));
add (CProp
("equal",
- [CProp ("append",[CProp ("append",[CVar 23; CVar 24]); CVar 25]);
+ [CProp ("append",[CProp ("append",[CVar 23; CVar 24]); CVar 25]);
CProp ("append",[CVar 23; CProp ("append",[CVar 24; CVar 25])])]));
add (CProp
("equal",
- [CProp ("reverse",[CProp ("append",[CVar 0; CVar 1])]);
+ [CProp ("reverse",[CProp ("append",[CVar 0; CVar 1])]);
CProp
("append",[CProp ("reverse",[CVar 1]); CProp ("reverse",[CVar 0])])]));
add (CProp
("equal",
- [CProp ("times",[CVar 23; CProp ("plus",[CVar 24; CVar 25])]);
+ [CProp ("times",[CVar 23; CProp ("plus",[CVar 24; CVar 25])]);
CProp
("plus",
- [CProp ("times",[CVar 23; CVar 24]);
+ [CProp ("times",[CVar 23; CVar 24]);
CProp ("times",[CVar 23; CVar 25])])]));
add (CProp
("equal",
- [CProp ("times",[CProp ("times",[CVar 23; CVar 24]); CVar 25]);
+ [CProp ("times",[CProp ("times",[CVar 23; CVar 24]); CVar 25]);
CProp ("times",[CVar 23; CProp ("times",[CVar 24; CVar 25])])]));
add (CProp
("equal",
[CProp
- ("equal",[CProp ("times",[CVar 23; CVar 24]); CProp ("zero",[])]);
+ ("equal",[CProp ("times",[CVar 23; CVar 24]); CProp ("zero",[])]);
CProp ("or",[CProp ("zerop",[CVar 23]); CProp ("zerop",[CVar 24])])]));
add (CProp
("equal",
- [CProp ("exec",[CProp ("append",[CVar 23; CVar 24]); CVar 15; CVar 4]);
+ [CProp ("exec",[CProp ("append",[CVar 23; CVar 24]); CVar 15; CVar 4]);
CProp
("exec",[CVar 24; CProp ("exec",[CVar 23; CVar 15; CVar 4]); CVar 4])]));
add (CProp
("equal",
- [CProp ("mc_flatten",[CVar 23; CVar 24]);
+ [CProp ("mc_flatten",[CVar 23; CVar 24]);
CProp ("append",[CProp ("flatten",[CVar 23]); CVar 24])]));
add (CProp
("equal",
- [CProp ("member",[CVar 23; CProp ("append",[CVar 0; CVar 1])]);
+ [CProp ("member",[CVar 23; CProp ("append",[CVar 0; CVar 1])]);
CProp
("or",
- [CProp ("member",[CVar 23; CVar 0]);
+ [CProp ("member",[CVar 23; CVar 0]);
CProp ("member",[CVar 23; CVar 1])])]));
add (CProp
("equal",
- [CProp ("member",[CVar 23; CProp ("reverse",[CVar 24])]);
+ [CProp ("member",[CVar 23; CProp ("reverse",[CVar 24])]);
CProp ("member",[CVar 23; CVar 24])]));
add (CProp
("equal",
- [CProp ("length",[CProp ("reverse",[CVar 23])]);
+ [CProp ("length",[CProp ("reverse",[CVar 23])]);
CProp ("length",[CVar 23])]));
add (CProp
("equal",
- [CProp ("member",[CVar 0; CProp ("intersect",[CVar 1; CVar 2])]);
+ [CProp ("member",[CVar 0; CProp ("intersect",[CVar 1; CVar 2])]);
CProp
("and",
[CProp ("member",[CVar 0; CVar 1]); CProp ("member",[CVar 0; CVar 2])])]));
@@ -351,89 +351,89 @@ add (CProp
("equal",[CProp ("nth",[CProp ("zero",[]); CVar 8]); CProp ("zero",[])]));
add (CProp
("equal",
- [CProp ("exp",[CVar 8; CProp ("plus",[CVar 9; CVar 10])]);
+ [CProp ("exp",[CVar 8; CProp ("plus",[CVar 9; CVar 10])]);
CProp
("times",
[CProp ("exp",[CVar 8; CVar 9]); CProp ("exp",[CVar 8; CVar 10])])]));
add (CProp
("equal",
- [CProp ("exp",[CVar 8; CProp ("times",[CVar 9; CVar 10])]);
+ [CProp ("exp",[CVar 8; CProp ("times",[CVar 9; CVar 10])]);
CProp ("exp",[CProp ("exp",[CVar 8; CVar 9]); CVar 10])]));
add (CProp
("equal",
- [CProp ("reverse_loop",[CVar 23; CVar 24]);
+ [CProp ("reverse_loop",[CVar 23; CVar 24]);
CProp ("append",[CProp ("reverse",[CVar 23]); CVar 24])]));
add (CProp
("equal",
- [CProp ("reverse_loop",[CVar 23; CProp ("nil",[])]);
+ [CProp ("reverse_loop",[CVar 23; CProp ("nil",[])]);
CProp ("reverse",[CVar 23])]));
add (CProp
("equal",
- [CProp ("count_list",[CVar 25; CProp ("sort_lp",[CVar 23; CVar 24])]);
+ [CProp ("count_list",[CVar 25; CProp ("sort_lp",[CVar 23; CVar 24])]);
CProp
("plus",
- [CProp ("count_list",[CVar 25; CVar 23]);
+ [CProp ("count_list",[CVar 25; CVar 23]);
CProp ("count_list",[CVar 25; CVar 24])])]));
add (CProp
("equal",
[CProp
("equal",
- [CProp ("append",[CVar 0; CVar 1]); CProp ("append",[CVar 0; CVar 2])]);
+ [CProp ("append",[CVar 0; CVar 1]); CProp ("append",[CVar 0; CVar 2])]);
CProp ("equal",[CVar 1; CVar 2])]));
add (CProp
("equal",
[CProp
("plus",
- [CProp ("remainder",[CVar 23; CVar 24]);
- CProp ("times",[CVar 24; CProp ("quotient",[CVar 23; CVar 24])])]);
+ [CProp ("remainder",[CVar 23; CVar 24]);
+ CProp ("times",[CVar 24; CProp ("quotient",[CVar 23; CVar 24])])]);
CProp ("fix",[CVar 23])]));
add (CProp
("equal",
[CProp
- ("power_eval",[CProp ("big_plus",[CVar 11; CVar 8; CVar 1]); CVar 1]);
+ ("power_eval",[CProp ("big_plus",[CVar 11; CVar 8; CVar 1]); CVar 1]);
CProp ("plus",[CProp ("power_eval",[CVar 11; CVar 1]); CVar 8])]));
add (CProp
("equal",
[CProp
("power_eval",
- [CProp ("big_plus",[CVar 23; CVar 24; CVar 8; CVar 1]); CVar 1]);
+ [CProp ("big_plus",[CVar 23; CVar 24; CVar 8; CVar 1]); CVar 1]);
CProp
("plus",
- [CVar 8;
+ [CVar 8;
CProp
("plus",
- [CProp ("power_eval",[CVar 23; CVar 1]);
+ [CProp ("power_eval",[CVar 23; CVar 1]);
CProp ("power_eval",[CVar 24; CVar 1])])])]));
add (CProp
("equal",
[CProp ("remainder",[CVar 24; CProp ("one",[])]); CProp ("zero",[])]));
add (CProp
("equal",
- [CProp ("lt",[CProp ("remainder",[CVar 23; CVar 24]); CVar 24]);
+ [CProp ("lt",[CProp ("remainder",[CVar 23; CVar 24]); CVar 24]);
CProp ("not",[CProp ("zerop",[CVar 24])])]));
add (CProp
("equal",[CProp ("remainder",[CVar 23; CVar 23]); CProp ("zero",[])]));
add (CProp
("equal",
- [CProp ("lt",[CProp ("quotient",[CVar 8; CVar 9]); CVar 8]);
+ [CProp ("lt",[CProp ("quotient",[CVar 8; CVar 9]); CVar 8]);
CProp
("and",
- [CProp ("not",[CProp ("zerop",[CVar 8])]);
+ [CProp ("not",[CProp ("zerop",[CVar 8])]);
CProp
("or",
- [CProp ("zerop",[CVar 9]);
+ [CProp ("zerop",[CVar 9]);
CProp ("not",[CProp ("equal",[CVar 9; CProp ("one",[])])])])])]));
add (CProp
("equal",
- [CProp ("lt",[CProp ("remainder",[CVar 23; CVar 24]); CVar 23]);
+ [CProp ("lt",[CProp ("remainder",[CVar 23; CVar 24]); CVar 23]);
CProp
("and",
- [CProp ("not",[CProp ("zerop",[CVar 24])]);
- CProp ("not",[CProp ("zerop",[CVar 23])]);
+ [CProp ("not",[CProp ("zerop",[CVar 24])]);
+ CProp ("not",[CProp ("zerop",[CVar 23])]);
CProp ("not",[CProp ("lt",[CVar 23; CVar 24])])])]));
add (CProp
("equal",
- [CProp ("power_eval",[CProp ("power_rep",[CVar 8; CVar 1]); CVar 1]);
+ [CProp ("power_eval",[CProp ("power_rep",[CVar 8; CVar 1]); CVar 1]);
CProp ("fix",[CVar 8])]));
add (CProp
("equal",
@@ -441,199 +441,199 @@ add (CProp
("power_eval",
[CProp
("big_plus",
- [CProp ("power_rep",[CVar 8; CVar 1]);
- CProp ("power_rep",[CVar 9; CVar 1]); CProp ("zero",[]);
- CVar 1]);
- CVar 1]);
+ [CProp ("power_rep",[CVar 8; CVar 1]);
+ CProp ("power_rep",[CVar 9; CVar 1]); CProp ("zero",[]);
+ CVar 1]);
+ CVar 1]);
CProp ("plus",[CVar 8; CVar 9])]));
add (CProp
("equal",
[CProp ("gcd",[CVar 23; CVar 24]); CProp ("gcd",[CVar 24; CVar 23])]));
add (CProp
("equal",
- [CProp ("nth",[CProp ("append",[CVar 0; CVar 1]); CVar 8]);
+ [CProp ("nth",[CProp ("append",[CVar 0; CVar 1]); CVar 8]);
CProp
("append",
- [CProp ("nth",[CVar 0; CVar 8]);
+ [CProp ("nth",[CVar 0; CVar 8]);
CProp
("nth",
[CVar 1; CProp ("difference",[CVar 8; CProp ("length",[CVar 0])])])])]));
add (CProp
("equal",
- [CProp ("difference",[CProp ("plus",[CVar 23; CVar 24]); CVar 23]);
+ [CProp ("difference",[CProp ("plus",[CVar 23; CVar 24]); CVar 23]);
CProp ("fix",[CVar 24])]));
add (CProp
("equal",
- [CProp ("difference",[CProp ("plus",[CVar 24; CVar 23]); CVar 23]);
+ [CProp ("difference",[CProp ("plus",[CVar 24; CVar 23]); CVar 23]);
CProp ("fix",[CVar 24])]));
add (CProp
("equal",
[CProp
("difference",
- [CProp ("plus",[CVar 23; CVar 24]); CProp ("plus",[CVar 23; CVar 25])]);
+ [CProp ("plus",[CVar 23; CVar 24]); CProp ("plus",[CVar 23; CVar 25])]);
CProp ("difference",[CVar 24; CVar 25])]));
add (CProp
("equal",
- [CProp ("times",[CVar 23; CProp ("difference",[CVar 2; CVar 22])]);
+ [CProp ("times",[CVar 23; CProp ("difference",[CVar 2; CVar 22])]);
CProp
("difference",
- [CProp ("times",[CVar 2; CVar 23]);
+ [CProp ("times",[CVar 2; CVar 23]);
CProp ("times",[CVar 22; CVar 23])])]));
add (CProp
("equal",
- [CProp ("remainder",[CProp ("times",[CVar 23; CVar 25]); CVar 25]);
+ [CProp ("remainder",[CProp ("times",[CVar 23; CVar 25]); CVar 25]);
CProp ("zero",[])]));
add (CProp
("equal",
[CProp
("difference",
- [CProp ("plus",[CVar 1; CProp ("plus",[CVar 0; CVar 2])]); CVar 0]);
+ [CProp ("plus",[CVar 1; CProp ("plus",[CVar 0; CVar 2])]); CVar 0]);
CProp ("plus",[CVar 1; CVar 2])]));
add (CProp
("equal",
[CProp
("difference",
- [CProp ("add1",[CProp ("plus",[CVar 24; CVar 25])]); CVar 25]);
+ [CProp ("add1",[CProp ("plus",[CVar 24; CVar 25])]); CVar 25]);
CProp ("add1",[CVar 24])]));
add (CProp
("equal",
[CProp
("lt",
- [CProp ("plus",[CVar 23; CVar 24]); CProp ("plus",[CVar 23; CVar 25])]);
+ [CProp ("plus",[CVar 23; CVar 24]); CProp ("plus",[CVar 23; CVar 25])]);
CProp ("lt",[CVar 24; CVar 25])]));
add (CProp
("equal",
[CProp
("lt",
- [CProp ("times",[CVar 23; CVar 25]);
- CProp ("times",[CVar 24; CVar 25])]);
+ [CProp ("times",[CVar 23; CVar 25]);
+ CProp ("times",[CVar 24; CVar 25])]);
CProp
("and",
- [CProp ("not",[CProp ("zerop",[CVar 25])]);
+ [CProp ("not",[CProp ("zerop",[CVar 25])]);
CProp ("lt",[CVar 23; CVar 24])])]));
add (CProp
("equal",
- [CProp ("lt",[CVar 24; CProp ("plus",[CVar 23; CVar 24])]);
+ [CProp ("lt",[CVar 24; CProp ("plus",[CVar 23; CVar 24])]);
CProp ("not",[CProp ("zerop",[CVar 23])])]));
add (CProp
("equal",
[CProp
("gcd",
- [CProp ("times",[CVar 23; CVar 25]);
- CProp ("times",[CVar 24; CVar 25])]);
+ [CProp ("times",[CVar 23; CVar 25]);
+ CProp ("times",[CVar 24; CVar 25])]);
CProp ("times",[CVar 25; CProp ("gcd",[CVar 23; CVar 24])])]));
add (CProp
("equal",
- [CProp ("value",[CProp ("normalize",[CVar 23]); CVar 0]);
+ [CProp ("value",[CProp ("normalize",[CVar 23]); CVar 0]);
CProp ("value",[CVar 23; CVar 0])]));
add (CProp
("equal",
[CProp
("equal",
- [CProp ("flatten",[CVar 23]);
- CProp ("cons",[CVar 24; CProp ("nil",[])])]);
+ [CProp ("flatten",[CVar 23]);
+ CProp ("cons",[CVar 24; CProp ("nil",[])])]);
CProp
("and",
[CProp ("nlistp",[CVar 23]); CProp ("equal",[CVar 23; CVar 24])])]));
add (CProp
("equal",
- [CProp ("listp",[CProp ("gother",[CVar 23])]);
+ [CProp ("listp",[CProp ("gother",[CVar 23])]);
CProp ("listp",[CVar 23])]));
add (CProp
("equal",
- [CProp ("samefringe",[CVar 23; CVar 24]);
+ [CProp ("samefringe",[CVar 23; CVar 24]);
CProp
("equal",[CProp ("flatten",[CVar 23]); CProp ("flatten",[CVar 24])])]));
add (CProp
("equal",
[CProp
("equal",
- [CProp ("greatest_factor",[CVar 23; CVar 24]); CProp ("zero",[])]);
+ [CProp ("greatest_factor",[CVar 23; CVar 24]); CProp ("zero",[])]);
CProp
("and",
[CProp
("or",
- [CProp ("zerop",[CVar 24]);
- CProp ("equal",[CVar 24; CProp ("one",[])])]);
+ [CProp ("zerop",[CVar 24]);
+ CProp ("equal",[CVar 24; CProp ("one",[])])]);
CProp ("equal",[CVar 23; CProp ("zero",[])])])]));
add (CProp
("equal",
[CProp
("equal",
- [CProp ("greatest_factor",[CVar 23; CVar 24]); CProp ("one",[])]);
+ [CProp ("greatest_factor",[CVar 23; CVar 24]); CProp ("one",[])]);
CProp ("equal",[CVar 23; CProp ("one",[])])]));
add (CProp
("equal",
- [CProp ("numberp",[CProp ("greatest_factor",[CVar 23; CVar 24])]);
+ [CProp ("numberp",[CProp ("greatest_factor",[CVar 23; CVar 24])]);
CProp
("not",
[CProp
("and",
[CProp
("or",
- [CProp ("zerop",[CVar 24]);
- CProp ("equal",[CVar 24; CProp ("one",[])])]);
+ [CProp ("zerop",[CVar 24]);
+ CProp ("equal",[CVar 24; CProp ("one",[])])]);
CProp ("not",[CProp ("numberp",[CVar 23])])])])]));
add (CProp
("equal",
- [CProp ("times_list",[CProp ("append",[CVar 23; CVar 24])]);
+ [CProp ("times_list",[CProp ("append",[CVar 23; CVar 24])]);
CProp
("times",
[CProp ("times_list",[CVar 23]); CProp ("times_list",[CVar 24])])]));
add (CProp
("equal",
- [CProp ("prime_list",[CProp ("append",[CVar 23; CVar 24])]);
+ [CProp ("prime_list",[CProp ("append",[CVar 23; CVar 24])]);
CProp
("and",
[CProp ("prime_list",[CVar 23]); CProp ("prime_list",[CVar 24])])]));
add (CProp
("equal",
- [CProp ("equal",[CVar 25; CProp ("times",[CVar 22; CVar 25])]);
+ [CProp ("equal",[CVar 25; CProp ("times",[CVar 22; CVar 25])]);
CProp
("and",
- [CProp ("numberp",[CVar 25]);
+ [CProp ("numberp",[CVar 25]);
CProp
("or",
- [CProp ("equal",[CVar 25; CProp ("zero",[])]);
+ [CProp ("equal",[CVar 25; CProp ("zero",[])]);
CProp ("equal",[CVar 22; CProp ("one",[])])])])]));
add (CProp
("equal",
- [CProp ("ge",[CVar 23; CVar 24]);
+ [CProp ("ge",[CVar 23; CVar 24]);
CProp ("not",[CProp ("lt",[CVar 23; CVar 24])])]));
add (CProp
("equal",
- [CProp ("equal",[CVar 23; CProp ("times",[CVar 23; CVar 24])]);
+ [CProp ("equal",[CVar 23; CProp ("times",[CVar 23; CVar 24])]);
CProp
("or",
- [CProp ("equal",[CVar 23; CProp ("zero",[])]);
+ [CProp ("equal",[CVar 23; CProp ("zero",[])]);
CProp
("and",
- [CProp ("numberp",[CVar 23]);
+ [CProp ("numberp",[CVar 23]);
CProp ("equal",[CVar 24; CProp ("one",[])])])])]));
add (CProp
("equal",
- [CProp ("remainder",[CProp ("times",[CVar 24; CVar 23]); CVar 24]);
+ [CProp ("remainder",[CProp ("times",[CVar 24; CVar 23]); CVar 24]);
CProp ("zero",[])]));
add (CProp
("equal",
- [CProp ("equal",[CProp ("times",[CVar 0; CVar 1]); CProp ("one",[])]);
+ [CProp ("equal",[CProp ("times",[CVar 0; CVar 1]); CProp ("one",[])]);
CProp
("and",
- [CProp ("not",[CProp ("equal",[CVar 0; CProp ("zero",[])])]);
- CProp ("not",[CProp ("equal",[CVar 1; CProp ("zero",[])])]);
- CProp ("numberp",[CVar 0]); CProp ("numberp",[CVar 1]);
- CProp ("equal",[CProp ("sub1",[CVar 0]); CProp ("zero",[])]);
+ [CProp ("not",[CProp ("equal",[CVar 0; CProp ("zero",[])])]);
+ CProp ("not",[CProp ("equal",[CVar 1; CProp ("zero",[])])]);
+ CProp ("numberp",[CVar 0]); CProp ("numberp",[CVar 1]);
+ CProp ("equal",[CProp ("sub1",[CVar 0]); CProp ("zero",[])]);
CProp ("equal",[CProp ("sub1",[CVar 1]); CProp ("zero",[])])])]));
add (CProp
("equal",
[CProp
("lt",
- [CProp ("length",[CProp ("delete",[CVar 23; CVar 11])]);
- CProp ("length",[CVar 11])]);
+ [CProp ("length",[CProp ("delete",[CVar 23; CVar 11])]);
+ CProp ("length",[CVar 11])]);
CProp ("member",[CVar 23; CVar 11])]));
add (CProp
("equal",
- [CProp ("sort2",[CProp ("delete",[CVar 23; CVar 11])]);
+ [CProp ("sort2",[CProp ("delete",[CVar 23; CVar 11])]);
CProp ("delete",[CVar 23; CProp ("sort2",[CVar 11])])]));
add (CProp ("equal",[CProp ("dsort",[CVar 23]); CProp ("sort2",[CVar 23])]));
add (CProp
@@ -642,145 +642,145 @@ add (CProp
("length",
[CProp
("cons",
- [CVar 0;
+ [CVar 0;
CProp
("cons",
- [CVar 1;
+ [CVar 1;
CProp
("cons",
- [CVar 2;
+ [CVar 2;
CProp
("cons",
- [CVar 3;
+ [CVar 3;
CProp ("cons",[CVar 4; CProp ("cons",[CVar 5; CVar 6])])])])])])])
; CProp ("plus",[CProp ("six",[]); CProp ("length",[CVar 6])])]));
add (CProp
("equal",
[CProp
("difference",
- [CProp ("add1",[CProp ("add1",[CVar 23])]); CProp ("two",[])]);
+ [CProp ("add1",[CProp ("add1",[CVar 23])]); CProp ("two",[])]);
CProp ("fix",[CVar 23])]));
add (CProp
("equal",
[CProp
("quotient",
- [CProp ("plus",[CVar 23; CProp ("plus",[CVar 23; CVar 24])]);
- CProp ("two",[])]);
+ [CProp ("plus",[CVar 23; CProp ("plus",[CVar 23; CVar 24])]);
+ CProp ("two",[])]);
CProp
("plus",[CVar 23; CProp ("quotient",[CVar 24; CProp ("two",[])])])]));
add (CProp
("equal",
- [CProp ("sigma",[CProp ("zero",[]); CVar 8]);
+ [CProp ("sigma",[CProp ("zero",[]); CVar 8]);
CProp
("quotient",
[CProp ("times",[CVar 8; CProp ("add1",[CVar 8])]); CProp ("two",[])])]));
add (CProp
("equal",
- [CProp ("plus",[CVar 23; CProp ("add1",[CVar 24])]);
+ [CProp ("plus",[CVar 23; CProp ("add1",[CVar 24])]);
CProp
("if",
- [CProp ("numberp",[CVar 24]);
- CProp ("add1",[CProp ("plus",[CVar 23; CVar 24])]);
+ [CProp ("numberp",[CVar 24]);
+ CProp ("add1",[CProp ("plus",[CVar 23; CVar 24])]);
CProp ("add1",[CVar 23])])]));
add (CProp
("equal",
[CProp
("equal",
- [CProp ("difference",[CVar 23; CVar 24]);
- CProp ("difference",[CVar 25; CVar 24])]);
+ [CProp ("difference",[CVar 23; CVar 24]);
+ CProp ("difference",[CVar 25; CVar 24])]);
CProp
("if",
- [CProp ("lt",[CVar 23; CVar 24]);
- CProp ("not",[CProp ("lt",[CVar 24; CVar 25])]);
+ [CProp ("lt",[CVar 23; CVar 24]);
+ CProp ("not",[CProp ("lt",[CVar 24; CVar 25])]);
CProp
("if",
- [CProp ("lt",[CVar 25; CVar 24]);
- CProp ("not",[CProp ("lt",[CVar 24; CVar 23])]);
+ [CProp ("lt",[CVar 25; CVar 24]);
+ CProp ("not",[CProp ("lt",[CVar 24; CVar 23])]);
CProp ("equal",[CProp ("fix",[CVar 23]); CProp ("fix",[CVar 25])])])])])
);
add (CProp
("equal",
[CProp
("meaning",
- [CProp ("plus_tree",[CProp ("delete",[CVar 23; CVar 24])]); CVar 0]);
+ [CProp ("plus_tree",[CProp ("delete",[CVar 23; CVar 24])]); CVar 0]);
CProp
("if",
- [CProp ("member",[CVar 23; CVar 24]);
+ [CProp ("member",[CVar 23; CVar 24]);
CProp
("difference",
- [CProp ("meaning",[CProp ("plus_tree",[CVar 24]); CVar 0]);
- CProp ("meaning",[CVar 23; CVar 0])]);
+ [CProp ("meaning",[CProp ("plus_tree",[CVar 24]); CVar 0]);
+ CProp ("meaning",[CVar 23; CVar 0])]);
CProp ("meaning",[CProp ("plus_tree",[CVar 24]); CVar 0])])]));
add (CProp
("equal",
- [CProp ("times",[CVar 23; CProp ("add1",[CVar 24])]);
+ [CProp ("times",[CVar 23; CProp ("add1",[CVar 24])]);
CProp
("if",
- [CProp ("numberp",[CVar 24]);
+ [CProp ("numberp",[CVar 24]);
CProp
("plus",
- [CVar 23; CProp ("times",[CVar 23; CVar 24]);
+ [CVar 23; CProp ("times",[CVar 23; CVar 24]);
CProp ("fix",[CVar 23])])])]));
add (CProp
("equal",
- [CProp ("nth",[CProp ("nil",[]); CVar 8]);
+ [CProp ("nth",[CProp ("nil",[]); CVar 8]);
CProp
("if",[CProp ("zerop",[CVar 8]); CProp ("nil",[]); CProp ("zero",[])])]));
add (CProp
("equal",
- [CProp ("last",[CProp ("append",[CVar 0; CVar 1])]);
+ [CProp ("last",[CProp ("append",[CVar 0; CVar 1])]);
CProp
("if",
- [CProp ("listp",[CVar 1]); CProp ("last",[CVar 1]);
+ [CProp ("listp",[CVar 1]); CProp ("last",[CVar 1]);
CProp
("if",
- [CProp ("listp",[CVar 0]);
- CProp ("cons",[CProp ("car",[CProp ("last",[CVar 0])]); CVar 1]);
+ [CProp ("listp",[CVar 0]);
+ CProp ("cons",[CProp ("car",[CProp ("last",[CVar 0])]); CVar 1]);
CVar 1])])]));
add (CProp
("equal",
- [CProp ("equal",[CProp ("lt",[CVar 23; CVar 24]); CVar 25]);
+ [CProp ("equal",[CProp ("lt",[CVar 23; CVar 24]); CVar 25]);
CProp
("if",
- [CProp ("lt",[CVar 23; CVar 24]);
- CProp ("equal",[CProp ("true",[]); CVar 25]);
+ [CProp ("lt",[CVar 23; CVar 24]);
+ CProp ("equal",[CProp ("true",[]); CVar 25]);
CProp ("equal",[CProp ("false",[]); CVar 25])])]));
add (CProp
("equal",
- [CProp ("assignment",[CVar 23; CProp ("append",[CVar 0; CVar 1])]);
+ [CProp ("assignment",[CVar 23; CProp ("append",[CVar 0; CVar 1])]);
CProp
("if",
- [CProp ("assignedp",[CVar 23; CVar 0]);
- CProp ("assignment",[CVar 23; CVar 0]);
+ [CProp ("assignedp",[CVar 23; CVar 0]);
+ CProp ("assignment",[CVar 23; CVar 0]);
CProp ("assignment",[CVar 23; CVar 1])])]));
add (CProp
("equal",
- [CProp ("car",[CProp ("gother",[CVar 23])]);
+ [CProp ("car",[CProp ("gother",[CVar 23])]);
CProp
("if",
- [CProp ("listp",[CVar 23]);
+ [CProp ("listp",[CVar 23]);
CProp ("car",[CProp ("flatten",[CVar 23])]); CProp ("zero",[])])]));
add (CProp
("equal",
- [CProp ("flatten",[CProp ("cdr",[CProp ("gother",[CVar 23])])]);
+ [CProp ("flatten",[CProp ("cdr",[CProp ("gother",[CVar 23])])]);
CProp
("if",
- [CProp ("listp",[CVar 23]);
- CProp ("cdr",[CProp ("flatten",[CVar 23])]);
+ [CProp ("listp",[CVar 23]);
+ CProp ("cdr",[CProp ("flatten",[CVar 23])]);
CProp ("cons",[CProp ("zero",[]); CProp ("nil",[])])])]));
add (CProp
("equal",
- [CProp ("quotient",[CProp ("times",[CVar 24; CVar 23]); CVar 24]);
+ [CProp ("quotient",[CProp ("times",[CVar 24; CVar 23]); CVar 24]);
CProp
("if",
- [CProp ("zerop",[CVar 24]); CProp ("zero",[]);
+ [CProp ("zerop",[CVar 24]); CProp ("zero",[]);
CProp ("fix",[CVar 23])])]));
add (CProp
("equal",
- [CProp ("get",[CVar 9; CProp ("set",[CVar 8; CVar 21; CVar 12])]);
+ [CProp ("get",[CVar 9; CProp ("set",[CVar 8; CVar 21; CVar 12])]);
CProp
("if",
- [CProp ("eqp",[CVar 9; CVar 8]); CVar 21;
+ [CProp ("eqp",[CVar 9; CVar 8]); CVar 21;
CProp ("get",[CVar 9; CVar 12])])]))
(* Tautology checker *)
@@ -822,7 +822,7 @@ let rec tautologyp x true_lst false_lst =
end
-let tautp x =
+let tautp x =
(* print_term x; print_string"\n"; *)
let y = rewrite x in
(* print_term y; print_string "\n"; *)
diff --git a/testsuite/tests/misc/fib.ml b/testsuite/tests/misc/fib.ml
index 4160004ea4..7311c8128a 100644
--- a/testsuite/tests/misc/fib.ml
+++ b/testsuite/tests/misc/fib.ml
@@ -17,8 +17,7 @@ let rec fib n =
let _ =
let n =
- if Array.length Sys.argv >= 2
+ if Array.length Sys.argv >= 2
then int_of_string Sys.argv.(1)
else 40 in
print_int(fib n); print_newline(); exit 0
-
diff --git a/testsuite/tests/misc/nucleic.ml b/testsuite/tests/misc/nucleic.ml
index b35360a882..624300806f 100644
--- a/testsuite/tests/misc/nucleic.ml
+++ b/testsuite/tests/misc/nucleic.ml
@@ -60,14 +60,14 @@ pt_theta p
matrices don't have the perspective terms and are the transpose of
Paul's one. See also "M\"antyl\"a, M. (1985) An Introduction to
Solid Modeling, Computer Science Press" Appendix A.
-
+
The components of a transformation matrix are named like this:
-
+
a b c
d e f
g h i
tx ty tz
-
+
The components tx, ty, and tz are the translation vector.
*)
@@ -208,7 +208,7 @@ tfo_align p1 p2 p3
(*
Numbering of atoms follows the paper:
-
+
IUPAC-IUB Joint Commission on Biochemical Nomenclature (JCBN)
(1983) Abbreviations and Symbols for the Description of
Conformations of Polynucleotide Chains. Eur. J. Biochem 131,
@@ -273,7 +273,7 @@ nuc_C1'
= c1'
let
-nuc_C2
+nuc_C2
(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
@@ -287,7 +287,7 @@ nuc_C3'
= c3'
let
-nuc_C4
+nuc_C4
(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
@@ -301,7 +301,7 @@ nuc_C4'
= c4'
let
-nuc_N1
+nuc_N1
(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
@@ -2896,13 +2896,13 @@ let rec search (partial_inst : variable list) l constr =
(* -- DOMAINS ---------------------------------------------------------------*)
(* Primary structure: strand A CUGCCACGUCUG, strand B CAGACGUGGCAG
-
+
Secondary structure: strand A CUGCCACGUCUG
||||||||||||
GACGGUGCAGAC strand B
-
+
Tertiary structure:
-
+
5' end of strand A C1----G12 3' end of strand B
U2-------A11
G3-------C10
@@ -2915,13 +2915,13 @@ let rec search (partial_inst : variable list) l constr =
G3--------C10
A2-------U11
5' end of strand B C1----G12 3' end of strand A
-
+
"helix", "stacked" and "connected" describe the spatial relationship
between two consecutive nucleotides. E.g. the nucleotides C1 and U2
from the strand A.
-
+
"wc" (stands for Watson-Crick and is a type of base-pairing),
- and "wc-dumas" describe the spatial relationship between
+ and "wc-dumas" describe the spatial relationship between
nucleotides from two chains that are growing in opposite directions.
E.g. the nucleotides C1 from strand A and G12 from strand B.
*)
@@ -2965,7 +2965,7 @@ let
reference n i partial_inst = [ mk_var i tfo_id n ]
(* The transformation matrix for wc is from:
-
+
Chandrasekaran R. et al (1989) A Re-Examination of the Crystal
Structure of A-DNA Using Fiber Diffraction Data. J. Biomol.
Struct. & Dynamics 6(6):1189-1202.
@@ -3047,7 +3047,7 @@ let
a38_g37 nucl i j partial_inst
= mk_var i (dgf_base a38_g37_tfo (get_var j partial_inst) nucl) nucl
-let
+let
stacked3' nucl i j partial_inst
= (a38_g37 nucl i j partial_inst) :: (helix3' nucl i j partial_inst)
@@ -3146,7 +3146,7 @@ pseudoknot_domains
stacked5' rU 5 4; (* | 4.5 Angstroms *)
stacked5' rC 6 5 (* <-' *)
]
-
+
(* Pseudoknot constraint *)
let
@@ -3212,7 +3212,7 @@ var_most_distant_atom v =
let max_dist = ref 0.0 in
for i = 0 to pred (Array.length atoms) do
let p = atoms.(i) in
- let distance =
+ let distance =
let pos = absolute_pos v p
in sqrt ((pos.x * pos.x) + (pos.y * pos.y) + (pos.z * pos.z)) in
if distance > !max_dist then max_dist := distance
diff --git a/testsuite/tests/misc/sieve.ml b/testsuite/tests/misc/sieve.ml
index 7f0295bb67..0cf4b31016 100644
--- a/testsuite/tests/misc/sieve.ml
+++ b/testsuite/tests/misc/sieve.ml
@@ -51,6 +51,6 @@ let rec do_list f = function
let _ =
- do_list (fun n -> print_int n; print_string " ") (sieve 50000);
+ do_list (fun n -> print_string " "; print_int n) (sieve 50000);
print_newline();
exit 0
diff --git a/testsuite/tests/misc/sieve.reference b/testsuite/tests/misc/sieve.reference
index eb96be005a..24f5cc544a 100644
--- a/testsuite/tests/misc/sieve.reference
+++ b/testsuite/tests/misc/sieve.reference
@@ -1 +1 @@
-2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999 2003 2011 2017 2027 2029 2039 2053 2063 2069 2081 2083 2087 2089 2099 2111 2113 2129 2131 2137 2141 2143 2153 2161 2179 2203 2207 2213 2221 2237 2239 2243 2251 2267 2269 2273 2281 2287 2293 2297 2309 2311 2333 2339 2341 2347 2351 2357 2371 2377 2381 2383 2389 2393 2399 2411 2417 2423 2437 2441 2447 2459 2467 2473 2477 2503 2521 2531 2539 2543 2549 2551 2557 2579 2591 2593 2609 2617 2621 2633 2647 2657 2659 2663 2671 2677 2683 2687 2689 2693 2699 2707 2711 2713 2719 2729 2731 2741 2749 2753 2767 2777 2789 2791 2797 2801 2803 2819 2833 2837 2843 2851 2857 2861 2879 2887 2897 2903 2909 2917 2927 2939 2953 2957 2963 2969 2971 2999 3001 3011 3019 3023 3037 3041 3049 3061 3067 3079 3083 3089 3109 3119 3121 3137 3163 3167 3169 3181 3187 3191 3203 3209 3217 3221 3229 3251 3253 3257 3259 3271 3299 3301 3307 3313 3319 3323 3329 3331 3343 3347 3359 3361 3371 3373 3389 3391 3407 3413 3433 3449 3457 3461 3463 3467 3469 3491 3499 3511 3517 3527 3529 3533 3539 3541 3547 3557 3559 3571 3581 3583 3593 3607 3613 3617 3623 3631 3637 3643 3659 3671 3673 3677 3691 3697 3701 3709 3719 3727 3733 3739 3761 3767 3769 3779 3793 3797 3803 3821 3823 3833 3847 3851 3853 3863 3877 3881 3889 3907 3911 3917 3919 3923 3929 3931 3943 3947 3967 3989 4001 4003 4007 4013 4019 4021 4027 4049 4051 4057 4073 4079 4091 4093 4099 4111 4127 4129 4133 4139 4153 4157 4159 4177 4201 4211 4217 4219 4229 4231 4241 4243 4253 4259 4261 4271 4273 4283 4289 4297 4327 4337 4339 4349 4357 4363 4373 4391 4397 4409 4421 4423 4441 4447 4451 4457 4463 4481 4483 4493 4507 4513 4517 4519 4523 4547 4549 4561 4567 4583 4591 4597 4603 4621 4637 4639 4643 4649 4651 4657 4663 4673 4679 4691 4703 4721 4723 4729 4733 4751 4759 4783 4787 4789 4793 4799 4801 4813 4817 4831 4861 4871 4877 4889 4903 4909 4919 4931 4933 4937 4943 4951 4957 4967 4969 4973 4987 4993 4999 5003 5009 5011 5021 5023 5039 5051 5059 5077 5081 5087 5099 5101 5107 5113 5119 5147 5153 5167 5171 5179 5189 5197 5209 5227 5231 5233 5237 5261 5273 5279 5281 5297 5303 5309 5323 5333 5347 5351 5381 5387 5393 5399 5407 5413 5417 5419 5431 5437 5441 5443 5449 5471 5477 5479 5483 5501 5503 5507 5519 5521 5527 5531 5557 5563 5569 5573 5581 5591 5623 5639 5641 5647 5651 5653 5657 5659 5669 5683 5689 5693 5701 5711 5717 5737 5741 5743 5749 5779 5783 5791 5801 5807 5813 5821 5827 5839 5843 5849 5851 5857 5861 5867 5869 5879 5881 5897 5903 5923 5927 5939 5953 5981 5987 6007 6011 6029 6037 6043 6047 6053 6067 6073 6079 6089 6091 6101 6113 6121 6131 6133 6143 6151 6163 6173 6197 6199 6203 6211 6217 6221 6229 6247 6257 6263 6269 6271 6277 6287 6299 6301 6311 6317 6323 6329 6337 6343 6353 6359 6361 6367 6373 6379 6389 6397 6421 6427 6449 6451 6469 6473 6481 6491 6521 6529 6547 6551 6553 6563 6569 6571 6577 6581 6599 6607 6619 6637 6653 6659 6661 6673 6679 6689 6691 6701 6703 6709 6719 6733 6737 6761 6763 6779 6781 6791 6793 6803 6823 6827 6829 6833 6841 6857 6863 6869 6871 6883 6899 6907 6911 6917 6947 6949 6959 6961 6967 6971 6977 6983 6991 6997 7001 7013 7019 7027 7039 7043 7057 7069 7079 7103 7109 7121 7127 7129 7151 7159 7177 7187 7193 7207 7211 7213 7219 7229 7237 7243 7247 7253 7283 7297 7307 7309 7321 7331 7333 7349 7351 7369 7393 7411 7417 7433 7451 7457 7459 7477 7481 7487 7489 7499 7507 7517 7523 7529 7537 7541 7547 7549 7559 7561 7573 7577 7583 7589 7591 7603 7607 7621 7639 7643 7649 7669 7673 7681 7687 7691 7699 7703 7717 7723 7727 7741 7753 7757 7759 7789 7793 7817 7823 7829 7841 7853 7867 7873 7877 7879 7883 7901 7907 7919 7927 7933 7937 7949 7951 7963 7993 8009 8011 8017 8039 8053 8059 8069 8081 8087 8089 8093 8101 8111 8117 8123 8147 8161 8167 8171 8179 8191 8209 8219 8221 8231 8233 8237 8243 8263 8269 8273 8287 8291 8293 8297 8311 8317 8329 8353 8363 8369 8377 8387 8389 8419 8423 8429 8431 8443 8447 8461 8467 8501 8513 8521 8527 8537 8539 8543 8563 8573 8581 8597 8599 8609 8623 8627 8629 8641 8647 8663 8669 8677 8681 8689 8693 8699 8707 8713 8719 8731 8737 8741 8747 8753 8761 8779 8783 8803 8807 8819 8821 8831 8837 8839 8849 8861 8863 8867 8887 8893 8923 8929 8933 8941 8951 8963 8969 8971 8999 9001 9007 9011 9013 9029 9041 9043 9049 9059 9067 9091 9103 9109 9127 9133 9137 9151 9157 9161 9173 9181 9187 9199 9203 9209 9221 9227 9239 9241 9257 9277 9281 9283 9293 9311 9319 9323 9337 9341 9343 9349 9371 9377 9391 9397 9403 9413 9419 9421 9431 9433 9437 9439 9461 9463 9467 9473 9479 9491 9497 9511 9521 9533 9539 9547 9551 9587 9601 9613 9619 9623 9629 9631 9643 9649 9661 9677 9679 9689 9697 9719 9721 9733 9739 9743 9749 9767 9769 9781 9787 9791 9803 9811 9817 9829 9833 9839 9851 9857 9859 9871 9883 9887 9901 9907 9923 9929 9931 9941 9949 9967 9973 10007 10009 10037 10039 10061 10067 10069 10079 10091 10093 10099 10103 10111 10133 10139 10141 10151 10159 10163 10169 10177 10181 10193 10211 10223 10243 10247 10253 10259 10267 10271 10273 10289 10301 10303 10313 10321 10331 10333 10337 10343 10357 10369 10391 10399 10427 10429 10433 10453 10457 10459 10463 10477 10487 10499 10501 10513 10529 10531 10559 10567 10589 10597 10601 10607 10613 10627 10631 10639 10651 10657 10663 10667 10687 10691 10709 10711 10723 10729 10733 10739 10753 10771 10781 10789 10799 10831 10837 10847 10853 10859 10861 10867 10883 10889 10891 10903 10909 10937 10939 10949 10957 10973 10979 10987 10993 11003 11027 11047 11057 11059 11069 11071 11083 11087 11093 11113 11117 11119 11131 11149 11159 11161 11171 11173 11177 11197 11213 11239 11243 11251 11257 11261 11273 11279 11287 11299 11311 11317 11321 11329 11351 11353 11369 11383 11393 11399 11411 11423 11437 11443 11447 11467 11471 11483 11489 11491 11497 11503 11519 11527 11549 11551 11579 11587 11593 11597 11617 11621 11633 11657 11677 11681 11689 11699 11701 11717 11719 11731 11743 11777 11779 11783 11789 11801 11807 11813 11821 11827 11831 11833 11839 11863 11867 11887 11897 11903 11909 11923 11927 11933 11939 11941 11953 11959 11969 11971 11981 11987 12007 12011 12037 12041 12043 12049 12071 12073 12097 12101 12107 12109 12113 12119 12143 12149 12157 12161 12163 12197 12203 12211 12227 12239 12241 12251 12253 12263 12269 12277 12281 12289 12301 12323 12329 12343 12347 12373 12377 12379 12391 12401 12409 12413 12421 12433 12437 12451 12457 12473 12479 12487 12491 12497 12503 12511 12517 12527 12539 12541 12547 12553 12569 12577 12583 12589 12601 12611 12613 12619 12637 12641 12647 12653 12659 12671 12689 12697 12703 12713 12721 12739 12743 12757 12763 12781 12791 12799 12809 12821 12823 12829 12841 12853 12889 12893 12899 12907 12911 12917 12919 12923 12941 12953 12959 12967 12973 12979 12983 13001 13003 13007 13009 13033 13037 13043 13049 13063 13093 13099 13103 13109 13121 13127 13147 13151 13159 13163 13171 13177 13183 13187 13217 13219 13229 13241 13249 13259 13267 13291 13297 13309 13313 13327 13331 13337 13339 13367 13381 13397 13399 13411 13417 13421 13441 13451 13457 13463 13469 13477 13487 13499 13513 13523 13537 13553 13567 13577 13591 13597 13613 13619 13627 13633 13649 13669 13679 13681 13687 13691 13693 13697 13709 13711 13721 13723 13729 13751 13757 13759 13763 13781 13789 13799 13807 13829 13831 13841 13859 13873 13877 13879 13883 13901 13903 13907 13913 13921 13931 13933 13963 13967 13997 13999 14009 14011 14029 14033 14051 14057 14071 14081 14083 14087 14107 14143 14149 14153 14159 14173 14177 14197 14207 14221 14243 14249 14251 14281 14293 14303 14321 14323 14327 14341 14347 14369 14387 14389 14401 14407 14411 14419 14423 14431 14437 14447 14449 14461 14479 14489 14503 14519 14533 14537 14543 14549 14551 14557 14561 14563 14591 14593 14621 14627 14629 14633 14639 14653 14657 14669 14683 14699 14713 14717 14723 14731 14737 14741 14747 14753 14759 14767 14771 14779 14783 14797 14813 14821 14827 14831 14843 14851 14867 14869 14879 14887 14891 14897 14923 14929 14939 14947 14951 14957 14969 14983 15013 15017 15031 15053 15061 15073 15077 15083 15091 15101 15107 15121 15131 15137 15139 15149 15161 15173 15187 15193 15199 15217 15227 15233 15241 15259 15263 15269 15271 15277 15287 15289 15299 15307 15313 15319 15329 15331 15349 15359 15361 15373 15377 15383 15391 15401 15413 15427 15439 15443 15451 15461 15467 15473 15493 15497 15511 15527 15541 15551 15559 15569 15581 15583 15601 15607 15619 15629 15641 15643 15647 15649 15661 15667 15671 15679 15683 15727 15731 15733 15737 15739 15749 15761 15767 15773 15787 15791 15797 15803 15809 15817 15823 15859 15877 15881 15887 15889 15901 15907 15913 15919 15923 15937 15959 15971 15973 15991 16001 16007 16033 16057 16061 16063 16067 16069 16073 16087 16091 16097 16103 16111 16127 16139 16141 16183 16187 16189 16193 16217 16223 16229 16231 16249 16253 16267 16273 16301 16319 16333 16339 16349 16361 16363 16369 16381 16411 16417 16421 16427 16433 16447 16451 16453 16477 16481 16487 16493 16519 16529 16547 16553 16561 16567 16573 16603 16607 16619 16631 16633 16649 16651 16657 16661 16673 16691 16693 16699 16703 16729 16741 16747 16759 16763 16787 16811 16823 16829 16831 16843 16871 16879 16883 16889 16901 16903 16921 16927 16931 16937 16943 16963 16979 16981 16987 16993 17011 17021 17027 17029 17033 17041 17047 17053 17077 17093 17099 17107 17117 17123 17137 17159 17167 17183 17189 17191 17203 17207 17209 17231 17239 17257 17291 17293 17299 17317 17321 17327 17333 17341 17351 17359 17377 17383 17387 17389 17393 17401 17417 17419 17431 17443 17449 17467 17471 17477 17483 17489 17491 17497 17509 17519 17539 17551 17569 17573 17579 17581 17597 17599 17609 17623 17627 17657 17659 17669 17681 17683 17707 17713 17729 17737 17747 17749 17761 17783 17789 17791 17807 17827 17837 17839 17851 17863 17881 17891 17903 17909 17911 17921 17923 17929 17939 17957 17959 17971 17977 17981 17987 17989 18013 18041 18043 18047 18049 18059 18061 18077 18089 18097 18119 18121 18127 18131 18133 18143 18149 18169 18181 18191 18199 18211 18217 18223 18229 18233 18251 18253 18257 18269 18287 18289 18301 18307 18311 18313 18329 18341 18353 18367 18371 18379 18397 18401 18413 18427 18433 18439 18443 18451 18457 18461 18481 18493 18503 18517 18521 18523 18539 18541 18553 18583 18587 18593 18617 18637 18661 18671 18679 18691 18701 18713 18719 18731 18743 18749 18757 18773 18787 18793 18797 18803 18839 18859 18869 18899 18911 18913 18917 18919 18947 18959 18973 18979 19001 19009 19013 19031 19037 19051 19069 19073 19079 19081 19087 19121 19139 19141 19157 19163 19181 19183 19207 19211 19213 19219 19231 19237 19249 19259 19267 19273 19289 19301 19309 19319 19333 19373 19379 19381 19387 19391 19403 19417 19421 19423 19427 19429 19433 19441 19447 19457 19463 19469 19471 19477 19483 19489 19501 19507 19531 19541 19543 19553 19559 19571 19577 19583 19597 19603 19609 19661 19681 19687 19697 19699 19709 19717 19727 19739 19751 19753 19759 19763 19777 19793 19801 19813 19819 19841 19843 19853 19861 19867 19889 19891 19913 19919 19927 19937 19949 19961 19963 19973 19979 19991 19993 19997 20011 20021 20023 20029 20047 20051 20063 20071 20089 20101 20107 20113 20117 20123 20129 20143 20147 20149 20161 20173 20177 20183 20201 20219 20231 20233 20249 20261 20269 20287 20297 20323 20327 20333 20341 20347 20353 20357 20359 20369 20389 20393 20399 20407 20411 20431 20441 20443 20477 20479 20483 20507 20509 20521 20533 20543 20549 20551 20563 20593 20599 20611 20627 20639 20641 20663 20681 20693 20707 20717 20719 20731 20743 20747 20749 20753 20759 20771 20773 20789 20807 20809 20849 20857 20873 20879 20887 20897 20899 20903 20921 20929 20939 20947 20959 20963 20981 20983 21001 21011 21013 21017 21019 21023 21031 21059 21061 21067 21089 21101 21107 21121 21139 21143 21149 21157 21163 21169 21179 21187 21191 21193 21211 21221 21227 21247 21269 21277 21283 21313 21317 21319 21323 21341 21347 21377 21379 21383 21391 21397 21401 21407 21419 21433 21467 21481 21487 21491 21493 21499 21503 21517 21521 21523 21529 21557 21559 21563 21569 21577 21587 21589 21599 21601 21611 21613 21617 21647 21649 21661 21673 21683 21701 21713 21727 21737 21739 21751 21757 21767 21773 21787 21799 21803 21817 21821 21839 21841 21851 21859 21863 21871 21881 21893 21911 21929 21937 21943 21961 21977 21991 21997 22003 22013 22027 22031 22037 22039 22051 22063 22067 22073 22079 22091 22093 22109 22111 22123 22129 22133 22147 22153 22157 22159 22171 22189 22193 22229 22247 22259 22271 22273 22277 22279 22283 22291 22303 22307 22343 22349 22367 22369 22381 22391 22397 22409 22433 22441 22447 22453 22469 22481 22483 22501 22511 22531 22541 22543 22549 22567 22571 22573 22613 22619 22621 22637 22639 22643 22651 22669 22679 22691 22697 22699 22709 22717 22721 22727 22739 22741 22751 22769 22777 22783 22787 22807 22811 22817 22853 22859 22861 22871 22877 22901 22907 22921 22937 22943 22961 22963 22973 22993 23003 23011 23017 23021 23027 23029 23039 23041 23053 23057 23059 23063 23071 23081 23087 23099 23117 23131 23143 23159 23167 23173 23189 23197 23201 23203 23209 23227 23251 23269 23279 23291 23293 23297 23311 23321 23327 23333 23339 23357 23369 23371 23399 23417 23431 23447 23459 23473 23497 23509 23531 23537 23539 23549 23557 23561 23563 23567 23581 23593 23599 23603 23609 23623 23627 23629 23633 23663 23669 23671 23677 23687 23689 23719 23741 23743 23747 23753 23761 23767 23773 23789 23801 23813 23819 23827 23831 23833 23857 23869 23873 23879 23887 23893 23899 23909 23911 23917 23929 23957 23971 23977 23981 23993 24001 24007 24019 24023 24029 24043 24049 24061 24071 24077 24083 24091 24097 24103 24107 24109 24113 24121 24133 24137 24151 24169 24179 24181 24197 24203 24223 24229 24239 24247 24251 24281 24317 24329 24337 24359 24371 24373 24379 24391 24407 24413 24419 24421 24439 24443 24469 24473 24481 24499 24509 24517 24527 24533 24547 24551 24571 24593 24611 24623 24631 24659 24671 24677 24683 24691 24697 24709 24733 24749 24763 24767 24781 24793 24799 24809 24821 24841 24847 24851 24859 24877 24889 24907 24917 24919 24923 24943 24953 24967 24971 24977 24979 24989 25013 25031 25033 25037 25057 25073 25087 25097 25111 25117 25121 25127 25147 25153 25163 25169 25171 25183 25189 25219 25229 25237 25243 25247 25253 25261 25301 25303 25307 25309 25321 25339 25343 25349 25357 25367 25373 25391 25409 25411 25423 25439 25447 25453 25457 25463 25469 25471 25523 25537 25541 25561 25577 25579 25583 25589 25601 25603 25609 25621 25633 25639 25643 25657 25667 25673 25679 25693 25703 25717 25733 25741 25747 25759 25763 25771 25793 25799 25801 25819 25841 25847 25849 25867 25873 25889 25903 25913 25919 25931 25933 25939 25943 25951 25969 25981 25997 25999 26003 26017 26021 26029 26041 26053 26083 26099 26107 26111 26113 26119 26141 26153 26161 26171 26177 26183 26189 26203 26209 26227 26237 26249 26251 26261 26263 26267 26293 26297 26309 26317 26321 26339 26347 26357 26371 26387 26393 26399 26407 26417 26423 26431 26437 26449 26459 26479 26489 26497 26501 26513 26539 26557 26561 26573 26591 26597 26627 26633 26641 26647 26669 26681 26683 26687 26693 26699 26701 26711 26713 26717 26723 26729 26731 26737 26759 26777 26783 26801 26813 26821 26833 26839 26849 26861 26863 26879 26881 26891 26893 26903 26921 26927 26947 26951 26953 26959 26981 26987 26993 27011 27017 27031 27043 27059 27061 27067 27073 27077 27091 27103 27107 27109 27127 27143 27179 27191 27197 27211 27239 27241 27253 27259 27271 27277 27281 27283 27299 27329 27337 27361 27367 27397 27407 27409 27427 27431 27437 27449 27457 27479 27481 27487 27509 27527 27529 27539 27541 27551 27581 27583 27611 27617 27631 27647 27653 27673 27689 27691 27697 27701 27733 27737 27739 27743 27749 27751 27763 27767 27773 27779 27791 27793 27799 27803 27809 27817 27823 27827 27847 27851 27883 27893 27901 27917 27919 27941 27943 27947 27953 27961 27967 27983 27997 28001 28019 28027 28031 28051 28057 28069 28081 28087 28097 28099 28109 28111 28123 28151 28163 28181 28183 28201 28211 28219 28229 28277 28279 28283 28289 28297 28307 28309 28319 28349 28351 28387 28393 28403 28409 28411 28429 28433 28439 28447 28463 28477 28493 28499 28513 28517 28537 28541 28547 28549 28559 28571 28573 28579 28591 28597 28603 28607 28619 28621 28627 28631 28643 28649 28657 28661 28663 28669 28687 28697 28703 28711 28723 28729 28751 28753 28759 28771 28789 28793 28807 28813 28817 28837 28843 28859 28867 28871 28879 28901 28909 28921 28927 28933 28949 28961 28979 29009 29017 29021 29023 29027 29033 29059 29063 29077 29101 29123 29129 29131 29137 29147 29153 29167 29173 29179 29191 29201 29207 29209 29221 29231 29243 29251 29269 29287 29297 29303 29311 29327 29333 29339 29347 29363 29383 29387 29389 29399 29401 29411 29423 29429 29437 29443 29453 29473 29483 29501 29527 29531 29537 29567 29569 29573 29581 29587 29599 29611 29629 29633 29641 29663 29669 29671 29683 29717 29723 29741 29753 29759 29761 29789 29803 29819 29833 29837 29851 29863 29867 29873 29879 29881 29917 29921 29927 29947 29959 29983 29989 30011 30013 30029 30047 30059 30071 30089 30091 30097 30103 30109 30113 30119 30133 30137 30139 30161 30169 30181 30187 30197 30203 30211 30223 30241 30253 30259 30269 30271 30293 30307 30313 30319 30323 30341 30347 30367 30389 30391 30403 30427 30431 30449 30467 30469 30491 30493 30497 30509 30517 30529 30539 30553 30557 30559 30577 30593 30631 30637 30643 30649 30661 30671 30677 30689 30697 30703 30707 30713 30727 30757 30763 30773 30781 30803 30809 30817 30829 30839 30841 30851 30853 30859 30869 30871 30881 30893 30911 30931 30937 30941 30949 30971 30977 30983 31013 31019 31033 31039 31051 31063 31069 31079 31081 31091 31121 31123 31139 31147 31151 31153 31159 31177 31181 31183 31189 31193 31219 31223 31231 31237 31247 31249 31253 31259 31267 31271 31277 31307 31319 31321 31327 31333 31337 31357 31379 31387 31391 31393 31397 31469 31477 31481 31489 31511 31513 31517 31531 31541 31543 31547 31567 31573 31583 31601 31607 31627 31643 31649 31657 31663 31667 31687 31699 31721 31723 31727 31729 31741 31751 31769 31771 31793 31799 31817 31847 31849 31859 31873 31883 31891 31907 31957 31963 31973 31981 31991 32003 32009 32027 32029 32051 32057 32059 32063 32069 32077 32083 32089 32099 32117 32119 32141 32143 32159 32173 32183 32189 32191 32203 32213 32233 32237 32251 32257 32261 32297 32299 32303 32309 32321 32323 32327 32341 32353 32359 32363 32369 32371 32377 32381 32401 32411 32413 32423 32429 32441 32443 32467 32479 32491 32497 32503 32507 32531 32533 32537 32561 32563 32569 32573 32579 32587 32603 32609 32611 32621 32633 32647 32653 32687 32693 32707 32713 32717 32719 32749 32771 32779 32783 32789 32797 32801 32803 32831 32833 32839 32843 32869 32887 32909 32911 32917 32933 32939 32941 32957 32969 32971 32983 32987 32993 32999 33013 33023 33029 33037 33049 33053 33071 33073 33083 33091 33107 33113 33119 33149 33151 33161 33179 33181 33191 33199 33203 33211 33223 33247 33287 33289 33301 33311 33317 33329 33331 33343 33347 33349 33353 33359 33377 33391 33403 33409 33413 33427 33457 33461 33469 33479 33487 33493 33503 33521 33529 33533 33547 33563 33569 33577 33581 33587 33589 33599 33601 33613 33617 33619 33623 33629 33637 33641 33647 33679 33703 33713 33721 33739 33749 33751 33757 33767 33769 33773 33791 33797 33809 33811 33827 33829 33851 33857 33863 33871 33889 33893 33911 33923 33931 33937 33941 33961 33967 33997 34019 34031 34033 34039 34057 34061 34123 34127 34129 34141 34147 34157 34159 34171 34183 34211 34213 34217 34231 34253 34259 34261 34267 34273 34283 34297 34301 34303 34313 34319 34327 34337 34351 34361 34367 34369 34381 34403 34421 34429 34439 34457 34469 34471 34483 34487 34499 34501 34511 34513 34519 34537 34543 34549 34583 34589 34591 34603 34607 34613 34631 34649 34651 34667 34673 34679 34687 34693 34703 34721 34729 34739 34747 34757 34759 34763 34781 34807 34819 34841 34843 34847 34849 34871 34877 34883 34897 34913 34919 34939 34949 34961 34963 34981 35023 35027 35051 35053 35059 35069 35081 35083 35089 35099 35107 35111 35117 35129 35141 35149 35153 35159 35171 35201 35221 35227 35251 35257 35267 35279 35281 35291 35311 35317 35323 35327 35339 35353 35363 35381 35393 35401 35407 35419 35423 35437 35447 35449 35461 35491 35507 35509 35521 35527 35531 35533 35537 35543 35569 35573 35591 35593 35597 35603 35617 35671 35677 35729 35731 35747 35753 35759 35771 35797 35801 35803 35809 35831 35837 35839 35851 35863 35869 35879 35897 35899 35911 35923 35933 35951 35963 35969 35977 35983 35993 35999 36007 36011 36013 36017 36037 36061 36067 36073 36083 36097 36107 36109 36131 36137 36151 36161 36187 36191 36209 36217 36229 36241 36251 36263 36269 36277 36293 36299 36307 36313 36319 36341 36343 36353 36373 36383 36389 36433 36451 36457 36467 36469 36473 36479 36493 36497 36523 36527 36529 36541 36551 36559 36563 36571 36583 36587 36599 36607 36629 36637 36643 36653 36671 36677 36683 36691 36697 36709 36713 36721 36739 36749 36761 36767 36779 36781 36787 36791 36793 36809 36821 36833 36847 36857 36871 36877 36887 36899 36901 36913 36919 36923 36929 36931 36943 36947 36973 36979 36997 37003 37013 37019 37021 37039 37049 37057 37061 37087 37097 37117 37123 37139 37159 37171 37181 37189 37199 37201 37217 37223 37243 37253 37273 37277 37307 37309 37313 37321 37337 37339 37357 37361 37363 37369 37379 37397 37409 37423 37441 37447 37463 37483 37489 37493 37501 37507 37511 37517 37529 37537 37547 37549 37561 37567 37571 37573 37579 37589 37591 37607 37619 37633 37643 37649 37657 37663 37691 37693 37699 37717 37747 37781 37783 37799 37811 37813 37831 37847 37853 37861 37871 37879 37889 37897 37907 37951 37957 37963 37967 37987 37991 37993 37997 38011 38039 38047 38053 38069 38083 38113 38119 38149 38153 38167 38177 38183 38189 38197 38201 38219 38231 38237 38239 38261 38273 38281 38287 38299 38303 38317 38321 38327 38329 38333 38351 38371 38377 38393 38431 38447 38449 38453 38459 38461 38501 38543 38557 38561 38567 38569 38593 38603 38609 38611 38629 38639 38651 38653 38669 38671 38677 38693 38699 38707 38711 38713 38723 38729 38737 38747 38749 38767 38783 38791 38803 38821 38833 38839 38851 38861 38867 38873 38891 38903 38917 38921 38923 38933 38953 38959 38971 38977 38993 39019 39023 39041 39043 39047 39079 39089 39097 39103 39107 39113 39119 39133 39139 39157 39161 39163 39181 39191 39199 39209 39217 39227 39229 39233 39239 39241 39251 39293 39301 39313 39317 39323 39341 39343 39359 39367 39371 39373 39383 39397 39409 39419 39439 39443 39451 39461 39499 39503 39509 39511 39521 39541 39551 39563 39569 39581 39607 39619 39623 39631 39659 39667 39671 39679 39703 39709 39719 39727 39733 39749 39761 39769 39779 39791 39799 39821 39827 39829 39839 39841 39847 39857 39863 39869 39877 39883 39887 39901 39929 39937 39953 39971 39979 39983 39989 40009 40013 40031 40037 40039 40063 40087 40093 40099 40111 40123 40127 40129 40151 40153 40163 40169 40177 40189 40193 40213 40231 40237 40241 40253 40277 40283 40289 40343 40351 40357 40361 40387 40423 40427 40429 40433 40459 40471 40483 40487 40493 40499 40507 40519 40529 40531 40543 40559 40577 40583 40591 40597 40609 40627 40637 40639 40693 40697 40699 40709 40739 40751 40759 40763 40771 40787 40801 40813 40819 40823 40829 40841 40847 40849 40853 40867 40879 40883 40897 40903 40927 40933 40939 40949 40961 40973 40993 41011 41017 41023 41039 41047 41051 41057 41077 41081 41113 41117 41131 41141 41143 41149 41161 41177 41179 41183 41189 41201 41203 41213 41221 41227 41231 41233 41243 41257 41263 41269 41281 41299 41333 41341 41351 41357 41381 41387 41389 41399 41411 41413 41443 41453 41467 41479 41491 41507 41513 41519 41521 41539 41543 41549 41579 41593 41597 41603 41609 41611 41617 41621 41627 41641 41647 41651 41659 41669 41681 41687 41719 41729 41737 41759 41761 41771 41777 41801 41809 41813 41843 41849 41851 41863 41879 41887 41893 41897 41903 41911 41927 41941 41947 41953 41957 41959 41969 41981 41983 41999 42013 42017 42019 42023 42043 42061 42071 42073 42083 42089 42101 42131 42139 42157 42169 42179 42181 42187 42193 42197 42209 42221 42223 42227 42239 42257 42281 42283 42293 42299 42307 42323 42331 42337 42349 42359 42373 42379 42391 42397 42403 42407 42409 42433 42437 42443 42451 42457 42461 42463 42467 42473 42487 42491 42499 42509 42533 42557 42569 42571 42577 42589 42611 42641 42643 42649 42667 42677 42683 42689 42697 42701 42703 42709 42719 42727 42737 42743 42751 42767 42773 42787 42793 42797 42821 42829 42839 42841 42853 42859 42863 42899 42901 42923 42929 42937 42943 42953 42961 42967 42979 42989 43003 43013 43019 43037 43049 43051 43063 43067 43093 43103 43117 43133 43151 43159 43177 43189 43201 43207 43223 43237 43261 43271 43283 43291 43313 43319 43321 43331 43391 43397 43399 43403 43411 43427 43441 43451 43457 43481 43487 43499 43517 43541 43543 43573 43577 43579 43591 43597 43607 43609 43613 43627 43633 43649 43651 43661 43669 43691 43711 43717 43721 43753 43759 43777 43781 43783 43787 43789 43793 43801 43853 43867 43889 43891 43913 43933 43943 43951 43961 43963 43969 43973 43987 43991 43997 44017 44021 44027 44029 44041 44053 44059 44071 44087 44089 44101 44111 44119 44123 44129 44131 44159 44171 44179 44189 44201 44203 44207 44221 44249 44257 44263 44267 44269 44273 44279 44281 44293 44351 44357 44371 44381 44383 44389 44417 44449 44453 44483 44491 44497 44501 44507 44519 44531 44533 44537 44543 44549 44563 44579 44587 44617 44621 44623 44633 44641 44647 44651 44657 44683 44687 44699 44701 44711 44729 44741 44753 44771 44773 44777 44789 44797 44809 44819 44839 44843 44851 44867 44879 44887 44893 44909 44917 44927 44939 44953 44959 44963 44971 44983 44987 45007 45013 45053 45061 45077 45083 45119 45121 45127 45131 45137 45139 45161 45179 45181 45191 45197 45233 45247 45259 45263 45281 45289 45293 45307 45317 45319 45329 45337 45341 45343 45361 45377 45389 45403 45413 45427 45433 45439 45481 45491 45497 45503 45523 45533 45541 45553 45557 45569 45587 45589 45599 45613 45631 45641 45659 45667 45673 45677 45691 45697 45707 45737 45751 45757 45763 45767 45779 45817 45821 45823 45827 45833 45841 45853 45863 45869 45887 45893 45943 45949 45953 45959 45971 45979 45989 46021 46027 46049 46051 46061 46073 46091 46093 46099 46103 46133 46141 46147 46153 46171 46181 46183 46187 46199 46219 46229 46237 46261 46271 46273 46279 46301 46307 46309 46327 46337 46349 46351 46381 46399 46411 46439 46441 46447 46451 46457 46471 46477 46489 46499 46507 46511 46523 46549 46559 46567 46573 46589 46591 46601 46619 46633 46639 46643 46649 46663 46679 46681 46687 46691 46703 46723 46727 46747 46751 46757 46769 46771 46807 46811 46817 46819 46829 46831 46853 46861 46867 46877 46889 46901 46919 46933 46957 46993 46997 47017 47041 47051 47057 47059 47087 47093 47111 47119 47123 47129 47137 47143 47147 47149 47161 47189 47207 47221 47237 47251 47269 47279 47287 47293 47297 47303 47309 47317 47339 47351 47353 47363 47381 47387 47389 47407 47417 47419 47431 47441 47459 47491 47497 47501 47507 47513 47521 47527 47533 47543 47563 47569 47581 47591 47599 47609 47623 47629 47639 47653 47657 47659 47681 47699 47701 47711 47713 47717 47737 47741 47743 47777 47779 47791 47797 47807 47809 47819 47837 47843 47857 47869 47881 47903 47911 47917 47933 47939 47947 47951 47963 47969 47977 47981 48017 48023 48029 48049 48073 48079 48091 48109 48119 48121 48131 48157 48163 48179 48187 48193 48197 48221 48239 48247 48259 48271 48281 48299 48311 48313 48337 48341 48353 48371 48383 48397 48407 48409 48413 48437 48449 48463 48473 48479 48481 48487 48491 48497 48523 48527 48533 48539 48541 48563 48571 48589 48593 48611 48619 48623 48647 48649 48661 48673 48677 48679 48731 48733 48751 48757 48761 48767 48779 48781 48787 48799 48809 48817 48821 48823 48847 48857 48859 48869 48871 48883 48889 48907 48947 48953 48973 48989 48991 49003 49009 49019 49031 49033 49037 49043 49057 49069 49081 49103 49109 49117 49121 49123 49139 49157 49169 49171 49177 49193 49199 49201 49207 49211 49223 49253 49261 49277 49279 49297 49307 49331 49333 49339 49363 49367 49369 49391 49393 49409 49411 49417 49429 49433 49451 49459 49463 49477 49481 49499 49523 49529 49531 49537 49547 49549 49559 49597 49603 49613 49627 49633 49639 49663 49667 49669 49681 49697 49711 49727 49739 49741 49747 49757 49783 49787 49789 49801 49807 49811 49823 49831 49843 49853 49871 49877 49891 49919 49921 49927 49937 49939 49943 49957 49991 49993 49999
+ 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999 2003 2011 2017 2027 2029 2039 2053 2063 2069 2081 2083 2087 2089 2099 2111 2113 2129 2131 2137 2141 2143 2153 2161 2179 2203 2207 2213 2221 2237 2239 2243 2251 2267 2269 2273 2281 2287 2293 2297 2309 2311 2333 2339 2341 2347 2351 2357 2371 2377 2381 2383 2389 2393 2399 2411 2417 2423 2437 2441 2447 2459 2467 2473 2477 2503 2521 2531 2539 2543 2549 2551 2557 2579 2591 2593 2609 2617 2621 2633 2647 2657 2659 2663 2671 2677 2683 2687 2689 2693 2699 2707 2711 2713 2719 2729 2731 2741 2749 2753 2767 2777 2789 2791 2797 2801 2803 2819 2833 2837 2843 2851 2857 2861 2879 2887 2897 2903 2909 2917 2927 2939 2953 2957 2963 2969 2971 2999 3001 3011 3019 3023 3037 3041 3049 3061 3067 3079 3083 3089 3109 3119 3121 3137 3163 3167 3169 3181 3187 3191 3203 3209 3217 3221 3229 3251 3253 3257 3259 3271 3299 3301 3307 3313 3319 3323 3329 3331 3343 3347 3359 3361 3371 3373 3389 3391 3407 3413 3433 3449 3457 3461 3463 3467 3469 3491 3499 3511 3517 3527 3529 3533 3539 3541 3547 3557 3559 3571 3581 3583 3593 3607 3613 3617 3623 3631 3637 3643 3659 3671 3673 3677 3691 3697 3701 3709 3719 3727 3733 3739 3761 3767 3769 3779 3793 3797 3803 3821 3823 3833 3847 3851 3853 3863 3877 3881 3889 3907 3911 3917 3919 3923 3929 3931 3943 3947 3967 3989 4001 4003 4007 4013 4019 4021 4027 4049 4051 4057 4073 4079 4091 4093 4099 4111 4127 4129 4133 4139 4153 4157 4159 4177 4201 4211 4217 4219 4229 4231 4241 4243 4253 4259 4261 4271 4273 4283 4289 4297 4327 4337 4339 4349 4357 4363 4373 4391 4397 4409 4421 4423 4441 4447 4451 4457 4463 4481 4483 4493 4507 4513 4517 4519 4523 4547 4549 4561 4567 4583 4591 4597 4603 4621 4637 4639 4643 4649 4651 4657 4663 4673 4679 4691 4703 4721 4723 4729 4733 4751 4759 4783 4787 4789 4793 4799 4801 4813 4817 4831 4861 4871 4877 4889 4903 4909 4919 4931 4933 4937 4943 4951 4957 4967 4969 4973 4987 4993 4999 5003 5009 5011 5021 5023 5039 5051 5059 5077 5081 5087 5099 5101 5107 5113 5119 5147 5153 5167 5171 5179 5189 5197 5209 5227 5231 5233 5237 5261 5273 5279 5281 5297 5303 5309 5323 5333 5347 5351 5381 5387 5393 5399 5407 5413 5417 5419 5431 5437 5441 5443 5449 5471 5477 5479 5483 5501 5503 5507 5519 5521 5527 5531 5557 5563 5569 5573 5581 5591 5623 5639 5641 5647 5651 5653 5657 5659 5669 5683 5689 5693 5701 5711 5717 5737 5741 5743 5749 5779 5783 5791 5801 5807 5813 5821 5827 5839 5843 5849 5851 5857 5861 5867 5869 5879 5881 5897 5903 5923 5927 5939 5953 5981 5987 6007 6011 6029 6037 6043 6047 6053 6067 6073 6079 6089 6091 6101 6113 6121 6131 6133 6143 6151 6163 6173 6197 6199 6203 6211 6217 6221 6229 6247 6257 6263 6269 6271 6277 6287 6299 6301 6311 6317 6323 6329 6337 6343 6353 6359 6361 6367 6373 6379 6389 6397 6421 6427 6449 6451 6469 6473 6481 6491 6521 6529 6547 6551 6553 6563 6569 6571 6577 6581 6599 6607 6619 6637 6653 6659 6661 6673 6679 6689 6691 6701 6703 6709 6719 6733 6737 6761 6763 6779 6781 6791 6793 6803 6823 6827 6829 6833 6841 6857 6863 6869 6871 6883 6899 6907 6911 6917 6947 6949 6959 6961 6967 6971 6977 6983 6991 6997 7001 7013 7019 7027 7039 7043 7057 7069 7079 7103 7109 7121 7127 7129 7151 7159 7177 7187 7193 7207 7211 7213 7219 7229 7237 7243 7247 7253 7283 7297 7307 7309 7321 7331 7333 7349 7351 7369 7393 7411 7417 7433 7451 7457 7459 7477 7481 7487 7489 7499 7507 7517 7523 7529 7537 7541 7547 7549 7559 7561 7573 7577 7583 7589 7591 7603 7607 7621 7639 7643 7649 7669 7673 7681 7687 7691 7699 7703 7717 7723 7727 7741 7753 7757 7759 7789 7793 7817 7823 7829 7841 7853 7867 7873 7877 7879 7883 7901 7907 7919 7927 7933 7937 7949 7951 7963 7993 8009 8011 8017 8039 8053 8059 8069 8081 8087 8089 8093 8101 8111 8117 8123 8147 8161 8167 8171 8179 8191 8209 8219 8221 8231 8233 8237 8243 8263 8269 8273 8287 8291 8293 8297 8311 8317 8329 8353 8363 8369 8377 8387 8389 8419 8423 8429 8431 8443 8447 8461 8467 8501 8513 8521 8527 8537 8539 8543 8563 8573 8581 8597 8599 8609 8623 8627 8629 8641 8647 8663 8669 8677 8681 8689 8693 8699 8707 8713 8719 8731 8737 8741 8747 8753 8761 8779 8783 8803 8807 8819 8821 8831 8837 8839 8849 8861 8863 8867 8887 8893 8923 8929 8933 8941 8951 8963 8969 8971 8999 9001 9007 9011 9013 9029 9041 9043 9049 9059 9067 9091 9103 9109 9127 9133 9137 9151 9157 9161 9173 9181 9187 9199 9203 9209 9221 9227 9239 9241 9257 9277 9281 9283 9293 9311 9319 9323 9337 9341 9343 9349 9371 9377 9391 9397 9403 9413 9419 9421 9431 9433 9437 9439 9461 9463 9467 9473 9479 9491 9497 9511 9521 9533 9539 9547 9551 9587 9601 9613 9619 9623 9629 9631 9643 9649 9661 9677 9679 9689 9697 9719 9721 9733 9739 9743 9749 9767 9769 9781 9787 9791 9803 9811 9817 9829 9833 9839 9851 9857 9859 9871 9883 9887 9901 9907 9923 9929 9931 9941 9949 9967 9973 10007 10009 10037 10039 10061 10067 10069 10079 10091 10093 10099 10103 10111 10133 10139 10141 10151 10159 10163 10169 10177 10181 10193 10211 10223 10243 10247 10253 10259 10267 10271 10273 10289 10301 10303 10313 10321 10331 10333 10337 10343 10357 10369 10391 10399 10427 10429 10433 10453 10457 10459 10463 10477 10487 10499 10501 10513 10529 10531 10559 10567 10589 10597 10601 10607 10613 10627 10631 10639 10651 10657 10663 10667 10687 10691 10709 10711 10723 10729 10733 10739 10753 10771 10781 10789 10799 10831 10837 10847 10853 10859 10861 10867 10883 10889 10891 10903 10909 10937 10939 10949 10957 10973 10979 10987 10993 11003 11027 11047 11057 11059 11069 11071 11083 11087 11093 11113 11117 11119 11131 11149 11159 11161 11171 11173 11177 11197 11213 11239 11243 11251 11257 11261 11273 11279 11287 11299 11311 11317 11321 11329 11351 11353 11369 11383 11393 11399 11411 11423 11437 11443 11447 11467 11471 11483 11489 11491 11497 11503 11519 11527 11549 11551 11579 11587 11593 11597 11617 11621 11633 11657 11677 11681 11689 11699 11701 11717 11719 11731 11743 11777 11779 11783 11789 11801 11807 11813 11821 11827 11831 11833 11839 11863 11867 11887 11897 11903 11909 11923 11927 11933 11939 11941 11953 11959 11969 11971 11981 11987 12007 12011 12037 12041 12043 12049 12071 12073 12097 12101 12107 12109 12113 12119 12143 12149 12157 12161 12163 12197 12203 12211 12227 12239 12241 12251 12253 12263 12269 12277 12281 12289 12301 12323 12329 12343 12347 12373 12377 12379 12391 12401 12409 12413 12421 12433 12437 12451 12457 12473 12479 12487 12491 12497 12503 12511 12517 12527 12539 12541 12547 12553 12569 12577 12583 12589 12601 12611 12613 12619 12637 12641 12647 12653 12659 12671 12689 12697 12703 12713 12721 12739 12743 12757 12763 12781 12791 12799 12809 12821 12823 12829 12841 12853 12889 12893 12899 12907 12911 12917 12919 12923 12941 12953 12959 12967 12973 12979 12983 13001 13003 13007 13009 13033 13037 13043 13049 13063 13093 13099 13103 13109 13121 13127 13147 13151 13159 13163 13171 13177 13183 13187 13217 13219 13229 13241 13249 13259 13267 13291 13297 13309 13313 13327 13331 13337 13339 13367 13381 13397 13399 13411 13417 13421 13441 13451 13457 13463 13469 13477 13487 13499 13513 13523 13537 13553 13567 13577 13591 13597 13613 13619 13627 13633 13649 13669 13679 13681 13687 13691 13693 13697 13709 13711 13721 13723 13729 13751 13757 13759 13763 13781 13789 13799 13807 13829 13831 13841 13859 13873 13877 13879 13883 13901 13903 13907 13913 13921 13931 13933 13963 13967 13997 13999 14009 14011 14029 14033 14051 14057 14071 14081 14083 14087 14107 14143 14149 14153 14159 14173 14177 14197 14207 14221 14243 14249 14251 14281 14293 14303 14321 14323 14327 14341 14347 14369 14387 14389 14401 14407 14411 14419 14423 14431 14437 14447 14449 14461 14479 14489 14503 14519 14533 14537 14543 14549 14551 14557 14561 14563 14591 14593 14621 14627 14629 14633 14639 14653 14657 14669 14683 14699 14713 14717 14723 14731 14737 14741 14747 14753 14759 14767 14771 14779 14783 14797 14813 14821 14827 14831 14843 14851 14867 14869 14879 14887 14891 14897 14923 14929 14939 14947 14951 14957 14969 14983 15013 15017 15031 15053 15061 15073 15077 15083 15091 15101 15107 15121 15131 15137 15139 15149 15161 15173 15187 15193 15199 15217 15227 15233 15241 15259 15263 15269 15271 15277 15287 15289 15299 15307 15313 15319 15329 15331 15349 15359 15361 15373 15377 15383 15391 15401 15413 15427 15439 15443 15451 15461 15467 15473 15493 15497 15511 15527 15541 15551 15559 15569 15581 15583 15601 15607 15619 15629 15641 15643 15647 15649 15661 15667 15671 15679 15683 15727 15731 15733 15737 15739 15749 15761 15767 15773 15787 15791 15797 15803 15809 15817 15823 15859 15877 15881 15887 15889 15901 15907 15913 15919 15923 15937 15959 15971 15973 15991 16001 16007 16033 16057 16061 16063 16067 16069 16073 16087 16091 16097 16103 16111 16127 16139 16141 16183 16187 16189 16193 16217 16223 16229 16231 16249 16253 16267 16273 16301 16319 16333 16339 16349 16361 16363 16369 16381 16411 16417 16421 16427 16433 16447 16451 16453 16477 16481 16487 16493 16519 16529 16547 16553 16561 16567 16573 16603 16607 16619 16631 16633 16649 16651 16657 16661 16673 16691 16693 16699 16703 16729 16741 16747 16759 16763 16787 16811 16823 16829 16831 16843 16871 16879 16883 16889 16901 16903 16921 16927 16931 16937 16943 16963 16979 16981 16987 16993 17011 17021 17027 17029 17033 17041 17047 17053 17077 17093 17099 17107 17117 17123 17137 17159 17167 17183 17189 17191 17203 17207 17209 17231 17239 17257 17291 17293 17299 17317 17321 17327 17333 17341 17351 17359 17377 17383 17387 17389 17393 17401 17417 17419 17431 17443 17449 17467 17471 17477 17483 17489 17491 17497 17509 17519 17539 17551 17569 17573 17579 17581 17597 17599 17609 17623 17627 17657 17659 17669 17681 17683 17707 17713 17729 17737 17747 17749 17761 17783 17789 17791 17807 17827 17837 17839 17851 17863 17881 17891 17903 17909 17911 17921 17923 17929 17939 17957 17959 17971 17977 17981 17987 17989 18013 18041 18043 18047 18049 18059 18061 18077 18089 18097 18119 18121 18127 18131 18133 18143 18149 18169 18181 18191 18199 18211 18217 18223 18229 18233 18251 18253 18257 18269 18287 18289 18301 18307 18311 18313 18329 18341 18353 18367 18371 18379 18397 18401 18413 18427 18433 18439 18443 18451 18457 18461 18481 18493 18503 18517 18521 18523 18539 18541 18553 18583 18587 18593 18617 18637 18661 18671 18679 18691 18701 18713 18719 18731 18743 18749 18757 18773 18787 18793 18797 18803 18839 18859 18869 18899 18911 18913 18917 18919 18947 18959 18973 18979 19001 19009 19013 19031 19037 19051 19069 19073 19079 19081 19087 19121 19139 19141 19157 19163 19181 19183 19207 19211 19213 19219 19231 19237 19249 19259 19267 19273 19289 19301 19309 19319 19333 19373 19379 19381 19387 19391 19403 19417 19421 19423 19427 19429 19433 19441 19447 19457 19463 19469 19471 19477 19483 19489 19501 19507 19531 19541 19543 19553 19559 19571 19577 19583 19597 19603 19609 19661 19681 19687 19697 19699 19709 19717 19727 19739 19751 19753 19759 19763 19777 19793 19801 19813 19819 19841 19843 19853 19861 19867 19889 19891 19913 19919 19927 19937 19949 19961 19963 19973 19979 19991 19993 19997 20011 20021 20023 20029 20047 20051 20063 20071 20089 20101 20107 20113 20117 20123 20129 20143 20147 20149 20161 20173 20177 20183 20201 20219 20231 20233 20249 20261 20269 20287 20297 20323 20327 20333 20341 20347 20353 20357 20359 20369 20389 20393 20399 20407 20411 20431 20441 20443 20477 20479 20483 20507 20509 20521 20533 20543 20549 20551 20563 20593 20599 20611 20627 20639 20641 20663 20681 20693 20707 20717 20719 20731 20743 20747 20749 20753 20759 20771 20773 20789 20807 20809 20849 20857 20873 20879 20887 20897 20899 20903 20921 20929 20939 20947 20959 20963 20981 20983 21001 21011 21013 21017 21019 21023 21031 21059 21061 21067 21089 21101 21107 21121 21139 21143 21149 21157 21163 21169 21179 21187 21191 21193 21211 21221 21227 21247 21269 21277 21283 21313 21317 21319 21323 21341 21347 21377 21379 21383 21391 21397 21401 21407 21419 21433 21467 21481 21487 21491 21493 21499 21503 21517 21521 21523 21529 21557 21559 21563 21569 21577 21587 21589 21599 21601 21611 21613 21617 21647 21649 21661 21673 21683 21701 21713 21727 21737 21739 21751 21757 21767 21773 21787 21799 21803 21817 21821 21839 21841 21851 21859 21863 21871 21881 21893 21911 21929 21937 21943 21961 21977 21991 21997 22003 22013 22027 22031 22037 22039 22051 22063 22067 22073 22079 22091 22093 22109 22111 22123 22129 22133 22147 22153 22157 22159 22171 22189 22193 22229 22247 22259 22271 22273 22277 22279 22283 22291 22303 22307 22343 22349 22367 22369 22381 22391 22397 22409 22433 22441 22447 22453 22469 22481 22483 22501 22511 22531 22541 22543 22549 22567 22571 22573 22613 22619 22621 22637 22639 22643 22651 22669 22679 22691 22697 22699 22709 22717 22721 22727 22739 22741 22751 22769 22777 22783 22787 22807 22811 22817 22853 22859 22861 22871 22877 22901 22907 22921 22937 22943 22961 22963 22973 22993 23003 23011 23017 23021 23027 23029 23039 23041 23053 23057 23059 23063 23071 23081 23087 23099 23117 23131 23143 23159 23167 23173 23189 23197 23201 23203 23209 23227 23251 23269 23279 23291 23293 23297 23311 23321 23327 23333 23339 23357 23369 23371 23399 23417 23431 23447 23459 23473 23497 23509 23531 23537 23539 23549 23557 23561 23563 23567 23581 23593 23599 23603 23609 23623 23627 23629 23633 23663 23669 23671 23677 23687 23689 23719 23741 23743 23747 23753 23761 23767 23773 23789 23801 23813 23819 23827 23831 23833 23857 23869 23873 23879 23887 23893 23899 23909 23911 23917 23929 23957 23971 23977 23981 23993 24001 24007 24019 24023 24029 24043 24049 24061 24071 24077 24083 24091 24097 24103 24107 24109 24113 24121 24133 24137 24151 24169 24179 24181 24197 24203 24223 24229 24239 24247 24251 24281 24317 24329 24337 24359 24371 24373 24379 24391 24407 24413 24419 24421 24439 24443 24469 24473 24481 24499 24509 24517 24527 24533 24547 24551 24571 24593 24611 24623 24631 24659 24671 24677 24683 24691 24697 24709 24733 24749 24763 24767 24781 24793 24799 24809 24821 24841 24847 24851 24859 24877 24889 24907 24917 24919 24923 24943 24953 24967 24971 24977 24979 24989 25013 25031 25033 25037 25057 25073 25087 25097 25111 25117 25121 25127 25147 25153 25163 25169 25171 25183 25189 25219 25229 25237 25243 25247 25253 25261 25301 25303 25307 25309 25321 25339 25343 25349 25357 25367 25373 25391 25409 25411 25423 25439 25447 25453 25457 25463 25469 25471 25523 25537 25541 25561 25577 25579 25583 25589 25601 25603 25609 25621 25633 25639 25643 25657 25667 25673 25679 25693 25703 25717 25733 25741 25747 25759 25763 25771 25793 25799 25801 25819 25841 25847 25849 25867 25873 25889 25903 25913 25919 25931 25933 25939 25943 25951 25969 25981 25997 25999 26003 26017 26021 26029 26041 26053 26083 26099 26107 26111 26113 26119 26141 26153 26161 26171 26177 26183 26189 26203 26209 26227 26237 26249 26251 26261 26263 26267 26293 26297 26309 26317 26321 26339 26347 26357 26371 26387 26393 26399 26407 26417 26423 26431 26437 26449 26459 26479 26489 26497 26501 26513 26539 26557 26561 26573 26591 26597 26627 26633 26641 26647 26669 26681 26683 26687 26693 26699 26701 26711 26713 26717 26723 26729 26731 26737 26759 26777 26783 26801 26813 26821 26833 26839 26849 26861 26863 26879 26881 26891 26893 26903 26921 26927 26947 26951 26953 26959 26981 26987 26993 27011 27017 27031 27043 27059 27061 27067 27073 27077 27091 27103 27107 27109 27127 27143 27179 27191 27197 27211 27239 27241 27253 27259 27271 27277 27281 27283 27299 27329 27337 27361 27367 27397 27407 27409 27427 27431 27437 27449 27457 27479 27481 27487 27509 27527 27529 27539 27541 27551 27581 27583 27611 27617 27631 27647 27653 27673 27689 27691 27697 27701 27733 27737 27739 27743 27749 27751 27763 27767 27773 27779 27791 27793 27799 27803 27809 27817 27823 27827 27847 27851 27883 27893 27901 27917 27919 27941 27943 27947 27953 27961 27967 27983 27997 28001 28019 28027 28031 28051 28057 28069 28081 28087 28097 28099 28109 28111 28123 28151 28163 28181 28183 28201 28211 28219 28229 28277 28279 28283 28289 28297 28307 28309 28319 28349 28351 28387 28393 28403 28409 28411 28429 28433 28439 28447 28463 28477 28493 28499 28513 28517 28537 28541 28547 28549 28559 28571 28573 28579 28591 28597 28603 28607 28619 28621 28627 28631 28643 28649 28657 28661 28663 28669 28687 28697 28703 28711 28723 28729 28751 28753 28759 28771 28789 28793 28807 28813 28817 28837 28843 28859 28867 28871 28879 28901 28909 28921 28927 28933 28949 28961 28979 29009 29017 29021 29023 29027 29033 29059 29063 29077 29101 29123 29129 29131 29137 29147 29153 29167 29173 29179 29191 29201 29207 29209 29221 29231 29243 29251 29269 29287 29297 29303 29311 29327 29333 29339 29347 29363 29383 29387 29389 29399 29401 29411 29423 29429 29437 29443 29453 29473 29483 29501 29527 29531 29537 29567 29569 29573 29581 29587 29599 29611 29629 29633 29641 29663 29669 29671 29683 29717 29723 29741 29753 29759 29761 29789 29803 29819 29833 29837 29851 29863 29867 29873 29879 29881 29917 29921 29927 29947 29959 29983 29989 30011 30013 30029 30047 30059 30071 30089 30091 30097 30103 30109 30113 30119 30133 30137 30139 30161 30169 30181 30187 30197 30203 30211 30223 30241 30253 30259 30269 30271 30293 30307 30313 30319 30323 30341 30347 30367 30389 30391 30403 30427 30431 30449 30467 30469 30491 30493 30497 30509 30517 30529 30539 30553 30557 30559 30577 30593 30631 30637 30643 30649 30661 30671 30677 30689 30697 30703 30707 30713 30727 30757 30763 30773 30781 30803 30809 30817 30829 30839 30841 30851 30853 30859 30869 30871 30881 30893 30911 30931 30937 30941 30949 30971 30977 30983 31013 31019 31033 31039 31051 31063 31069 31079 31081 31091 31121 31123 31139 31147 31151 31153 31159 31177 31181 31183 31189 31193 31219 31223 31231 31237 31247 31249 31253 31259 31267 31271 31277 31307 31319 31321 31327 31333 31337 31357 31379 31387 31391 31393 31397 31469 31477 31481 31489 31511 31513 31517 31531 31541 31543 31547 31567 31573 31583 31601 31607 31627 31643 31649 31657 31663 31667 31687 31699 31721 31723 31727 31729 31741 31751 31769 31771 31793 31799 31817 31847 31849 31859 31873 31883 31891 31907 31957 31963 31973 31981 31991 32003 32009 32027 32029 32051 32057 32059 32063 32069 32077 32083 32089 32099 32117 32119 32141 32143 32159 32173 32183 32189 32191 32203 32213 32233 32237 32251 32257 32261 32297 32299 32303 32309 32321 32323 32327 32341 32353 32359 32363 32369 32371 32377 32381 32401 32411 32413 32423 32429 32441 32443 32467 32479 32491 32497 32503 32507 32531 32533 32537 32561 32563 32569 32573 32579 32587 32603 32609 32611 32621 32633 32647 32653 32687 32693 32707 32713 32717 32719 32749 32771 32779 32783 32789 32797 32801 32803 32831 32833 32839 32843 32869 32887 32909 32911 32917 32933 32939 32941 32957 32969 32971 32983 32987 32993 32999 33013 33023 33029 33037 33049 33053 33071 33073 33083 33091 33107 33113 33119 33149 33151 33161 33179 33181 33191 33199 33203 33211 33223 33247 33287 33289 33301 33311 33317 33329 33331 33343 33347 33349 33353 33359 33377 33391 33403 33409 33413 33427 33457 33461 33469 33479 33487 33493 33503 33521 33529 33533 33547 33563 33569 33577 33581 33587 33589 33599 33601 33613 33617 33619 33623 33629 33637 33641 33647 33679 33703 33713 33721 33739 33749 33751 33757 33767 33769 33773 33791 33797 33809 33811 33827 33829 33851 33857 33863 33871 33889 33893 33911 33923 33931 33937 33941 33961 33967 33997 34019 34031 34033 34039 34057 34061 34123 34127 34129 34141 34147 34157 34159 34171 34183 34211 34213 34217 34231 34253 34259 34261 34267 34273 34283 34297 34301 34303 34313 34319 34327 34337 34351 34361 34367 34369 34381 34403 34421 34429 34439 34457 34469 34471 34483 34487 34499 34501 34511 34513 34519 34537 34543 34549 34583 34589 34591 34603 34607 34613 34631 34649 34651 34667 34673 34679 34687 34693 34703 34721 34729 34739 34747 34757 34759 34763 34781 34807 34819 34841 34843 34847 34849 34871 34877 34883 34897 34913 34919 34939 34949 34961 34963 34981 35023 35027 35051 35053 35059 35069 35081 35083 35089 35099 35107 35111 35117 35129 35141 35149 35153 35159 35171 35201 35221 35227 35251 35257 35267 35279 35281 35291 35311 35317 35323 35327 35339 35353 35363 35381 35393 35401 35407 35419 35423 35437 35447 35449 35461 35491 35507 35509 35521 35527 35531 35533 35537 35543 35569 35573 35591 35593 35597 35603 35617 35671 35677 35729 35731 35747 35753 35759 35771 35797 35801 35803 35809 35831 35837 35839 35851 35863 35869 35879 35897 35899 35911 35923 35933 35951 35963 35969 35977 35983 35993 35999 36007 36011 36013 36017 36037 36061 36067 36073 36083 36097 36107 36109 36131 36137 36151 36161 36187 36191 36209 36217 36229 36241 36251 36263 36269 36277 36293 36299 36307 36313 36319 36341 36343 36353 36373 36383 36389 36433 36451 36457 36467 36469 36473 36479 36493 36497 36523 36527 36529 36541 36551 36559 36563 36571 36583 36587 36599 36607 36629 36637 36643 36653 36671 36677 36683 36691 36697 36709 36713 36721 36739 36749 36761 36767 36779 36781 36787 36791 36793 36809 36821 36833 36847 36857 36871 36877 36887 36899 36901 36913 36919 36923 36929 36931 36943 36947 36973 36979 36997 37003 37013 37019 37021 37039 37049 37057 37061 37087 37097 37117 37123 37139 37159 37171 37181 37189 37199 37201 37217 37223 37243 37253 37273 37277 37307 37309 37313 37321 37337 37339 37357 37361 37363 37369 37379 37397 37409 37423 37441 37447 37463 37483 37489 37493 37501 37507 37511 37517 37529 37537 37547 37549 37561 37567 37571 37573 37579 37589 37591 37607 37619 37633 37643 37649 37657 37663 37691 37693 37699 37717 37747 37781 37783 37799 37811 37813 37831 37847 37853 37861 37871 37879 37889 37897 37907 37951 37957 37963 37967 37987 37991 37993 37997 38011 38039 38047 38053 38069 38083 38113 38119 38149 38153 38167 38177 38183 38189 38197 38201 38219 38231 38237 38239 38261 38273 38281 38287 38299 38303 38317 38321 38327 38329 38333 38351 38371 38377 38393 38431 38447 38449 38453 38459 38461 38501 38543 38557 38561 38567 38569 38593 38603 38609 38611 38629 38639 38651 38653 38669 38671 38677 38693 38699 38707 38711 38713 38723 38729 38737 38747 38749 38767 38783 38791 38803 38821 38833 38839 38851 38861 38867 38873 38891 38903 38917 38921 38923 38933 38953 38959 38971 38977 38993 39019 39023 39041 39043 39047 39079 39089 39097 39103 39107 39113 39119 39133 39139 39157 39161 39163 39181 39191 39199 39209 39217 39227 39229 39233 39239 39241 39251 39293 39301 39313 39317 39323 39341 39343 39359 39367 39371 39373 39383 39397 39409 39419 39439 39443 39451 39461 39499 39503 39509 39511 39521 39541 39551 39563 39569 39581 39607 39619 39623 39631 39659 39667 39671 39679 39703 39709 39719 39727 39733 39749 39761 39769 39779 39791 39799 39821 39827 39829 39839 39841 39847 39857 39863 39869 39877 39883 39887 39901 39929 39937 39953 39971 39979 39983 39989 40009 40013 40031 40037 40039 40063 40087 40093 40099 40111 40123 40127 40129 40151 40153 40163 40169 40177 40189 40193 40213 40231 40237 40241 40253 40277 40283 40289 40343 40351 40357 40361 40387 40423 40427 40429 40433 40459 40471 40483 40487 40493 40499 40507 40519 40529 40531 40543 40559 40577 40583 40591 40597 40609 40627 40637 40639 40693 40697 40699 40709 40739 40751 40759 40763 40771 40787 40801 40813 40819 40823 40829 40841 40847 40849 40853 40867 40879 40883 40897 40903 40927 40933 40939 40949 40961 40973 40993 41011 41017 41023 41039 41047 41051 41057 41077 41081 41113 41117 41131 41141 41143 41149 41161 41177 41179 41183 41189 41201 41203 41213 41221 41227 41231 41233 41243 41257 41263 41269 41281 41299 41333 41341 41351 41357 41381 41387 41389 41399 41411 41413 41443 41453 41467 41479 41491 41507 41513 41519 41521 41539 41543 41549 41579 41593 41597 41603 41609 41611 41617 41621 41627 41641 41647 41651 41659 41669 41681 41687 41719 41729 41737 41759 41761 41771 41777 41801 41809 41813 41843 41849 41851 41863 41879 41887 41893 41897 41903 41911 41927 41941 41947 41953 41957 41959 41969 41981 41983 41999 42013 42017 42019 42023 42043 42061 42071 42073 42083 42089 42101 42131 42139 42157 42169 42179 42181 42187 42193 42197 42209 42221 42223 42227 42239 42257 42281 42283 42293 42299 42307 42323 42331 42337 42349 42359 42373 42379 42391 42397 42403 42407 42409 42433 42437 42443 42451 42457 42461 42463 42467 42473 42487 42491 42499 42509 42533 42557 42569 42571 42577 42589 42611 42641 42643 42649 42667 42677 42683 42689 42697 42701 42703 42709 42719 42727 42737 42743 42751 42767 42773 42787 42793 42797 42821 42829 42839 42841 42853 42859 42863 42899 42901 42923 42929 42937 42943 42953 42961 42967 42979 42989 43003 43013 43019 43037 43049 43051 43063 43067 43093 43103 43117 43133 43151 43159 43177 43189 43201 43207 43223 43237 43261 43271 43283 43291 43313 43319 43321 43331 43391 43397 43399 43403 43411 43427 43441 43451 43457 43481 43487 43499 43517 43541 43543 43573 43577 43579 43591 43597 43607 43609 43613 43627 43633 43649 43651 43661 43669 43691 43711 43717 43721 43753 43759 43777 43781 43783 43787 43789 43793 43801 43853 43867 43889 43891 43913 43933 43943 43951 43961 43963 43969 43973 43987 43991 43997 44017 44021 44027 44029 44041 44053 44059 44071 44087 44089 44101 44111 44119 44123 44129 44131 44159 44171 44179 44189 44201 44203 44207 44221 44249 44257 44263 44267 44269 44273 44279 44281 44293 44351 44357 44371 44381 44383 44389 44417 44449 44453 44483 44491 44497 44501 44507 44519 44531 44533 44537 44543 44549 44563 44579 44587 44617 44621 44623 44633 44641 44647 44651 44657 44683 44687 44699 44701 44711 44729 44741 44753 44771 44773 44777 44789 44797 44809 44819 44839 44843 44851 44867 44879 44887 44893 44909 44917 44927 44939 44953 44959 44963 44971 44983 44987 45007 45013 45053 45061 45077 45083 45119 45121 45127 45131 45137 45139 45161 45179 45181 45191 45197 45233 45247 45259 45263 45281 45289 45293 45307 45317 45319 45329 45337 45341 45343 45361 45377 45389 45403 45413 45427 45433 45439 45481 45491 45497 45503 45523 45533 45541 45553 45557 45569 45587 45589 45599 45613 45631 45641 45659 45667 45673 45677 45691 45697 45707 45737 45751 45757 45763 45767 45779 45817 45821 45823 45827 45833 45841 45853 45863 45869 45887 45893 45943 45949 45953 45959 45971 45979 45989 46021 46027 46049 46051 46061 46073 46091 46093 46099 46103 46133 46141 46147 46153 46171 46181 46183 46187 46199 46219 46229 46237 46261 46271 46273 46279 46301 46307 46309 46327 46337 46349 46351 46381 46399 46411 46439 46441 46447 46451 46457 46471 46477 46489 46499 46507 46511 46523 46549 46559 46567 46573 46589 46591 46601 46619 46633 46639 46643 46649 46663 46679 46681 46687 46691 46703 46723 46727 46747 46751 46757 46769 46771 46807 46811 46817 46819 46829 46831 46853 46861 46867 46877 46889 46901 46919 46933 46957 46993 46997 47017 47041 47051 47057 47059 47087 47093 47111 47119 47123 47129 47137 47143 47147 47149 47161 47189 47207 47221 47237 47251 47269 47279 47287 47293 47297 47303 47309 47317 47339 47351 47353 47363 47381 47387 47389 47407 47417 47419 47431 47441 47459 47491 47497 47501 47507 47513 47521 47527 47533 47543 47563 47569 47581 47591 47599 47609 47623 47629 47639 47653 47657 47659 47681 47699 47701 47711 47713 47717 47737 47741 47743 47777 47779 47791 47797 47807 47809 47819 47837 47843 47857 47869 47881 47903 47911 47917 47933 47939 47947 47951 47963 47969 47977 47981 48017 48023 48029 48049 48073 48079 48091 48109 48119 48121 48131 48157 48163 48179 48187 48193 48197 48221 48239 48247 48259 48271 48281 48299 48311 48313 48337 48341 48353 48371 48383 48397 48407 48409 48413 48437 48449 48463 48473 48479 48481 48487 48491 48497 48523 48527 48533 48539 48541 48563 48571 48589 48593 48611 48619 48623 48647 48649 48661 48673 48677 48679 48731 48733 48751 48757 48761 48767 48779 48781 48787 48799 48809 48817 48821 48823 48847 48857 48859 48869 48871 48883 48889 48907 48947 48953 48973 48989 48991 49003 49009 49019 49031 49033 49037 49043 49057 49069 49081 49103 49109 49117 49121 49123 49139 49157 49169 49171 49177 49193 49199 49201 49207 49211 49223 49253 49261 49277 49279 49297 49307 49331 49333 49339 49363 49367 49369 49391 49393 49409 49411 49417 49429 49433 49451 49459 49463 49477 49481 49499 49523 49529 49531 49537 49547 49549 49559 49597 49603 49613 49627 49633 49639 49663 49667 49669 49681 49697 49711 49727 49739 49741 49747 49757 49783 49787 49789 49801 49807 49811 49823 49831 49843 49853 49871 49877 49891 49919 49921 49927 49937 49939 49943 49957 49991 49993 49999
diff --git a/testsuite/tests/misc/takc.ml b/testsuite/tests/misc/takc.ml
index 8f9400ebdf..89bb38755f 100644
--- a/testsuite/tests/misc/takc.ml
+++ b/testsuite/tests/misc/takc.ml
@@ -20,4 +20,3 @@ let rec repeat n =
if n <= 0 then 0 else tak 18 12 6 + repeat(n-1)
let _ = print_int (repeat 2000); print_newline(); exit 0
-
diff --git a/testsuite/tests/prim-revapply/Makefile b/testsuite/tests/prim-revapply/Makefile
new file mode 100644
index 0000000000..bcc2fdb011
--- /dev/null
+++ b/testsuite/tests/prim-revapply/Makefile
@@ -0,0 +1,4 @@
+BASEDIR=../..
+
+include $(BASEDIR)/makefiles/Makefile.several
+include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/prim-revapply/apply.ml b/testsuite/tests/prim-revapply/apply.ml
new file mode 100644
index 0000000000..1a169e18e5
--- /dev/null
+++ b/testsuite/tests/prim-revapply/apply.ml
@@ -0,0 +1,36 @@
+external ( @@ ) : ('a -> 'b) -> 'a -> 'b = "%apply"
+
+let f x = x + x
+let g x = x * x
+let h x = x + 1
+let add x y = x + y
+
+let _ =
+ List.iter (fun x ->
+ print_int x; print_newline ()
+ )
+ [
+ f @@ 3; (* 6 *)
+ g @@ f @@ 3; (* 36 *)
+ f @@ g @@ 3; (* 18 *)
+ h @@ g @@ f @@ 3; (* 37 *)
+ add 4 @@ g @@ f @@ add 3 @@ add 2 @@ 3; (* 260 *)
+ ]
+external ( @@ ) : ('a -> 'b) -> 'a -> 'b = "%apply"
+
+let f x = x + x
+let g x = x * x
+let h x = x + 1
+let add x y = x + y
+
+let _ =
+ List.iter (fun x ->
+ print_int x; print_newline ()
+ )
+ [
+ f @@ 3; (* 6 *)
+ g @@ f @@ 3; (* 36 *)
+ f @@ g @@ 3; (* 18 *)
+ h @@ g @@ f @@ 3; (* 37 *)
+ add 4 @@ g @@ f @@ add 3 @@ add 2 @@ 3; (* 260 *)
+ ]
diff --git a/testsuite/tests/prim-revapply/apply.reference b/testsuite/tests/prim-revapply/apply.reference
new file mode 100644
index 0000000000..07fc0dc4ce
--- /dev/null
+++ b/testsuite/tests/prim-revapply/apply.reference
@@ -0,0 +1,10 @@
+6
+36
+18
+37
+260
+6
+36
+18
+37
+260
diff --git a/testsuite/tests/prim-revapply/revapply.ml b/testsuite/tests/prim-revapply/revapply.ml
new file mode 100644
index 0000000000..f8b0dc2e95
--- /dev/null
+++ b/testsuite/tests/prim-revapply/revapply.ml
@@ -0,0 +1,18 @@
+external ( |> ) : 'a -> ('a -> 'b) -> 'b = "%revapply"
+
+let f x = x + x
+let g x = x * x
+let h x = x + 1
+let add x y = x + y
+
+let _ =
+ List.iter (fun x ->
+ print_int x; print_newline ()
+ )
+ [
+ 3 |> f; (* 6 *)
+ 3 |> f |> g; (* 36 *)
+ 3 |> g |> f; (* 18 *)
+ 3 |> f |> g |> h; (* 37 *)
+ 3 |> add 2 |> add 3 |> f |> g |> add 4; (* 260 *)
+ ]
diff --git a/testsuite/tests/prim-revapply/revapply.reference b/testsuite/tests/prim-revapply/revapply.reference
new file mode 100644
index 0000000000..fbca4428dd
--- /dev/null
+++ b/testsuite/tests/prim-revapply/revapply.reference
@@ -0,0 +1,5 @@
+6
+36
+18
+37
+260
diff --git a/testsuite/tests/regression/pr5233/Makefile b/testsuite/tests/regression/pr5233/Makefile
new file mode 100644
index 0000000000..c7a1ed0e7c
--- /dev/null
+++ b/testsuite/tests/regression/pr5233/Makefile
@@ -0,0 +1,4 @@
+MAIN_MODULE=pr5233
+
+include ../../../makefiles/Makefile.one
+include ../../../makefiles/Makefile.common
diff --git a/testsuite/tests/regression/pr5233/pr5233.ml b/testsuite/tests/regression/pr5233/pr5233.ml
new file mode 100644
index 0000000000..d0b5f76203
--- /dev/null
+++ b/testsuite/tests/regression/pr5233/pr5233.ml
@@ -0,0 +1,50 @@
+open Printf;;
+
+(* PR#5233: Create a dangling pointer and use it to access random parts
+ of the heap. *)
+
+(* The buggy weak array will end up in smuggle. *)
+let smuggle = ref (Weak.create 1);;
+
+(* This will be the weak array (W). *)
+let t = ref (Weak.create 1);;
+
+(* Set a finalisation function on W. *)
+Gc.finalise (fun w -> smuggle := w) !t;;
+
+(* Free W and run its finalisation function. *)
+t := Weak.create 1;;
+Gc.full_major ();;
+
+(* smuggle now contains W, whose pointers are not erased, even
+ when the contents is deallocated. *)
+
+let size = 1_000_000;;
+
+let check o =
+ printf "checking...";
+ match o with
+ | None -> printf " no value\n";
+ | Some s ->
+ printf " value found / testing...";
+ for i = 0 to size - 1 do
+ if s.[i] != ' ' then failwith "bad";
+ done;
+ printf " ok\n";
+;;
+
+Weak.set !smuggle 0 (Some (String.make size ' '));;
+
+(* Check the data just to make sure. *)
+check (Weak.get !smuggle 0);;
+
+(* Get a dangling pointer in W. *)
+Gc.full_major ();;
+
+(* Fill the heap with other stuff. *)
+let rec fill n accu = if n = 0 then accu else fill (n-1) (123 :: accu);;
+let r = fill ((Gc.stat ()).Gc.heap_words / 3) [];;
+Gc.minor ();;
+
+(* Now follow the dangling pointer and exhibit the problem. *)
+check (Weak.get !smuggle 0);;
diff --git a/testsuite/tests/regression/pr5233/pr5233.reference b/testsuite/tests/regression/pr5233/pr5233.reference
new file mode 100644
index 0000000000..ef728f633a
--- /dev/null
+++ b/testsuite/tests/regression/pr5233/pr5233.reference
@@ -0,0 +1,2 @@
+checking... value found / testing... ok
+checking... no value
diff --git a/testsuite/tests/tool-lexyacc/gram_aux.ml b/testsuite/tests/tool-lexyacc/gram_aux.ml
index c00fa9bfe1..c082ea1bc3 100644
--- a/testsuite/tests/tool-lexyacc/gram_aux.ml
+++ b/testsuite/tests/tool-lexyacc/gram_aux.ml
@@ -44,4 +44,3 @@ let rec subtract l1 l2 =
match l1 with
[] -> []
| a::l -> if List.mem a l2 then subtract l l2 else a :: subtract l l2
-
diff --git a/testsuite/tests/tool-lexyacc/grammar.mly b/testsuite/tests/tool-lexyacc/grammar.mly
index 8d1346f8e3..267b71e3d3 100644
--- a/testsuite/tests/tool-lexyacc/grammar.mly
+++ b/testsuite/tests/tool-lexyacc/grammar.mly
@@ -50,7 +50,7 @@ header:
other_definitions:
other_definitions Tand definition
{ $3::$1 }
- |
+ |
{ [] }
;
definition:
@@ -111,4 +111,3 @@ char_class1:
;
%%
-
diff --git a/testsuite/tests/tool-lexyacc/input b/testsuite/tests/tool-lexyacc/input
index b6fdfee8df..da2f06aa7a 100644
--- a/testsuite/tests/tool-lexyacc/input
+++ b/testsuite/tests/tool-lexyacc/input
@@ -21,27 +21,27 @@ open Scan_aux
}
rule main = parse
- [' ' '\010' '\013' '\009' ] +
+ [' ' '\010' '\013' '\009' ] +
{ main lexbuf }
- | "(*"
+ | "(*"
{ comment_depth := 1;
comment lexbuf;
main lexbuf }
| (['A'-'Z' 'a'-'z'] | '_' ['A'-'Z' 'a'-'z' '\'' '0'-'9'])
- ( '_' ? ['A'-'Z' 'a'-'z' ''' '0'-'9'] ) *
+ ( '_' ? ['A'-'Z' 'a'-'z' ''' '0'-'9'] ) *
{ match Lexing.lexeme lexbuf with
"rule" -> Trule
| "parse" -> Tparse
| "and" -> Tand
| "eof" -> Teof
| s -> Tident s }
- | '"'
+ | '"'
{ reset_string_buffer();
string lexbuf;
Tstring(get_stored_string()) }
- | "'"
+ | "'"
{ Tchar(char lexbuf) }
- | '{'
+ | '{'
{ let n1 = Lexing.lexeme_end lexbuf in
brace_depth := 1;
let n2 = action lexbuf in
@@ -66,68 +66,68 @@ rule main = parse
{ raise(Lexical_error("illegal character " ^ Lexing.lexeme lexbuf)) }
and action = parse
- '{'
+ '{'
{ incr brace_depth;
action lexbuf }
- | '}'
+ | '}'
{ decr brace_depth;
if !brace_depth = 0 then Lexing.lexeme_start lexbuf else action lexbuf }
- | '"'
+ | '"'
{ reset_string_buffer();
string lexbuf;
reset_string_buffer();
action lexbuf }
| '\''
{ let _ = char lexbuf in action lexbuf }
- | "(*"
+ | "(*"
{ comment_depth := 1;
comment lexbuf;
action lexbuf }
- | eof
+ | eof
{ raise (Lexical_error "unterminated action") }
- | _
+ | _
{ action lexbuf }
-
+
and string = parse
- '"'
+ '"'
{ () }
| '\\' [' ' '\010' '\013' '\009' '\026' '\012'] +
{ string lexbuf }
- | '\\' ['\\' '"' 'n' 't' 'b' 'r']
+ | '\\' ['\\' '"' 'n' 't' 'b' 'r']
{ store_string_char(char_for_backslash(Lexing.lexeme_char lexbuf 1));
string lexbuf }
- | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9']
+ | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9']
{ store_string_char(char_for_decimal_code lexbuf 1);
string lexbuf }
- | eof
+ | eof
{ raise(Lexical_error "unterminated string") }
- | _
+ | _
{ store_string_char(Lexing.lexeme_char lexbuf 0);
string lexbuf }
and char = parse
- [^ '\\'] "'"
+ [^ '\\'] "'"
{ Lexing.lexeme_char lexbuf 0 }
- | '\\' ['\\' '\'' 'n' 't' 'b' 'r'] "'"
+ | '\\' ['\\' '\'' 'n' 't' 'b' 'r'] "'"
{ char_for_backslash (Lexing.lexeme_char lexbuf 1) }
- | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] "'"
+ | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] "'"
{ char_for_decimal_code lexbuf 1 }
- | _
+ | _
{ raise(Lexical_error "bad character constant") }
and comment = parse
- "(*"
+ "(*"
{ incr comment_depth; comment lexbuf }
- | "*)"
+ | "*)"
{ decr comment_depth;
if !comment_depth = 0 then () else comment lexbuf }
- | '"'
+ | '"'
{ reset_string_buffer();
string lexbuf;
reset_string_buffer();
comment lexbuf }
- | eof
+ | eof
{ raise(Lexical_error "unterminated comment") }
- | _
+ | _
{ comment lexbuf }
;;
diff --git a/testsuite/tests/tool-lexyacc/input.ml b/testsuite/tests/tool-lexyacc/input.ml
index 57d17c08d1..002bf72c7e 100644
--- a/testsuite/tests/tool-lexyacc/input.ml
+++ b/testsuite/tests/tool-lexyacc/input.ml
@@ -309,4 +309,3 @@ and char lexbuf =
and comment lexbuf =
Lexing.init lexbuf;
state_4 lexbuf
-
diff --git a/testsuite/tests/tool-lexyacc/lexgen.ml b/testsuite/tests/tool-lexyacc/lexgen.ml
index d4b6f9a96e..8a3e36a612 100644
--- a/testsuite/tests/tool-lexyacc/lexgen.ml
+++ b/testsuite/tests/tool-lexyacc/lexgen.ml
@@ -200,7 +200,7 @@ let memory = (Hashtbl.create 131 : (transition list, int) Hashtbl.t)
let todo = ref ([] : (transition list * int) list)
let next = ref 0
-let get_state st =
+let get_state st =
try
Hashtbl.find memory st
with Not_found ->
@@ -222,7 +222,7 @@ let goto_state = function
| ps -> Goto (get_state ps)
-let transition_from chars follow pos_set =
+let transition_from chars follow pos_set =
let tr = Array.create 256 []
and shift = Array.create 256 Backtrack in
List.iter
@@ -263,4 +263,3 @@ let make_dfa lexdef =
Array.create (number_of_states()) (Perform 0) in
List.iter (fun (auto, i) -> v.(i) <- auto) states;
(initial_states, v, actions)
-
diff --git a/testsuite/tests/tool-lexyacc/main.reference b/testsuite/tests/tool-lexyacc/main.reference
index 7711833a4c..f3dac42291 100644
--- a/testsuite/tests/tool-lexyacc/main.reference
+++ b/testsuite/tests/tool-lexyacc/main.reference
@@ -310,4 +310,3 @@ and char lexbuf =
and comment lexbuf =
Lexing.init lexbuf;
state_4 lexbuf
-
diff --git a/testsuite/tests/tool-lexyacc/output.ml b/testsuite/tests/tool-lexyacc/output.ml
index 141510c445..0956b4069c 100644
--- a/testsuite/tests/tool-lexyacc/output.ml
+++ b/testsuite/tests/tool-lexyacc/output.ml
@@ -137,7 +137,7 @@ let output_state state_num = function
(* 3- Generating the entry points *)
-
+
let rec output_entries = function
[] -> failwith "output_entries"
| (name,state_num) :: rest ->
@@ -146,7 +146,7 @@ let rec output_entries = function
output_string !oc (" state_" ^ string_of_int state_num ^
" lexbuf\n");
match rest with
- [] -> output_string !oc "\n"; ()
+ [] -> ()
| _ -> output_string !oc "\nand "; output_entries rest
@@ -164,6 +164,3 @@ let output_lexdef header (initial_st, st, actions) =
output_state i st.(i)
done;
output_entries initial_st
-
-
-
diff --git a/testsuite/tests/tool-lexyacc/scan_aux.ml b/testsuite/tests/tool-lexyacc/scan_aux.ml
index 7c796f353c..54da13ede0 100644
--- a/testsuite/tests/tool-lexyacc/scan_aux.ml
+++ b/testsuite/tests/tool-lexyacc/scan_aux.ml
@@ -57,4 +57,3 @@ let char_for_decimal_code lexbuf i =
Char.chr(100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) +
10 * (Char.code(Lexing.lexeme_char lexbuf (i+1)) - 48) +
(Char.code(Lexing.lexeme_char lexbuf (i+2)) - 48))
-
diff --git a/testsuite/tests/tool-lexyacc/scanner.mll b/testsuite/tests/tool-lexyacc/scanner.mll
index f791feaf24..c304806292 100644
--- a/testsuite/tests/tool-lexyacc/scanner.mll
+++ b/testsuite/tests/tool-lexyacc/scanner.mll
@@ -21,27 +21,27 @@ open Scan_aux
}
rule main = parse
- [' ' '\010' '\013' '\009' ] +
+ [' ' '\010' '\013' '\009' ] +
{ main lexbuf }
- | "(*"
+ | "(*"
{ comment_depth := 1;
comment lexbuf;
main lexbuf }
| (['A'-'Z' 'a'-'z'] | '_' ['A'-'Z' 'a'-'z' '\'' '0'-'9'])
- ( '_' ? ['A'-'Z' 'a'-'z' ''' '0'-'9'] ) *
+ ( '_' ? ['A'-'Z' 'a'-'z' ''' '0'-'9'] ) *
{ match Lexing.lexeme lexbuf with
"rule" -> Trule
| "parse" -> Tparse
| "and" -> Tand
| "eof" -> Teof
| s -> Tident s }
- | '"'
+ | '"'
{ reset_string_buffer();
string lexbuf;
Tstring(get_stored_string()) }
- | "'"
+ | "'"
{ Tchar(char lexbuf) }
- | '{'
+ | '{'
{ let n1 = Lexing.lexeme_end lexbuf in
brace_depth := 1;
let n2 = action lexbuf in
@@ -66,67 +66,67 @@ rule main = parse
{ raise(Lexical_error("illegal character " ^ Lexing.lexeme lexbuf)) }
and action = parse
- '{'
+ '{'
{ incr brace_depth;
action lexbuf }
- | '}'
+ | '}'
{ decr brace_depth;
if !brace_depth = 0 then Lexing.lexeme_start lexbuf else action lexbuf }
- | '"'
+ | '"'
{ reset_string_buffer();
string lexbuf;
reset_string_buffer();
action lexbuf }
| '\''
{ let _ = char lexbuf in action lexbuf }
- | "(*"
+ | "(*"
{ comment_depth := 1;
comment lexbuf;
action lexbuf }
- | eof
+ | eof
{ raise (Lexical_error "unterminated action") }
- | _
+ | _
{ action lexbuf }
-
+
and string = parse
- '"'
+ '"'
{ () }
| '\\' [' ' '\010' '\013' '\009' '\026' '\012'] +
{ string lexbuf }
- | '\\' ['\\' '"' 'n' 't' 'b' 'r']
+ | '\\' ['\\' '"' 'n' 't' 'b' 'r']
{ store_string_char(char_for_backslash(Lexing.lexeme_char lexbuf 1));
string lexbuf }
- | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9']
+ | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9']
{ store_string_char(char_for_decimal_code lexbuf 1);
string lexbuf }
- | eof
+ | eof
{ raise(Lexical_error "unterminated string") }
- | _
+ | _
{ store_string_char(Lexing.lexeme_char lexbuf 0);
string lexbuf }
and char = parse
- [^ '\\'] "'"
+ [^ '\\'] "'"
{ Lexing.lexeme_char lexbuf 0 }
- | '\\' ['\\' '\'' 'n' 't' 'b' 'r'] "'"
+ | '\\' ['\\' '\'' 'n' 't' 'b' 'r'] "'"
{ char_for_backslash (Lexing.lexeme_char lexbuf 1) }
- | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] "'"
+ | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] "'"
{ char_for_decimal_code lexbuf 1 }
- | _
+ | _
{ raise(Lexical_error "bad character constant") }
and comment = parse
- "(*"
+ "(*"
{ incr comment_depth; comment lexbuf }
- | "*)"
+ | "*)"
{ decr comment_depth;
if !comment_depth = 0 then () else comment lexbuf }
- | '"'
+ | '"'
{ reset_string_buffer();
string lexbuf;
reset_string_buffer();
comment lexbuf }
- | eof
+ | eof
{ raise(Lexical_error "unterminated comment") }
- | _
+ | _
{ comment lexbuf }
diff --git a/testsuite/tests/tool-ocamldoc/Makefile b/testsuite/tests/tool-ocamldoc/Makefile
index d112f568cd..2af4d34770 100644
--- a/testsuite/tests/tool-ocamldoc/Makefile
+++ b/testsuite/tests/tool-ocamldoc/Makefile
@@ -2,11 +2,14 @@ BASEDIR=../..
CUSTOM_MODULE=odoc_test
ADD_COMPFLAGS=-I +ocamldoc
+DIFF_OPT=--strip-trailing-cr
+#DIFF_OPT=-b
+
run: $(CUSTOM_MODULE).cmo
@for file in t*.ml; do \
printf " ... testing '$$file'"; \
$(OCAMLDOC) -hide-warnings -g $(CUSTOM_MODULE).cmo -o `basename $$file ml`result $$file; \
- $(DIFF) `basename $$file ml`reference `basename $$file ml`result > /dev/null && echo " => passed" || (echo " => failed" && exit 1); \
+ $(DIFF) $(DIFF_OPT) `basename $$file ml`reference `basename $$file ml`result > /dev/null && echo " => passed" || (echo " => failed" && exit 1); \
done;
@$(OCAMLDOC) -hide-warnings -html t*.ml 2>&1 | grep -v test_types_display || true
@$(OCAMLDOC) -hide-warnings -latex t*.ml 2>&1 | grep -v test_types_display || true
diff --git a/testsuite/tests/tool-ocamldoc/odoc_test.ml b/testsuite/tests/tool-ocamldoc/odoc_test.ml
index 1339f10a59..69f71eb6bc 100644
--- a/testsuite/tests/tool-ocamldoc/odoc_test.ml
+++ b/testsuite/tests/tool-ocamldoc/odoc_test.ml
@@ -27,64 +27,64 @@ class string_gen =
inherit Odoc_info.Scan.scanner
val mutable test_kinds = []
- val mutable fmt = Format.str_formatter
+ val mutable fmt = Format.str_formatter
method must_display_types = List.mem Types_display test_kinds
method set_test_kinds_from_module m =
test_kinds <- List.fold_left
- (fun acc (s, _) ->
- match s with
- "test_types_display" -> Types_display :: acc
- | _ -> acc
- )
- []
- (
- match m.m_info with
- None -> []
- | Some i -> i.i_custom
- )
+ (fun acc (s, _) ->
+ match s with
+ "test_types_display" -> Types_display :: acc
+ | _ -> acc
+ )
+ []
+ (
+ match m.m_info with
+ None -> []
+ | Some i -> i.i_custom
+ )
method! scan_type t =
match test_kinds with
- [] -> ()
- | _ ->
- p fmt "# type %s:\n" t.ty_name;
- if self#must_display_types then
- (
- p fmt "# manifest (Odoc_info.string_of_type_expr):\n<[%s]>\n"
- (match t.ty_manifest with
- None -> "None"
- | Some e -> Odoc_info.string_of_type_expr e
- );
- );
+ [] -> ()
+ | _ ->
+ p fmt "# type %s:\n" t.ty_name;
+ if self#must_display_types then
+ (
+ p fmt "# manifest (Odoc_info.string_of_type_expr):\n<[%s]>\n"
+ (match t.ty_manifest with
+ None -> "None"
+ | Some e -> Odoc_info.string_of_type_expr e
+ );
+ );
method! scan_module_pre m =
p fmt "#\n# module %s:\n" m.m_name ;
if self#must_display_types then
- (
- p fmt "# Odoc_info.string_of_module_type:\n<[%s]>\n"
- (Odoc_info.string_of_module_type m.m_type);
- p fmt "# Odoc_info.string_of_module_type ~complete: true :\n<[%s]>\n"
- (Odoc_info.string_of_module_type ~complete: true m.m_type);
- );
+ (
+ p fmt "# Odoc_info.string_of_module_type:\n<[%s]>\n"
+ (Odoc_info.string_of_module_type m.m_type);
+ p fmt "# Odoc_info.string_of_module_type ~complete: true :\n<[%s]>\n"
+ (Odoc_info.string_of_module_type ~complete: true m.m_type);
+ );
true
method! scan_module_type_pre m =
p fmt "#\n# module type %s:\n" m.mt_name ;
if self#must_display_types then
- (
- p fmt "# Odoc_info.string_of_module_type:\n<[%s]>\n"
- (match m.mt_type with
- None -> "None"
- | Some t -> Odoc_info.string_of_module_type t
- );
- p fmt "# Odoc_info.string_of_module_type ~complete: true :\n<[%s]>\n"
- (match m.mt_type with
- None -> "None"
- | Some t -> Odoc_info.string_of_module_type ~complete: true t
- );
- );
+ (
+ p fmt "# Odoc_info.string_of_module_type:\n<[%s]>\n"
+ (match m.mt_type with
+ None -> "None"
+ | Some t -> Odoc_info.string_of_module_type t
+ );
+ p fmt "# Odoc_info.string_of_module_type ~complete: true :\n<[%s]>\n"
+ (match m.mt_type with
+ None -> "None"
+ | Some t -> Odoc_info.string_of_module_type ~complete: true t
+ );
+ );
true
method generate (module_list: Odoc_info.Module.t_module list) =
@@ -92,15 +92,15 @@ class string_gen =
fmt <- Format.formatter_of_out_channel oc;
(
try
- List.iter
- (fun m ->
- self#set_test_kinds_from_module m;
- self#scan_module_list [m];
- )
- module_list
+ List.iter
+ (fun m ->
+ self#set_test_kinds_from_module m;
+ self#scan_module_list [m];
+ )
+ module_list
with
- e ->
- prerr_endline (Printexc.to_string e)
+ e ->
+ prerr_endline (Printexc.to_string e)
);
Format.pp_print_flush fmt ();
close_out oc
@@ -114,4 +114,4 @@ let _ =
method generate = inst#generate
end
end in
- Odoc_args.set_generator (Odoc_gen.Other (module My_generator : Odoc_gen.Base))
+ Odoc_args.set_generator (Odoc_gen.Base (module My_generator : Odoc_gen.Base))
diff --git a/testsuite/tests/tool-ocamldoc/t01.ml b/testsuite/tests/tool-ocamldoc/t01.ml
index 6caf3d7afc..d253be43db 100644
--- a/testsuite/tests/tool-ocamldoc/t01.ml
+++ b/testsuite/tests/tool-ocamldoc/t01.ml
@@ -7,7 +7,7 @@ let x = 1
module M = struct
- let y = 2
+ let y = 2
end
diff --git a/testsuite/tests/tool-ocamldoc/t03.ml b/testsuite/tests/tool-ocamldoc/t03.ml
index 43f1857d56..3d06cc5969 100644
--- a/testsuite/tests/tool-ocamldoc/t03.ml
+++ b/testsuite/tests/tool-ocamldoc/t03.ml
@@ -4,4 +4,4 @@ module Bar = struct type t = int let x = 2 end;;
module type MT2 = sig type t val x : t end;;
module type Gee = MT2 with type t = float ;;
-module T = (val (if true then (module Foo:MT2 with type t = int) else (module Bar: MT2 with type t = int)) : MT2 with type t = int);; \ No newline at end of file
+module T = (val (if true then (module Foo:MT2 with type t = int) else (module Bar: MT2 with type t = int)) : MT2 with type t = int);;
diff --git a/testsuite/tests/typing-fstclassmod/fstclassmod.ml b/testsuite/tests/typing-fstclassmod/fstclassmod.ml
index 905af53463..268d35d492 100644
--- a/testsuite/tests/typing-fstclassmod/fstclassmod.ml
+++ b/testsuite/tests/typing-fstclassmod/fstclassmod.ml
@@ -139,4 +139,3 @@ end
let () =
print_endline (Print.to_string int 10);
print_endline (Print.to_string (pair int (pair str int)) (123, ("A", 456)))
-
diff --git a/testsuite/tests/typing-gadts/Makefile b/testsuite/tests/typing-gadts/Makefile
index 9add15574f..9625a3fbc3 100644
--- a/testsuite/tests/typing-gadts/Makefile
+++ b/testsuite/tests/typing-gadts/Makefile
@@ -1,3 +1,3 @@
-include ../../makefiles/Makefile.toplevel
-include ../../makefiles/Makefile.common
-
+BASEDIR=../..
+include $(BASEDIR)/makefiles/Makefile.toplevel
+include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/typing-gadts/dynamic_frisch.ml b/testsuite/tests/typing-gadts/dynamic_frisch.ml
index 895be5a05c..2636d5b424 100644
--- a/testsuite/tests/typing-gadts/dynamic_frisch.ml
+++ b/testsuite/tests/typing-gadts/dynamic_frisch.ml
@@ -18,7 +18,7 @@ type variant =
| VString of string
| VList of variant list
| VPair of variant * variant
-
+
let rec variantize: type t. t ty -> t -> variant =
fun ty x ->
(* type t is abstract here *)
@@ -31,9 +31,9 @@ let rec variantize: type t. t ty -> t -> variant =
| Pair (ty1, ty2) ->
VPair (variantize ty1 (fst x), variantize ty2 (snd x))
(* t = ('a, 'b) for some 'a and 'b *)
-
+
exception VariantMismatch
-
+
let rec devariantize: type t. t ty -> variant -> t =
fun ty v ->
match ty, v with
@@ -54,16 +54,16 @@ type 'a ty =
| List: 'a ty -> 'a list ty
| Pair: ('a ty * 'b ty) -> ('a * 'b) ty
| Record: 'a record -> 'a ty
-
+
and 'a record =
{
path: string;
fields: 'a field_ list;
}
-
+
and 'a field_ =
| Field: ('a, 'b) field -> 'a field_
-
+
and ('a, 'b) field =
{
label: string;
@@ -98,7 +98,7 @@ let rec variantize: type t. t ty -> t -> variant =
(List.map (fun (Field{field_type; label; get}) ->
(label, variantize field_type (get x))) fields)
;;
-
+
(* Extraction *)
type 'a ty =
@@ -107,7 +107,7 @@ type 'a ty =
| List: 'a ty -> 'a list ty
| Pair: ('a ty * 'b ty) -> ('a * 'b) ty
| Record: ('a, 'builder) record -> 'a ty
-
+
and ('a, 'builder) record =
{
path: string;
@@ -115,10 +115,10 @@ and ('a, 'builder) record =
create_builder: (unit -> 'builder);
of_builder: ('builder -> 'a);
}
-
+
and ('a, 'builder) field =
| Field: ('a, 'builder, 'b) field_ -> ('a, 'builder) field
-
+
and ('a, 'builder, 'b) field_ =
{
label: string;
@@ -126,7 +126,7 @@ and ('a, 'builder, 'b) field_ =
get: ('a -> 'b);
set: ('builder -> 'b -> unit);
}
-
+
let rec devariantize: type t. t ty -> variant -> t =
fun ty v ->
match ty, v with
@@ -154,7 +154,7 @@ type my_record =
a: int;
b: string list;
}
-
+
let my_record =
let fields =
[
diff --git a/testsuite/tests/typing-gadts/pr5689.ml b/testsuite/tests/typing-gadts/pr5689.ml
new file mode 100644
index 0000000000..304f8e6cde
--- /dev/null
+++ b/testsuite/tests/typing-gadts/pr5689.ml
@@ -0,0 +1,74 @@
+type inkind = [ `Link | `Nonlink ]
+
+type _ inline_t =
+ | Text: string -> [< inkind > `Nonlink ] inline_t
+ | Bold: 'a inline_t list -> 'a inline_t
+ | Link: string -> [< inkind > `Link ] inline_t
+ | Mref: string * [ `Nonlink ] inline_t list -> [< inkind > `Link ] inline_t
+;;
+
+let uppercase seq =
+ let rec process: type a. a inline_t -> a inline_t = function
+ | Text txt -> Text (String.uppercase txt)
+ | Bold xs -> Bold (List.map process xs)
+ | Link lnk -> Link lnk
+ | Mref (lnk, xs) -> Mref (lnk, List.map process xs)
+ in List.map process seq
+;;
+
+type ast_t =
+ | Ast_Text of string
+ | Ast_Bold of ast_t list
+ | Ast_Link of string
+ | Ast_Mref of string * ast_t list
+;;
+
+let inlineseq_from_astseq seq =
+ let rec process_nonlink = function
+ | Ast_Text txt -> Text txt
+ | Ast_Bold xs -> Bold (List.map process_nonlink xs)
+ | _ -> assert false in
+ let rec process_any = function
+ | Ast_Text txt -> Text txt
+ | Ast_Bold xs -> Bold (List.map process_any xs)
+ | Ast_Link lnk -> Link lnk
+ | Ast_Mref (lnk, xs) -> Mref (lnk, List.map process_nonlink xs)
+ in List.map process_any seq
+;;
+
+(* OK *)
+type _ linkp =
+ | Nonlink : [ `Nonlink ] linkp
+ | Maylink : inkind linkp
+;;
+let inlineseq_from_astseq seq =
+ let rec process : type a. a linkp -> ast_t -> a inline_t =
+ fun allow_link ast ->
+ match (allow_link, ast) with
+ | (Maylink, Ast_Text txt) -> Text txt
+ | (Nonlink, Ast_Text txt) -> Text txt
+ | (x, Ast_Bold xs) -> Bold (List.map (process x) xs)
+ | (Maylink, Ast_Link lnk) -> Link lnk
+ | (Nonlink, Ast_Link _) -> assert false
+ | (Maylink, Ast_Mref (lnk, xs)) ->
+ Mref (lnk, List.map (process Nonlink) xs)
+ | (Nonlink, Ast_Mref _) -> assert false
+ in List.map (process Maylink) seq
+;;
+
+(* Bad *)
+type _ linkp2 = Kind : 'a linkp -> ([< inkind ] as 'a) linkp2
+;;
+let inlineseq_from_astseq seq =
+let rec process : type a. a linkp2 -> ast_t -> a inline_t =
+ fun allow_link ast ->
+ match (allow_link, ast) with
+ | (Kind _, Ast_Text txt) -> Text txt
+ | (x, Ast_Bold xs) -> Bold (List.map (process x) xs)
+ | (Kind Maylink, Ast_Link lnk) -> Link lnk
+ | (Kind Nonlink, Ast_Link _) -> assert false
+ | (Kind Maylink, Ast_Mref (lnk, xs)) ->
+ Mref (lnk, List.map (process (Kind Nonlink)) xs)
+ | (Kind Nonlink, Ast_Mref _) -> assert false
+ in List.map (process (Kind Maylink)) seq
+;;
diff --git a/testsuite/tests/typing-gadts/pr5689.ml.principal.reference b/testsuite/tests/typing-gadts/pr5689.ml.principal.reference
new file mode 100644
index 0000000000..f1e142aada
--- /dev/null
+++ b/testsuite/tests/typing-gadts/pr5689.ml.principal.reference
@@ -0,0 +1,28 @@
+
+# type inkind = [ `Link | `Nonlink ]
+type _ inline_t =
+ Text : string -> [< inkind > `Nonlink ] inline_t
+ | Bold : 'a inline_t list -> 'a inline_t
+ | Link : string -> [< inkind > `Link ] inline_t
+ | Mref : string *
+ [ `Nonlink ] inline_t list -> [< inkind > `Link ] inline_t
+# val uppercase : 'a inline_t list -> 'a inline_t list = <fun>
+# type ast_t =
+ Ast_Text of string
+ | Ast_Bold of ast_t list
+ | Ast_Link of string
+ | Ast_Mref of string * ast_t list
+# val inlineseq_from_astseq : ast_t list -> inkind inline_t list = <fun>
+# type _ linkp = Nonlink : [ `Nonlink ] linkp | Maylink : inkind linkp
+# val inlineseq_from_astseq : ast_t list -> inkind inline_t list = <fun>
+# type _ linkp2 = Kind : 'a linkp -> ([< inkind ] as 'a) linkp2
+# Characters 272-279:
+ | (Kind Maylink, Ast_Link lnk) -> Link lnk
+ ^^^^^^^
+Error: This pattern matches values of type inkind linkp
+ but a pattern was expected which matches values of type
+ ([< inkind ] as 'a) linkp
+ Type inkind = [ `Link | `Nonlink ] is not compatible with type
+ 'a = [< `Link | `Nonlink ]
+ Types for tag `Nonlink are incompatible
+#
diff --git a/testsuite/tests/typing-gadts/pr5689.ml.reference b/testsuite/tests/typing-gadts/pr5689.ml.reference
new file mode 100644
index 0000000000..f1e142aada
--- /dev/null
+++ b/testsuite/tests/typing-gadts/pr5689.ml.reference
@@ -0,0 +1,28 @@
+
+# type inkind = [ `Link | `Nonlink ]
+type _ inline_t =
+ Text : string -> [< inkind > `Nonlink ] inline_t
+ | Bold : 'a inline_t list -> 'a inline_t
+ | Link : string -> [< inkind > `Link ] inline_t
+ | Mref : string *
+ [ `Nonlink ] inline_t list -> [< inkind > `Link ] inline_t
+# val uppercase : 'a inline_t list -> 'a inline_t list = <fun>
+# type ast_t =
+ Ast_Text of string
+ | Ast_Bold of ast_t list
+ | Ast_Link of string
+ | Ast_Mref of string * ast_t list
+# val inlineseq_from_astseq : ast_t list -> inkind inline_t list = <fun>
+# type _ linkp = Nonlink : [ `Nonlink ] linkp | Maylink : inkind linkp
+# val inlineseq_from_astseq : ast_t list -> inkind inline_t list = <fun>
+# type _ linkp2 = Kind : 'a linkp -> ([< inkind ] as 'a) linkp2
+# Characters 272-279:
+ | (Kind Maylink, Ast_Link lnk) -> Link lnk
+ ^^^^^^^
+Error: This pattern matches values of type inkind linkp
+ but a pattern was expected which matches values of type
+ ([< inkind ] as 'a) linkp
+ Type inkind = [ `Link | `Nonlink ] is not compatible with type
+ 'a = [< `Link | `Nonlink ]
+ Types for tag `Nonlink are incompatible
+#
diff --git a/testsuite/tests/typing-gadts/test.ml b/testsuite/tests/typing-gadts/test.ml
index 8d8bfc2e20..3ba7cc8b84 100644
--- a/testsuite/tests/typing-gadts/test.ml
+++ b/testsuite/tests/typing-gadts/test.ml
@@ -1,23 +1,23 @@
-module Exp =
+module Exp =
struct
- type _ t =
+ type _ t =
| IntLit : int -> int t
| BoolLit : bool -> bool t
| Pair : 'a t * 'b t -> ('a * 'b) t
| App : ('a -> 'b) t * 'a t -> 'b t
- | Abs : ('a -> 'b) -> ('a -> 'b) t
+ | Abs : ('a -> 'b) -> ('a -> 'b) t
- let rec eval : type s . s t -> s =
+ let rec eval : type s . s t -> s =
function
- | IntLit x -> x
- | BoolLit y -> y
- | Pair (x,y) ->
+ | IntLit x -> x
+ | BoolLit y -> y
+ | Pair (x,y) ->
(eval x,eval y)
- | App (f,a) ->
- (eval f) (eval a)
- | Abs f -> f
+ | App (f,a) ->
+ (eval f) (eval a)
+ | Abs f -> f
let discern : type a. a t -> _ = function
IntLit _ -> 1
@@ -28,70 +28,70 @@ module Exp =
end
;;
-module List =
+module List =
struct
type zero
- type _ t =
+ type _ t =
| Nil : zero t
| Cons : 'a * 'b t -> ('a * 'b) t
let head =
function
- | Cons (a,b) -> a
+ | Cons (a,b) -> a
let tail =
function
- | Cons (a,b) -> b
- let rec length : type a . a t -> int =
+ | Cons (a,b) -> b
+ let rec length : type a . a t -> int =
function
- | Nil -> 0
- | Cons (a,b) -> length b
+ | Nil -> 0
+ | Cons (a,b) -> length b
end
;;
-module Nonexhaustive =
+module Nonexhaustive =
struct
- type 'a u =
- | C1 : int -> int u
+ type 'a u =
+ | C1 : int -> int u
| C2 : bool -> bool u
-
- type 'a v =
+
+ type 'a v =
| C1 : int -> int v
- let unexhaustive : type s . s u -> s =
+ let unexhaustive : type s . s u -> s =
function
- | C2 x -> x
+ | C2 x -> x
- module M : sig type t type u end =
+ module M : sig type t type u end =
struct
type t = int
type u = bool
- end
- type 'a t =
- | Foo : M.t -> M.t t
+ end
+ type 'a t =
+ | Foo : M.t -> M.t t
| Bar : M.u -> M.u t
let same_type : type s . s t * s t -> bool =
function
- | Foo _ , Foo _ -> true
- | Bar _, Bar _ -> true
+ | Foo _ , Foo _ -> true
+ | Bar _, Bar _ -> true
end
;;
-module Exhaustive =
+module Exhaustive =
struct
type t = int
type u = bool
- type 'a v =
- | Foo : t -> t v
+ type 'a v =
+ | Foo : t -> t v
| Bar : u -> u v
let same_type : type s . s v * s v -> bool =
function
- | Foo _ , Foo _ -> true
- | Bar _, Bar _ -> true
+ | Foo _ , Foo _ -> true
+ | Bar _, Bar _ -> true
end
;;
-module Existential_escape =
+module Existential_escape =
struct
type _ t = C : int -> int t
type u = D : 'a t -> u
@@ -99,46 +99,46 @@ module Existential_escape =
end
;;
-module Rectype =
+module Rectype =
struct
- type (_,_) t = C : ('a,'a) t
- let _ =
+ type (_,_) t = C : ('a,'a) t
+ let _ =
fun (type s) ->
- let a : (s, s * s) t = failwith "foo" in
- match a with
- C ->
- ()
+ let a : (s, s * s) t = failwith "foo" in
+ match a with
+ C ->
+ ()
end
;;
-module Or_patterns =
+module Or_patterns =
struct
- type _ t =
+ type _ t =
| IntLit : int -> int t
| BoolLit : bool -> bool t
- let rec eval : type s . s t -> unit =
+ let rec eval : type s . s t -> unit =
function
- | (IntLit _ | BoolLit _) -> ()
+ | (IntLit _ | BoolLit _) -> ()
end
;;
-module Polymorphic_variants =
+module Polymorphic_variants =
struct
- type _ t =
+ type _ t =
| IntLit : int -> int t
| BoolLit : bool -> bool t
- let rec eval : type s . [`A] * s t -> unit =
+ let rec eval : type s . [`A] * s t -> unit =
function
- | `A, IntLit _ -> ()
- | `A, BoolLit _ -> ()
- end
+ | `A, IntLit _ -> ()
+ | `A, BoolLit _ -> ()
+ end
;;
module Propagation = struct
- type _ t =
+ type _ t =
IntLit : int -> int t
| BoolLit : bool -> bool t
@@ -302,7 +302,7 @@ let f : type a. a j -> a = function
type (_,_) eq = Eq : ('a,'a) eq ;;
-let f : type a b. (a,b) eq -> (<m : a; ..> as 'a) -> (<m : b; ..> as 'a) =
+let f : type a b. (a,b) eq -> (<m : a; ..> as 'c) -> (<m : b; ..> as 'c) =
fun Eq o -> o
;; (* fail *)
@@ -473,7 +473,7 @@ f V1;;
type _ int_foo =
| IF_constr : <foo:int; ..> int_foo
-type _ int_bar =
+type _ int_bar =
| IB_constr : <bar:int; ..> int_bar
;;
@@ -501,3 +501,14 @@ let g (type t) (x:t) (e : t int_foo) (e' : t int_bar) =
let IF_constr, IB_constr = e, e' in
x, x#foo, x#bar
;;
+
+(* PR#5554 *)
+
+type 'a ty = Int : int -> int ty;;
+
+let f : type a. a ty -> a =
+ fun x -> match x with Int y -> y;;
+
+let g : type a. a ty -> a =
+ let () = () in
+ fun x -> match x with Int y -> y;;
diff --git a/testsuite/tests/typing-gadts/test.ml.principal.reference b/testsuite/tests/typing-gadts/test.ml.principal.reference
index f692325f1d..b5dcb790dd 100644
--- a/testsuite/tests/typing-gadts/test.ml.principal.reference
+++ b/testsuite/tests/typing-gadts/test.ml.principal.reference
@@ -18,16 +18,16 @@
val tail : ('a * 'b) t -> 'b t
val length : 'a t -> int
end
-# Characters 206-227:
+# Characters 196-224:
......function
- | C2 x -> x
+ | C2 x -> x
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
C1 _
-Characters 469-526:
+Characters 458-529:
......function
- | Foo _ , Foo _ -> true
- | Bar _, Bar _ -> true
+ | Foo _ , Foo _ -> true
+ | Bar _, Bar _ -> true
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
(Bar _, Foo _)
@@ -47,27 +47,27 @@ module Nonexhaustive :
type 'a v = Foo : t -> t v | Bar : u -> u v
val same_type : 's v * 's v -> bool
end
-# Characters 119-120:
+# Characters 118-119:
let eval (D x) = x
^
Error: This expression has type ex#16 t
but an expression was expected of type ex#16 t
The type constructor ex#16 would escape its scope
-# Characters 157-158:
- C ->
- ^
+# Characters 174-175:
+ C ->
+ ^
Error: Recursive local constraint when unifying (s, s) t with (s, s * s) t
-# Characters 174-182:
- | (IntLit _ | BoolLit _) -> ()
- ^^^^^^^^
+# Characters 178-186:
+ | (IntLit _ | BoolLit _) -> ()
+ ^^^^^^^^
Error: This pattern matches values of type int t
but a pattern was expected which matches values of type s t
-# Characters 213-226:
- | `A, BoolLit _ -> ()
- ^^^^^^^^^^^^^
+# Characters 224-237:
+ | `A, BoolLit _ -> ()
+ ^^^^^^^^^^^^^
Error: This pattern matches values of type ([? `A ] as 'a) * bool t
but a pattern was expected which matches values of type 'a * int t
-# Characters 300-301:
+# Characters 299-300:
| BoolLit b -> b
^
Error: This expression has type bool but an expression was expected of type s
@@ -144,7 +144,7 @@ val f : 'a h -> 'a = <fun>
val f : 'a j -> 'a = <fun>
# type (_, _) eq = Eq : ('a, 'a) eq
# Characters 5-91:
- ....f : type a b. (a,b) eq -> (<m : a; ..> as 'a) -> (<m : b; ..> as 'a) =
+ ....f : type a b. (a,b) eq -> (<m : a; ..> as 'c) -> (<m : b; ..> as 'c) =
fun Eq o -> o
Error: The universal type variable 'b cannot be generalized:
it is already bound to another variable.
@@ -303,4 +303,7 @@ Error: This expression has type < bar : int; foo : int; .. > as 'a
The type constructor ex#25 would escape its scope
# val g : 'a -> 'a int_foo -> 'a int_bar -> 'a = <fun>
# val g : 'a -> 'a int_foo -> 'a int_bar -> 'a * int * int = <fun>
+# type 'a ty = Int : int -> int ty
+# val f : 'a ty -> 'a = <fun>
+# val g : 'a ty -> 'a = <fun>
#
diff --git a/testsuite/tests/typing-gadts/test.ml.reference b/testsuite/tests/typing-gadts/test.ml.reference
index 8d05b4ffe8..5406ed2a72 100644
--- a/testsuite/tests/typing-gadts/test.ml.reference
+++ b/testsuite/tests/typing-gadts/test.ml.reference
@@ -18,16 +18,16 @@
val tail : ('a * 'b) t -> 'b t
val length : 'a t -> int
end
-# Characters 206-227:
+# Characters 196-224:
......function
- | C2 x -> x
+ | C2 x -> x
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
C1 _
-Characters 469-526:
+Characters 458-529:
......function
- | Foo _ , Foo _ -> true
- | Bar _, Bar _ -> true
+ | Foo _ , Foo _ -> true
+ | Bar _, Bar _ -> true
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
(Bar _, Foo _)
@@ -47,24 +47,24 @@ module Nonexhaustive :
type 'a v = Foo : t -> t v | Bar : u -> u v
val same_type : 's v * 's v -> bool
end
-# Characters 119-120:
+# Characters 118-119:
let eval (D x) = x
^
Error: This expression has type ex#16 t
but an expression was expected of type ex#16 t
The type constructor ex#16 would escape its scope
-# Characters 157-158:
- C ->
- ^
+# Characters 174-175:
+ C ->
+ ^
Error: Recursive local constraint when unifying (s, s) t with (s, s * s) t
-# Characters 174-182:
- | (IntLit _ | BoolLit _) -> ()
- ^^^^^^^^
+# Characters 178-186:
+ | (IntLit _ | BoolLit _) -> ()
+ ^^^^^^^^
Error: This pattern matches values of type int t
but a pattern was expected which matches values of type s t
-# Characters 213-226:
- | `A, BoolLit _ -> ()
- ^^^^^^^^^^^^^
+# Characters 224-237:
+ | `A, BoolLit _ -> ()
+ ^^^^^^^^^^^^^
Error: This pattern matches values of type ([? `A ] as 'a) * bool t
but a pattern was expected which matches values of type 'a * int t
# module Propagation :
@@ -145,7 +145,7 @@ val f : 'a h -> 'a = <fun>
val f : 'a j -> 'a = <fun>
# type (_, _) eq = Eq : ('a, 'a) eq
# Characters 5-91:
- ....f : type a b. (a,b) eq -> (<m : a; ..> as 'a) -> (<m : b; ..> as 'a) =
+ ....f : type a b. (a,b) eq -> (<m : a; ..> as 'c) -> (<m : b; ..> as 'c) =
fun Eq o -> o
Error: The universal type variable 'b cannot be generalized:
it is already bound to another variable.
@@ -290,4 +290,7 @@ Error: This expression has type < bar : int; foo : int; .. > as 'a
The type constructor ex#25 would escape its scope
# val g : 'a -> 'a int_foo -> 'a int_bar -> 'a = <fun>
# val g : 'a -> 'a int_foo -> 'a int_bar -> 'a * int * int = <fun>
+# type 'a ty = Int : int -> int ty
+# val f : 'a ty -> 'a = <fun>
+# val g : 'a ty -> 'a = <fun>
#
diff --git a/testsuite/tests/typing-implicit_unpack/Makefile b/testsuite/tests/typing-implicit_unpack/Makefile
index 5f42b70577..9625a3fbc3 100644
--- a/testsuite/tests/typing-implicit_unpack/Makefile
+++ b/testsuite/tests/typing-implicit_unpack/Makefile
@@ -1,4 +1,3 @@
BASEDIR=../..
include $(BASEDIR)/makefiles/Makefile.toplevel
include $(BASEDIR)/makefiles/Makefile.common
-
diff --git a/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml b/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml
index 3910059fe2..82fca3a5d0 100644
--- a/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml
+++ b/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml
@@ -152,7 +152,7 @@ let ssmap =
let ssmap =
(let module S = struct include SSMap end in (module S) :
- (module
+ (module
MapT with type key = string and type data = string and type map = SSMap.map))
;;
diff --git a/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml.reference b/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml.reference
index 0291292bf7..32c49a2961 100644
--- a/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml.reference
+++ b/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml.reference
@@ -146,15 +146,15 @@ module SSMap :
val to_t : 'a -> 'a
end
val ssmap :
- (module MapT with type data = SSMap.data and type key = SSMap.key and type map =
+ (module MapT with type data = string and type key = string and type map =
SSMap.map) =
<module>
# val ssmap :
- (module MapT with type data = SSMap.data and type key = String.t and type map =
+ (module MapT with type data = string and type key = string and type map =
SSMap.map) =
<module>
# val ssmap :
- (module MapT with type data = SSMap.data and type key = String.t and type map =
+ (module MapT with type data = string and type key = string and type map =
SSMap.map) =
<module>
# val ssmap :
diff --git a/testsuite/tests/typing-modules-bugs/pr5164_ok.ml b/testsuite/tests/typing-modules-bugs/pr5164_ok.ml
index 7de770ed6a..5a59808ef4 100644
--- a/testsuite/tests/typing-modules-bugs/pr5164_ok.ml
+++ b/testsuite/tests/typing-modules-bugs/pr5164_ok.ml
@@ -1,7 +1,7 @@
module type INCLUDING = sig
include module type of List
include module type of ListLabels
-end
+end
module Including_typed: INCLUDING = struct
include List
diff --git a/testsuite/tests/typing-modules/Makefile b/testsuite/tests/typing-modules/Makefile
index 9add15574f..145025ba05 100644
--- a/testsuite/tests/typing-modules/Makefile
+++ b/testsuite/tests/typing-modules/Makefile
@@ -1,3 +1,2 @@
include ../../makefiles/Makefile.toplevel
include ../../makefiles/Makefile.common
-
diff --git a/testsuite/tests/typing-modules/Test.ml b/testsuite/tests/typing-modules/Test.ml
index 97a9f739c8..03505cb269 100644
--- a/testsuite/tests/typing-modules/Test.ml
+++ b/testsuite/tests/typing-modules/Test.ml
@@ -1,4 +1,4 @@
-(* Destructive substitutions *)
+(* with module *)
module type S = sig type t and s = t end;;
module type S' = S with type t := int;;
@@ -6,12 +6,39 @@ module type S' = S with type t := int;;
module type S = sig module rec M : sig end and N : sig end end;;
module type S' = S with module M := String;;
+(* with module type *)
+(*
+module type S = sig module type T module F(X:T) : T end;;
+module type T0 = sig type t end;;
+module type S1 = S with module type T = T0;;
+module type S2 = S with module type T := T0;;
+module type S3 = S with module type T := sig type t = int end;;
+module H = struct
+ include (Hashtbl : module type of Hashtbl with
+ type statistics := Hashtbl.statistics
+ and module type S := Hashtbl.S
+ and module Make := Hashtbl.Make
+ and module MakeSeeded := Hashtbl.MakeSeeded
+ and module type SeededS := Hashtbl.SeededS
+ and module type HashedType := Hashtbl.HashedType
+ and module type SeededHashedType := Hashtbl.SeededHashedType)
+end;;
+*)
+
(* A subtle problem appearing with -principal *)
type -'a t
class type c = object method m : [ `A ] t end;;
module M : sig val v : (#c as 'a) -> 'a end =
struct let v x = ignore (x :> c); x end;;
+(* PR#4838 *)
+
+let id = let module M = struct end in fun x -> x;;
+
+(* PR#4511 *)
+
+let ko = let module M = struct end in fun _ -> ();;
+
(* Path shortening *)
module Int = struct type t = int let compare : int -> int -> int = compare end;;
diff --git a/testsuite/tests/typing-modules/Test.ml.principal.reference b/testsuite/tests/typing-modules/Test.ml.principal.reference
index 258b3ee3de..013b844b56 100644
--- a/testsuite/tests/typing-modules/Test.ml.principal.reference
+++ b/testsuite/tests/typing-modules/Test.ml.principal.reference
@@ -1,9 +1,37 @@
-# module type S = sig type t and s = t end
+# module type S = sig type t and s = t end
# module type S' = sig type s = int end
# module type S = sig module rec M : sig end and N : sig end end
# module type S' = sig module rec N : sig end end
-# type -'a t
+# * * * * * * * * * * * * * * * * type -'a t
class type c = object method m : [ `A ] t end
# module M : sig val v : (#c as 'a) -> 'a end
+# val id : 'a -> 'a = <fun>
+# val ko : 'a -> unit = <fun>
+# module Int : sig type t = int val compare : t -> t -> t end
+# val f : int -> int = <fun>
+# Characters 3-7:
+ f true;;
+ ^^^^
+Error: This expression has type bool but an expression was expected of type
+ int
+# type 'a u constraint 'a = bool
+# Characters 11-16:
+ let f (x : Int.t u) = ();;
+ ^^^^^
+Error: This type Int.t = int should be an instance of type bool
+# Characters 30-40:
+ let f (x : (Int.t as 'a) -> (bool as 'a)) = ();;
+ ^^^^^^^^^^
+Error: This alias is bound to type bool but is used as an instance of type
+ Int.t = int
+# Characters 11-16:
+ type t = [Int.t | `A];;
+ ^^^^^
+Error: The type Int.t is not a polymorphic variant type
+# Characters 10-36:
+ type t = [`A of Int.t | `A of bool];;
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
+Error: This variant type contains a constructor [ `A of bool ]
+ which should be [ `A of int ]
#
diff --git a/testsuite/tests/typing-modules/Test.ml.reference b/testsuite/tests/typing-modules/Test.ml.reference
index 258b3ee3de..013b844b56 100644
--- a/testsuite/tests/typing-modules/Test.ml.reference
+++ b/testsuite/tests/typing-modules/Test.ml.reference
@@ -1,9 +1,37 @@
-# module type S = sig type t and s = t end
+# module type S = sig type t and s = t end
# module type S' = sig type s = int end
# module type S = sig module rec M : sig end and N : sig end end
# module type S' = sig module rec N : sig end end
-# type -'a t
+# * * * * * * * * * * * * * * * * type -'a t
class type c = object method m : [ `A ] t end
# module M : sig val v : (#c as 'a) -> 'a end
+# val id : 'a -> 'a = <fun>
+# val ko : 'a -> unit = <fun>
+# module Int : sig type t = int val compare : t -> t -> t end
+# val f : int -> int = <fun>
+# Characters 3-7:
+ f true;;
+ ^^^^
+Error: This expression has type bool but an expression was expected of type
+ int
+# type 'a u constraint 'a = bool
+# Characters 11-16:
+ let f (x : Int.t u) = ();;
+ ^^^^^
+Error: This type Int.t = int should be an instance of type bool
+# Characters 30-40:
+ let f (x : (Int.t as 'a) -> (bool as 'a)) = ();;
+ ^^^^^^^^^^
+Error: This alias is bound to type bool but is used as an instance of type
+ Int.t = int
+# Characters 11-16:
+ type t = [Int.t | `A];;
+ ^^^^^
+Error: The type Int.t is not a polymorphic variant type
+# Characters 10-36:
+ type t = [`A of Int.t | `A of bool];;
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
+Error: This variant type contains a constructor [ `A of bool ]
+ which should be [ `A of int ]
#
diff --git a/testsuite/tests/typing-objects-bugs/pr3968_bad.ml b/testsuite/tests/typing-objects-bugs/pr3968_bad.ml
index 3d393120a2..01c5066654 100644
--- a/testsuite/tests/typing-objects-bugs/pr3968_bad.ml
+++ b/testsuite/tests/typing-objects-bugs/pr3968_bad.ml
@@ -1,18 +1,18 @@
-type expr =
+type expr =
[ `Abs of string * expr
| `App of expr * expr
]
-class type exp =
+class type exp =
object
method eval : (string, exp) Hashtbl.t -> expr
end;;
-class app e1 e2 : exp =
+class app e1 e2 : exp =
object
- val l = e1
+ val l = e1
val r = e2
- method eval env =
+ method eval env =
match l with
| `Abs(var,body) ->
Hashtbl.add env var r;
diff --git a/testsuite/tests/typing-objects-bugs/pr4018_bad.ml b/testsuite/tests/typing-objects-bugs/pr4018_bad.ml
index 90ee787861..5195d46397 100644
--- a/testsuite/tests/typing-objects-bugs/pr4018_bad.ml
+++ b/testsuite/tests/typing-objects-bugs/pr4018_bad.ml
@@ -8,7 +8,7 @@ class ['event] subject =
object (self : 'subject)
val mutable observers = ([]: (('subject, 'event) observer) list)
method add_observer obs = observers <- (obs :: observers)
- method notify_observers (e : 'event) =
+ method notify_observers (e : 'event) =
List.iter (fun x -> x#notify self e) observers
end
diff --git a/testsuite/tests/typing-objects-bugs/pr4766_ok.ml b/testsuite/tests/typing-objects-bugs/pr4766_ok.ml
index c5809c1d93..726cc86669 100644
--- a/testsuite/tests/typing-objects-bugs/pr4766_ok.ml
+++ b/testsuite/tests/typing-objects-bugs/pr4766_ok.ml
@@ -1,9 +1,9 @@
-class virtual ['a] c =
-object (s : 'a)
- method virtual m : 'b
+class virtual ['a] c =
+object (s : 'a)
+ method virtual m : 'b
end
-let o =
+let o =
object (s :'a)
inherit ['a] c
method m = 42
diff --git a/testsuite/tests/typing-objects-bugs/yamagata021012_ok.ml b/testsuite/tests/typing-objects-bugs/yamagata021012_ok.ml
index 212a1683fa..fda0d123ce 100644
--- a/testsuite/tests/typing-objects-bugs/yamagata021012_ok.ml
+++ b/testsuite/tests/typing-objects-bugs/yamagata021012_ok.ml
@@ -31,9 +31,9 @@ class virtual ['a, 'cursor] storage_base =
method fold : 'b. ('a -> int -> 'b -> 'b) -> 'b -> 'b = fun f a0 ->
let cur = self#first in
let rec loop count a =
- if count >= self#len then a else
- let a' = f cur#get count a in
- cur#incr (); loop (count + 1) a'
+ if count >= self#len then a else
+ let a' = f cur#get count a in
+ cur#incr (); loop (count + 1) a'
in
loop 0 a0
method iter proc =
@@ -63,7 +63,7 @@ struct
let highest_bit = 1 lsl 30
let lower_bits = highest_bit - 1
- let char_of c =
+ let char_of c =
try Char.chr c with Invalid_argument _ -> raise Out_of_range
let of_char = Char.code
@@ -129,7 +129,7 @@ class text_raw buf =
object (self : 'self)
inherit [cursor] ustorage_base
val contents = buf
- method first = new cursor (self :> text_raw) 0
+ method first = new cursor (self :> text_raw) 0
method len = (String.length contents) / 4
method get i = get_buf contents (4 * i)
method nth i = new cursor (self :> text_raw) i
diff --git a/testsuite/tests/typing-objects/Exemples.ml b/testsuite/tests/typing-objects/Exemples.ml
index 212396cd19..ba3e64f011 100644
--- a/testsuite/tests/typing-objects/Exemples.ml
+++ b/testsuite/tests/typing-objects/Exemples.ml
@@ -216,7 +216,7 @@ end;;
let c3 = new int_comparable3 15;;
l#add (c3 :> int_comparable);;
-(new sorted_list ())#add c3;; (* Echec : leq n'est pas binaire *)
+(new sorted_list ())#add c3;; (* Error; strange message with -principal *)
let sort (l : #comparable list) = Sort.list (fun x -> x#leq) l;;
let pr l =
diff --git a/testsuite/tests/typing-objects/Exemples.ml.principal.reference b/testsuite/tests/typing-objects/Exemples.ml.principal.reference
new file mode 100644
index 0000000000..d6f9d6df18
--- /dev/null
+++ b/testsuite/tests/typing-objects/Exemples.ml.principal.reference
@@ -0,0 +1,358 @@
+
+# class point :
+ int ->
+ object val mutable x : int method get_x : int method move : int -> unit end
+# val p : point = <obj>
+# - : int = 7
+# - : unit = ()
+# - : int = 10
+# val q : < get_x : int; move : int -> unit > = <obj>
+# - : int * int = (10, 17)
+# class color_point :
+ int ->
+ string ->
+ object
+ val c : string
+ val mutable x : int
+ method color : string
+ method get_x : int
+ method move : int -> unit
+ end
+# val p' : color_point = <obj>
+# - : int * string = (5, "red")
+# val l : point list = [<obj>; <obj>]
+# val get_x : < get_x : 'a; .. > -> 'a = <fun>
+# val set_x : < set_x : 'a; .. > -> 'a = <fun>
+# - : int list = [10; 5]
+# Characters 7-96:
+ ......ref x_init = object
+ val mutable x = x_init
+ method get = x
+ method set y = x <- y
+ end..
+Error: Some type variables are unbound in this type:
+ class ref :
+ 'a ->
+ object
+ val mutable x : 'a
+ method get : 'a
+ method set : 'a -> unit
+ end
+ The method get has type 'a where 'a is unbound
+# class ref :
+ int ->
+ object val mutable x : int method get : int method set : int -> unit end
+# class ['a] ref :
+ 'a -> object val mutable x : 'a method get : 'a method set : 'a -> unit end
+# - : int = 2
+# class ['a] circle :
+ 'a ->
+ object
+ constraint 'a = < move : int -> unit; .. >
+ val mutable center : 'a
+ method center : 'a
+ method move : int -> unit
+ method set_center : 'a -> unit
+ end
+# class ['a] circle :
+ 'a ->
+ object
+ constraint 'a = #point
+ val mutable center : 'a
+ method center : 'a
+ method move : int -> unit
+ method set_center : 'a -> unit
+ end
+# val c : point circle = <obj>
+val c' : < color : string; get_x : int; move : int -> unit > circle = <obj>
+# class ['a] color_circle :
+ 'a ->
+ object
+ constraint 'a = #color_point
+ val mutable center : 'a
+ method center : 'a
+ method color : string
+ method move : int -> unit
+ method set_center : 'a -> unit
+ end
+# Characters 28-29:
+ let c'' = new color_circle p;;
+ ^
+Error: This expression has type point but an expression was expected of type
+ #color_point
+ The first object type has no method color
+# val c'' : color_point color_circle = <obj>
+# - : color_point circle = <obj>
+# Characters 0-21:
+ (c'' :> point circle);; (* Echec *)
+ ^^^^^^^^^^^^^^^^^^^^^
+Error: Type
+ color_point color_circle =
+ < center : color_point; color : string; move : int -> unit;
+ set_center : color_point -> unit >
+ is not a subtype of
+ point circle =
+ < center : point; move : int -> unit; set_center : point -> unit >
+Type point = point is not a subtype of color_point = color_point
+# Characters 9-55:
+ fun x -> (x : color_point color_circle :> point circle);;
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Error: Type
+ color_point color_circle =
+ < center : color_point; color : string; move : int -> unit;
+ set_center : color_point -> unit >
+ is not a subtype of
+ point circle =
+ < center : point; move : int -> unit; set_center : point -> unit >
+Type point = point is not a subtype of color_point = color_point
+# class printable_point :
+ int ->
+ object
+ val mutable x : int
+ method get_x : int
+ method move : int -> unit
+ method print : unit
+ end
+# val p : printable_point = <obj>
+# 7- : unit = ()
+# Characters 85-102:
+ inherit printable_point y as super
+ ^^^^^^^^^^^^^^^^^
+Warning 13: the following instance variables are overridden by the class printable_point :
+ x
+The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
+class printable_color_point :
+ int ->
+ string ->
+ object
+ val c : string
+ val mutable x : int
+ method color : string
+ method get_x : int
+ method move : int -> unit
+ method print : unit
+ end
+# val p' : printable_color_point = <obj>
+# (7, red)- : unit = ()
+# class functional_point :
+ int ->
+ object ('a) val x : int method get_x : int method move : int -> 'a end
+# val p : functional_point = <obj>
+# - : int = 7
+# - : int = 10
+# - : int = 7
+# - : #functional_point -> functional_point = <fun>
+# class virtual ['a] lst :
+ unit ->
+ object
+ method virtual hd : 'a
+ method iter : ('a -> unit) -> unit
+ method map : ('a -> 'a) -> 'a lst
+ method virtual null : bool
+ method print : ('a -> unit) -> unit
+ method virtual tl : 'a lst
+ end
+and ['a] nil :
+ unit ->
+ object
+ method hd : 'a
+ method iter : ('a -> unit) -> unit
+ method map : ('a -> 'a) -> 'a lst
+ method null : bool
+ method print : ('a -> unit) -> unit
+ method tl : 'a lst
+ end
+and ['a] cons :
+ 'a ->
+ 'a lst ->
+ object
+ val h : 'a
+ val t : 'a lst
+ method hd : 'a
+ method iter : ('a -> unit) -> unit
+ method map : ('a -> 'a) -> 'a lst
+ method null : bool
+ method print : ('a -> unit) -> unit
+ method tl : 'a lst
+ end
+# val l1 : int lst = <obj>
+# (3::10::[])- : unit = ()
+# val l2 : int lst = <obj>
+# (4::11::[])- : unit = ()
+# val map_list : ('a -> 'b) -> 'a lst -> 'b lst = <fun>
+# val p1 : printable_color_point lst = <obj>
+# ((3, red)::(10, red)::[])- : unit = ()
+# class virtual comparable :
+ unit -> object ('a) method virtual leq : 'a -> bool end
+# class int_comparable :
+ int -> object ('a) val x : int method leq : 'a -> bool method x : int end
+# class int_comparable2 :
+ int ->
+ object ('a)
+ val x : int
+ val mutable x' : int
+ method leq : 'a -> bool
+ method set_x : int -> unit
+ method x : int
+ end
+# class ['a] sorted_list :
+ unit ->
+ object
+ constraint 'a = #comparable
+ val mutable l : 'a list
+ method add : 'a -> unit
+ method hd : 'a
+ end
+# val l : _#comparable sorted_list = <obj>
+# val c : int_comparable = <obj>
+# - : unit = ()
+# val c2 : int_comparable2 = <obj>
+# Characters 6-28:
+ l#add (c2 :> int_comparable);; (* Echec : 'a comp2 n'est un sous-type *)
+ ^^^^^^^^^^^^^^^^^^^^^^
+Error: Type
+ int_comparable2 =
+ < leq : int_comparable2 -> bool; set_x : int -> unit; x : int >
+ is not a subtype of
+ int_comparable = < leq : int_comparable -> bool; x : int >
+Type int_comparable = < leq : int_comparable -> bool; x : int >
+is not a subtype of
+ int_comparable2 =
+ < leq : int_comparable2 -> bool; set_x : int -> unit; x : int >
+# - : unit = ()
+# class int_comparable3 :
+ int ->
+ object
+ val mutable x : int
+ method leq : int_comparable -> bool
+ method setx : int -> unit
+ method x : int
+ end
+# val c3 : int_comparable3 = <obj>
+# - : unit = ()
+# Characters 25-27:
+ (new sorted_list ())#add c3;; (* Error; strange message with -principal *)
+ ^^
+Error: This expression has type
+ int_comparable3 =
+ < leq : int_comparable -> bool; setx : int -> unit; x : int >
+ but an expression was expected of type
+ #comparable as 'a = < leq : 'a -> bool; .. >
+ Type int_comparable = < leq : int_comparable -> bool; x : int >
+ is not compatible with type 'a = < leq : 'a -> bool; .. >
+ The first object type has no method setx
+# val sort : (#comparable as 'a) list -> 'a list = <fun>
+# Characters 13-66:
+ List.map (fun c -> print_int c#x; print_string " ") l;
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Warning 10: this expression should have type unit.
+val pr : < x : int; .. > list -> unit = <fun>
+# val l : int_comparable list = [<obj>; <obj>; <obj>]
+# 5 2 4
+- : unit = ()
+# 2 4 5
+- : unit = ()
+# val l : int_comparable2 list = [<obj>; <obj>]
+# 2 0
+- : unit = ()
+# 0 2
+- : unit = ()
+# val min : (#comparable as 'a) -> 'a -> 'a = <fun>
+# - : int = 7
+# - : int = 3
+# class ['a] link :
+ 'a ->
+ object ('b)
+ val mutable next : 'b option
+ val mutable x : 'a
+ method append : 'b option -> unit
+ method next : 'b option
+ method set_next : 'b option -> unit
+ method set_x : 'a -> unit
+ method x : 'a
+ end
+# class ['a] double_link :
+ 'a ->
+ object ('b)
+ val mutable next : 'b option
+ val mutable prev : 'b option
+ val mutable x : 'a
+ method append : 'b option -> unit
+ method next : 'b option
+ method prev : 'b option
+ method set_next : 'b option -> unit
+ method set_prev : 'b option -> unit
+ method set_x : 'a -> unit
+ method x : 'a
+ end
+# val fold_right : ('a -> 'b -> 'b) -> 'a #link option -> 'b -> 'b = <fun>
+# class calculator :
+ unit ->
+ object ('a)
+ val mutable acc : float
+ val mutable arg : float
+ val mutable equals : 'a -> float
+ method acc : float
+ method add : 'a
+ method arg : float
+ method enter : float -> 'a
+ method equals : float
+ method sub : 'a
+ end
+# - : float = 5.
+# - : float = 1.5
+# - : float = 15.
+# class calculator :
+ unit ->
+ object ('a)
+ val mutable acc : float
+ val mutable arg : float
+ val mutable equals : 'a -> float
+ method acc : float
+ method add : 'a
+ method arg : float
+ method enter : float -> 'a
+ method equals : float
+ method sub : 'a
+ end
+# - : float = 5.
+# - : float = 1.5
+# - : float = 15.
+# class calculator :
+ float ->
+ float ->
+ object
+ val acc : float
+ val arg : float
+ method add : calculator
+ method enter : float -> calculator
+ method equals : float
+ method sub : calculator
+ end
+and calculator_add :
+ float ->
+ float ->
+ object
+ val acc : float
+ val arg : float
+ method add : calculator
+ method enter : float -> calculator
+ method equals : float
+ method sub : calculator
+ end
+and calculator_sub :
+ float ->
+ float ->
+ object
+ val acc : float
+ val arg : float
+ method add : calculator
+ method enter : float -> calculator
+ method equals : float
+ method sub : calculator
+ end
+# val calculator : calculator = <obj>
+# - : float = 5.
+# - : float = 1.5
+# - : float = 15.
+#
diff --git a/testsuite/tests/typing-objects/Exemples.ml.reference b/testsuite/tests/typing-objects/Exemples.ml.reference
index 6be5b69483..128d1be70d 100644
--- a/testsuite/tests/typing-objects/Exemples.ml.reference
+++ b/testsuite/tests/typing-objects/Exemples.ml.reference
@@ -231,7 +231,7 @@ is not a subtype of
# val c3 : int_comparable3 = <obj>
# - : unit = ()
# Characters 25-27:
- (new sorted_list ())#add c3;; (* Echec : leq n'est pas binaire *)
+ (new sorted_list ())#add c3;; (* Error; strange message with -principal *)
^^
Error: This expression has type
int_comparable3 =
diff --git a/testsuite/tests/typing-objects/Makefile b/testsuite/tests/typing-objects/Makefile
index 5f42b70577..9625a3fbc3 100644
--- a/testsuite/tests/typing-objects/Makefile
+++ b/testsuite/tests/typing-objects/Makefile
@@ -1,4 +1,3 @@
BASEDIR=../..
include $(BASEDIR)/makefiles/Makefile.toplevel
include $(BASEDIR)/makefiles/Makefile.common
-
diff --git a/testsuite/tests/typing-objects/Tests.ml b/testsuite/tests/typing-objects/Tests.ml
index c7a5cb3d16..15bef7f9e5 100644
--- a/testsuite/tests/typing-objects/Tests.ml
+++ b/testsuite/tests/typing-objects/Tests.ml
@@ -159,7 +159,7 @@ e#f, e#g, e#h, e#i, e#j;;
class c a = object val x = 1 val y = 1 val z = 1 val a = a end;;
class d b = object val z = 2 val t = 2 val u = 2 val b = b end;;
-class e () = object
+class e () = object
val x = 3
inherit c 5
val y = 3
diff --git a/testsuite/tests/typing-objects/Tests.ml.principal.reference b/testsuite/tests/typing-objects/Tests.ml.principal.reference
new file mode 100644
index 0000000000..a194f7d0f8
--- /dev/null
+++ b/testsuite/tests/typing-objects/Tests.ml.principal.reference
@@ -0,0 +1,302 @@
+
+# - : < x : int > ->
+ < x : int > -> < x : int > -> < x : int > * < x : int > * < x : int >
+= <fun>
+# class ['a] c : unit -> object constraint 'a = int method f : int c end
+and ['a] d : unit -> object constraint 'a = int method f : int c end
+# Characters 238-275:
+ ........d () = object
+ inherit ['a] c ()
+ end..
+Error: Some type variables are unbound in this type:
+ class d : unit -> object method f : 'a -> unit end
+ The method f has type 'a -> unit where 'a is unbound
+# class virtual c : unit -> object end
+and ['a] d :
+ unit -> object constraint 'a = < x : int; .. > method f : 'a -> int end
+# class ['a] c : unit -> object constraint 'a = int end
+and ['a] d : unit -> object constraint 'a = int #c end
+# * class ['a] c :
+ 'a -> object ('a) constraint 'a = < f : 'a; .. > method f : 'a end
+# - : ('a c as 'a) -> 'a = <fun>
+# * Characters 134-176:
+ ......x () = object
+ method virtual f : int
+ end..
+Error: This class should be virtual. The following methods are undefined : f
+# Characters 139-147:
+ class virtual c ((x : 'a): < f : int >) = object (_ : 'a) end
+ ^^^^^^^^
+Error: This pattern cannot match self: it only matches values of type
+ < f : int >
+# Characters 38-110:
+ ......['a] c () = object
+ constraint 'a = int
+ method f x = (x : bool c)
+ end..
+Error: The abbreviation c is used with parameters bool c
+ wich are incompatible with constraints int c
+# class ['a, 'b] c :
+ unit ->
+ object
+ constraint 'a = int -> 'c
+ constraint 'b = 'a * < x : 'b > * 'c * 'd
+ method f : 'a -> 'b -> unit
+ end
+# class ['a, 'b] d :
+ unit ->
+ object
+ constraint 'a = int -> 'c
+ constraint 'b = 'a * < x : 'b > * 'c * 'd
+ method f : 'a -> 'b -> unit
+ end
+# val x : '_a list ref = {contents = []}
+# Characters 6-50:
+ ......['a] c () = object
+ method f = (x : 'a)
+ end..
+Error: The type of this class,
+ class ['a] c :
+ unit -> object constraint 'a = '_b list ref method f : 'a end,
+ contains type variables that cannot be generalized
+# Characters 24-52:
+ type 'a c = <f : 'a c; g : 'a d>
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Error: In the definition of d, type int c should be 'a c
+# type 'a c = < f : 'a c; g : 'a d >
+and 'a d = < f : 'a c >
+# type 'a c = < f : 'a c >
+and 'a d = < f : int c >
+# type 'a u = < x : 'a >
+and 'a t = 'a t u
+# Characters 18-32:
+ and 'a t = 'a t u;;
+ ^^^^^^^^^^^^^^
+Error: The type abbreviation t is cyclic
+# type 'a u = 'a
+# Characters 5-18:
+ type t = t u * t u;;
+ ^^^^^^^^^^^^^
+Error: The type abbreviation t is cyclic
+# type t = < x : 'a > as 'a
+# type 'a u = 'a
+# - : t -> t u -> bool = <fun>
+# - : t -> t u -> bool = <fun>
+# module M :
+ sig
+ class ['a, 'b] c :
+ int ->
+ 'b ->
+ object
+ constraint 'a = int -> bool
+ val x : float list
+ val y : 'b
+ method f : 'a -> unit
+ method g : 'b
+ end
+ end
+# module M' :
+ sig
+ class virtual ['a, 'b] c :
+ int ->
+ 'b ->
+ object
+ constraint 'a = int -> bool
+ val x : float list
+ val y : 'b
+ method f : 'a -> unit
+ method g : 'b
+ end
+ end
+# class ['a, 'b] d :
+ unit ->
+ 'b ->
+ object
+ constraint 'a = int -> bool
+ val x : float list
+ val y : 'b
+ method f : 'a -> unit
+ method g : 'b
+ end
+# class ['a, 'b] e :
+ unit ->
+ 'b ->
+ object
+ constraint 'a = int -> bool
+ val x : float list
+ val y : 'b
+ method f : 'a -> unit
+ method g : 'b
+ end
+# - : string = "a"
+# - : int = 10
+# - : float = 7.1
+# # - : bool = true
+# module M : sig class ['a] c : unit -> object method f : 'a -> unit end end
+# module M' : sig class ['a] c : unit -> object method f : 'a -> unit end end
+# - : ('a #M.c as 'b) -> 'b = <fun>
+# - : ('a #M'.c as 'b) -> 'b = <fun>
+# class ['a] c : 'a #c -> object end
+# class ['a] c : 'a #c -> object end
+# class c : unit -> object method f : int end
+and d : unit -> object method f : int end
+# class e : unit -> object method f : int end
+# - : int = 2
+# Characters 30-34:
+ class c () = object val x = - true val y = -. () end;;
+ ^^^^
+Error: This expression has type bool but an expression was expected of type
+ int
+# class c : unit -> object method f : int method g : int method h : int end
+# class d : unit -> object method h : int method i : int method j : int end
+# class e :
+ unit ->
+ object
+ method f : int
+ method g : int
+ method h : int
+ method i : int
+ method j : int
+ end
+# val e : e = <obj>
+# - : int * int * int * int * int = (1, 3, 2, 2, 3)
+# class c : 'a -> object val a : 'a val x : int val y : int val z : int end
+# class d : 'a -> object val b : 'a val t : int val u : int val z : int end
+# Characters 42-45:
+ inherit c 5
+ ^^^
+Warning 13: the following instance variables are overridden by the class c :
+ x
+The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
+Characters 52-53:
+ val y = 3
+ ^
+Warning 13: the instance variable y is overridden.
+The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
+Characters 80-83:
+ inherit d 7
+ ^^^
+Warning 13: the following instance variables are overridden by the class d :
+ t z
+The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
+Characters 90-91:
+ val u = 3
+ ^
+Warning 13: the instance variable u is overridden.
+The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
+class e :
+ unit ->
+ object
+ val a : int
+ val b : int
+ val t : int
+ val u : int
+ val x : int
+ val y : int
+ val z : int
+ method a : int
+ method b : int
+ method t : int
+ method u : int
+ method x : int
+ method y : int
+ method z : int
+ end
+# val e : e = <obj>
+# - : int * int * int * int * int * int * int = (1, 3, 2, 2, 3, 5, 7)
+# class c :
+ int ->
+ int -> object val x : int val y : int method x : int method y : int end
+# class d :
+ int ->
+ int -> object val x : int val y : int method x : int method y : int end
+# - : int * int = (1, 2)
+# - : int * int = (1, 2)
+# class ['a] c : 'a -> object end
+# - : 'a -> 'a c = <fun>
+# * * * * * * * * * * * * * * * * * * * * * module M : sig class c : unit -> object method xc : int end end
+# class d : unit -> object val x : int method xc : int method xd : int end
+# - : int * int = (1, 2)
+# Characters 7-156:
+ ......virtual ['a] matrix (sz, init : int * 'a) = object
+ val m = Array.create_matrix sz sz init
+ method add (mtx : 'a matrix) = (mtx#m.(0).(0) : 'a)
+ end..
+Error: The abbreviation 'a matrix expands to type < add : 'a matrix -> 'a >
+ but is used with type < m : 'a array array; .. >
+# class c : unit -> object method m : c end
+# - : c = <obj>
+# module M : sig class c : unit -> object method m : c end end
+# - : M.c = <obj>
+# type uu = A of int | B of (< leq : 'a > as 'a)
+# class virtual c : unit -> object ('a) method virtual m : 'a end
+# module S : sig val f : (#c as 'a) -> 'a end
+# Characters 12-43:
+ ............struct
+ let f (x : #c) = x
+ end......
+Error: Signature mismatch:
+ Modules do not match:
+ sig val f : (#c as 'a) -> 'a end
+ is not included in
+ sig val f : #c -> #c end
+ Values do not match:
+ val f : (#c as 'a) -> 'a
+ is not included in
+ val f : #c -> #c
+# Characters 32-55:
+ module M = struct type t = int class t () = object end end;;
+ ^^^^^^^^^^^^^^^^^^^^^^^
+Error: Multiple definition of the type name t.
+ Names must be unique in a given structure or signature.
+# - : < m : (< m : 'a > as 'b) -> 'b as 'a; .. > -> 'b = <fun>
+# Characters 10-39:
+ fun x -> (x : int -> bool :> 'a -> 'a);;
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Error: Type int -> bool is not a subtype of int -> int
+# Characters 9-40:
+ fun x -> (x : int -> bool :> int -> int);;
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Error: Type int -> bool is not a subtype of int -> int
+# - : < > -> < > = <fun>
+# - : < .. > -> < > = <fun>
+# val x : '_a list ref = {contents = []}
+# module F : functor (X : sig end) -> sig type t = int end
+# - : < m : int > list ref = {contents = []}
+# type 'a t
+# Characters 9-19:
+ fun (x : 'a t as 'a) -> ();;
+ ^^^^^^^^^^
+Error: This alias is bound to type 'a t but is used as an instance of type 'a
+ The type variable 'a occurs inside 'a t
+# Characters 19-20:
+ fun (x : 'a t) -> (x : 'a); ();;
+ ^
+Error: This expression has type 'a t but an expression was expected of type
+ 'a
+ The type variable 'a occurs inside 'a t
+# type 'a t = < x : 'a >
+# - : ('a t as 'a) -> unit = <fun>
+# Characters 18-26:
+ fun (x : 'a t) -> (x : 'a); ();;
+ ^^^^^^^^
+Warning 10: this expression should have type unit.
+- : ('a t as 'a) t -> unit = <fun>
+# class ['a] c :
+ unit ->
+ object constraint 'a = (< .. > as 'b) -> unit method m : 'b -> unit end
+# class ['a] c :
+ unit ->
+ object constraint 'a = unit -> (< .. > as 'b) method m : 'a -> 'b end
+# class c : unit -> object method private m : int method n : int end
+# class d :
+ unit -> object method private m : int method n : int method o : int end
+# - : int * int = (1, 1)
+# class c : unit -> object method m : int end
+# - : int = 15
+# - : int = 16
+# - : int = 17
+# - : int * int * int = (18, 19, 20)
+# - : int * int * int * int * int = (21, 22, 23, 33, 33)
+# - : int * int * int * int * int = (24, 25, 26, 33, 33)
+#
diff --git a/testsuite/tests/typing-objects/Tests.ml.reference b/testsuite/tests/typing-objects/Tests.ml.reference
index 4df2316922..d5d0bea437 100644
--- a/testsuite/tests/typing-objects/Tests.ml.reference
+++ b/testsuite/tests/typing-objects/Tests.ml.reference
@@ -162,26 +162,26 @@ Error: This expression has type bool but an expression was expected of type
# - : int * int * int * int * int = (1, 3, 2, 2, 3)
# class c : 'a -> object val a : 'a val x : int val y : int val z : int end
# class d : 'a -> object val b : 'a val t : int val u : int val z : int end
-# Characters 43-46:
+# Characters 42-45:
inherit c 5
^^^
Warning 13: the following instance variables are overridden by the class c :
x
The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
-Characters 53-58:
+Characters 52-53:
val y = 3
- ^^^^^
+ ^
Warning 13: the instance variable y is overridden.
The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
-Characters 81-84:
+Characters 80-83:
inherit d 7
^^^
Warning 13: the following instance variables are overridden by the class d :
t z
The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
-Characters 91-96:
+Characters 90-91:
val u = 3
- ^^^^^
+ ^
Warning 13: the instance variable u is overridden.
The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
class e :
@@ -281,7 +281,7 @@ Error: This expression has type 'a t but an expression was expected of type
fun (x : 'a t) -> (x : 'a); ();;
^^^^^^^^
Warning 10: this expression should have type unit.
-- : ('a t as 'a) -> unit = <fun>
+- : ('a t as 'a) t -> unit = <fun>
# class ['a] c :
unit -> object constraint 'a = (< .. > as 'b) -> unit method m : 'a end
# class ['a] c :
diff --git a/testsuite/tests/typing-objects/pr5619_bad.ml b/testsuite/tests/typing-objects/pr5619_bad.ml
new file mode 100644
index 0000000000..2dd3eaaa59
--- /dev/null
+++ b/testsuite/tests/typing-objects/pr5619_bad.ml
@@ -0,0 +1,29 @@
+class type foo_t =
+ object
+ method foo: string
+ end
+
+type 'a name =
+ Foo: foo_t name
+ | Int: int name
+;;
+
+class foo =
+ object(self)
+ method foo = "foo"
+ method cast =
+ function
+ Foo -> (self :> <foo : string>)
+ | _ -> raise Exit
+ end
+;;
+
+class foo: foo_t =
+ object(self)
+ method foo = "foo"
+ method cast: type a. a name -> a =
+ function
+ Foo -> (self :> foo_t)
+ | _ -> ((raise Exit) : a)
+ end
+;;
diff --git a/testsuite/tests/typing-objects/pr5619_bad.ml.principal.reference b/testsuite/tests/typing-objects/pr5619_bad.ml.principal.reference
new file mode 100644
index 0000000000..48777229ce
--- /dev/null
+++ b/testsuite/tests/typing-objects/pr5619_bad.ml.principal.reference
@@ -0,0 +1,18 @@
+
+# class type foo_t = object method foo : string end
+type 'a name = Foo : foo_t name | Int : int name
+# class foo :
+ object method cast : foo_t name -> < foo : string > method foo : string end
+# Characters 22-184:
+ ..object(self)
+ method foo = "foo"
+ method cast: type a. a name -> a =
+ function
+ Foo -> (self :> foo_t)
+ | _ -> ((raise Exit) : a)
+ end
+Error: The class type
+ object method cast : 'a name -> 'a method foo : string end
+ is not matched by the class type foo_t
+ The public method cast cannot be hidden
+#
diff --git a/testsuite/tests/typing-objects/pr5619_bad.ml.reference b/testsuite/tests/typing-objects/pr5619_bad.ml.reference
new file mode 100644
index 0000000000..48777229ce
--- /dev/null
+++ b/testsuite/tests/typing-objects/pr5619_bad.ml.reference
@@ -0,0 +1,18 @@
+
+# class type foo_t = object method foo : string end
+type 'a name = Foo : foo_t name | Int : int name
+# class foo :
+ object method cast : foo_t name -> < foo : string > method foo : string end
+# Characters 22-184:
+ ..object(self)
+ method foo = "foo"
+ method cast: type a. a name -> a =
+ function
+ Foo -> (self :> foo_t)
+ | _ -> ((raise Exit) : a)
+ end
+Error: The class type
+ object method cast : 'a name -> 'a method foo : string end
+ is not matched by the class type foo_t
+ The public method cast cannot be hidden
+#
diff --git a/testsuite/tests/typing-poly-bugs/pr5322_ok.ml b/testsuite/tests/typing-poly-bugs/pr5322_ok.ml
index a24a6769a7..d6cbca1a7a 100644
--- a/testsuite/tests/typing-poly-bugs/pr5322_ok.ml
+++ b/testsuite/tests/typing-poly-bugs/pr5322_ok.ml
@@ -4,4 +4,3 @@ module M : sig val x : <m : 'a. 'a> end =
let ident v = v
class alias = object method alias : 'a . 'a t -> 'a = ident end
-
diff --git a/testsuite/tests/typing-poly/Makefile b/testsuite/tests/typing-poly/Makefile
index 5f42b70577..9625a3fbc3 100644
--- a/testsuite/tests/typing-poly/Makefile
+++ b/testsuite/tests/typing-poly/Makefile
@@ -1,4 +1,3 @@
BASEDIR=../..
include $(BASEDIR)/makefiles/Makefile.toplevel
include $(BASEDIR)/makefiles/Makefile.common
-
diff --git a/testsuite/tests/typing-poly/poly.ml b/testsuite/tests/typing-poly/poly.ml
index 17e643ad15..b0a5f97b83 100644
--- a/testsuite/tests/typing-poly/poly.ml
+++ b/testsuite/tests/typing-poly/poly.ml
@@ -448,7 +448,7 @@ function `B,1 -> 1 | _,1 -> 2;;
function 1,`B -> 1 | 1,_ -> 2;;
(* pass typetexp, but fails during Typedecl.check_recursion *)
-type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b]
+type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b]
and ('a, 'b) b = 'b -> unit constraint 'b = [> `A of ('a, 'b) a as 'a];;
(* PR#1917: expanding may change original in Ctype.unify2 *)
@@ -459,12 +459,12 @@ class type ['a, 'b] a = object
method as_a: ('a, 'b) a
end and ['a, 'b] b = object
method a: ('a, 'b) #a as 'a
- method as_b: ('a, 'b) b
+ method as_b: ('a, 'b) b
end
class type ['b] ca = object ('s) inherit ['s, 'b] a end
class type ['a] cb = object ('s) inherit ['a, 's] b end
-
+
type bt = 'b ca cb as 'b
;;
@@ -633,8 +633,8 @@ let l : t = { f = lazy (raise Not_found)};;
(* variant *)
type t = {f: 'a. 'a -> unit};;
-{f=fun ?x y -> ()};;
-{f=fun ?x y -> y};; (* fail *)
+let f ?x y = () in {f};;
+let f ?x y = y in {f};; (* fail *)
(* Polux Moon caml-list 2011-07-26 *)
module Polux = struct
@@ -643,3 +643,15 @@ module Polux = struct
class alias = object method alias : 'a . 'a t -> 'a = ident end
let f (x : <m : 'a. 'a t>) = (x : <m : 'a. 'a>)
end;;
+
+(* PR#5560 *)
+
+let (a, b) = (raise Exit : int * int);;
+type t = { foo : int }
+let {foo} = (raise Exit : t);;
+type s = A of int
+let (A x) = (raise Exit : s);;
+
+(* PR#5224 *)
+
+type 'x t = < f : 'y. 'y t >;;
diff --git a/testsuite/tests/typing-poly/poly.ml.principal.reference b/testsuite/tests/typing-poly/poly.ml.principal.reference
index b953491622..d069595e79 100644
--- a/testsuite/tests/typing-poly/poly.ml.principal.reference
+++ b/testsuite/tests/typing-poly/poly.ml.principal.reference
@@ -300,7 +300,7 @@ and 'a v = 'a u t constraint 'a = int
Error: Constraints are not satisfied in this type.
Type 'a u t should be an instance of g t
# type 'a u = 'a constraint 'a = g
-and 'a v = 'a u t constraint 'a = int
+and 'a v = 'a u t constraint 'a = g
# Characters 38-58:
type 'a u = < m : 'a v > and 'a v = 'a list u;;
^^^^^^^^^^^^^^^^^^^^
@@ -347,7 +347,7 @@ Characters 21-24:
Warning 11: this match case is unused.
- : int * [< `B ] -> int = <fun>
# Characters 69-135:
- type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b]
+ type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Constraints are not satisfied in this type.
Type
@@ -620,9 +620,9 @@ val transf_alist : (int -> t) -> ('a * t) list -> ('a * t) list = <fun>
val l : t = {f = <lazy>}
# type t = { f : 'a. 'a -> unit; }
# - : t = {f = <fun>}
-# Characters 3-16:
- {f=fun ?x y -> y};; (* fail *)
- ^^^^^^^^^^^^^
+# Characters 19-20:
+ let f ?x y = y in {f};; (* fail *)
+ ^
Error: This field value has type unit -> unit which is less general than
'a. 'a -> unit
# module Polux :
@@ -632,4 +632,11 @@ Error: This field value has type unit -> unit which is less general than
class alias : object method alias : 'a t -> 'a end
val f : < m : 'a. 'a t > -> < m : 'a. 'a >
end
+# Exception: Pervasives.Exit.
+# Exception: Pervasives.Exit.
+# Exception: Pervasives.Exit.
+# Characters 20-44:
+ type 'x t = < f : 'y. 'y t >;;
+ ^^^^^^^^^^^^^^^^^^^^^^^^
+Error: In the definition of t, type 'y t should be 'x t
#
diff --git a/testsuite/tests/typing-poly/poly.ml.reference b/testsuite/tests/typing-poly/poly.ml.reference
index 71befc5820..81fb347399 100644
--- a/testsuite/tests/typing-poly/poly.ml.reference
+++ b/testsuite/tests/typing-poly/poly.ml.reference
@@ -70,7 +70,7 @@
tl:'a ostream ->
object
val hd : 'a
- val tl : 'a ostream
+ val tl : < empty : bool; fold : 'c. f:('a -> 'c -> 'c) -> init:'c -> 'c >
method empty : bool
method fold : f:('a -> 'c -> 'c) -> init:'c -> 'c
end
@@ -119,7 +119,7 @@ val p1 : point = <obj>
val cp : color_point = <obj>
val c : circle = <obj>
val d : float = 11.4536240470737098
-# val f : < m : 'b. 'b -> 'b > -> < m : 'b. 'b -> 'b > = <fun>
+# val f : < m : 'a. 'a -> 'a > -> < m : 'b. 'b -> 'b > = <fun>
# Characters 41-42:
let f (x : < m : 'a. 'a -> 'a list >) = (x : < m : 'b. 'b -> 'c >)
^
@@ -283,7 +283,7 @@ and 'a v = 'a u t constraint 'a = int
Error: Constraints are not satisfied in this type.
Type 'a u t should be an instance of g t
# type 'a u = 'a constraint 'a = g
-and 'a v = 'a u t constraint 'a = int
+and 'a v = 'a u t constraint 'a = g
# Characters 38-58:
type 'a u = < m : 'a v > and 'a v = 'a list u;;
^^^^^^^^^^^^^^^^^^^^
@@ -330,7 +330,7 @@ Characters 21-24:
Warning 11: this match case is unused.
- : int * [< `B ] -> int = <fun>
# Characters 69-135:
- type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b]
+ type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Constraints are not satisfied in this type.
Type
@@ -441,12 +441,7 @@ Error: Type < m : 'a. 'a -> ('a * (< m : 'c. 'c -> 'b as 'e > as 'd) as 'b) >
= struct let f (x : <m : 'a. 'a * ('a * 'foo)> as 'foo) = () end;;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Signature mismatch:
- Modules do not match:
- sig val f : (< m : 'a. 'a * ('a * 'b) > as 'b) -> unit end
- is not included in
- sig
- val f : < m : 'b. 'b * ('b * < m : 'c. 'c * 'a > as 'a) > -> unit
- end
+ ...
Values do not match:
val f : (< m : 'a. 'a * ('a * 'b) > as 'b) -> unit
is not included in
@@ -583,9 +578,9 @@ val transf_alist : (int -> t) -> ('a * t) list -> ('a * t) list = <fun>
val l : t = {f = <lazy>}
# type t = { f : 'a. 'a -> unit; }
# - : t = {f = <fun>}
-# Characters 3-16:
- {f=fun ?x y -> y};; (* fail *)
- ^^^^^^^^^^^^^
+# Characters 19-20:
+ let f ?x y = y in {f};; (* fail *)
+ ^
Error: This field value has type unit -> unit which is less general than
'a. 'a -> unit
# module Polux :
@@ -593,6 +588,13 @@ Error: This field value has type unit -> unit which is less general than
type 'par t = 'par
val ident : 'a -> 'a
class alias : object method alias : 'a t -> 'a end
- val f : < m : 'a. 'a > -> < m : 'a. 'a >
+ val f : < m : 'a. 'a t > -> < m : 'a. 'a >
end
+# Exception: Pervasives.Exit.
+# Exception: Pervasives.Exit.
+# Exception: Pervasives.Exit.
+# Characters 20-44:
+ type 'x t = < f : 'y. 'y t >;;
+ ^^^^^^^^^^^^^^^^^^^^^^^^
+Error: In the definition of t, type 'y t should be 'x t
#
diff --git a/testsuite/tests/typing-polyvariants-bugs/pr5057_ok.ml b/testsuite/tests/typing-polyvariants-bugs/pr5057_ok.ml
index 38df770585..86cb665ad4 100644
--- a/testsuite/tests/typing-polyvariants-bugs/pr5057_ok.ml
+++ b/testsuite/tests/typing-polyvariants-bugs/pr5057_ok.ml
@@ -5,7 +5,7 @@ module TT = struct
end
let () =
- let f flag =
+ let f flag =
let module T = TT in
let _ = match flag with `A -> 0 | `B r -> r in
let _ = match flag with `A -> T.IntSet.mem | `B r -> r in
diff --git a/testsuite/tests/typing-polyvariants-bugs/pr5057a_bad.ml b/testsuite/tests/typing-polyvariants-bugs/pr5057a_bad.ml
index 35cc338635..15bb776b7f 100644
--- a/testsuite/tests/typing-polyvariants-bugs/pr5057a_bad.ml
+++ b/testsuite/tests/typing-polyvariants-bugs/pr5057a_bad.ml
@@ -1,6 +1,6 @@
(* This one should fail *)
-let f flag =
+let f flag =
let module T = Set.Make(struct type t = int let compare = compare end) in
let _ = match flag with `A -> 0 | `B r -> r in
let _ = match flag with `A -> T.mem | `B r -> r in
diff --git a/testsuite/tests/typing-private-bugs/pr5026_bad.ml b/testsuite/tests/typing-private-bugs/pr5026_bad.ml
index 0e6d215d26..10699952b2 100644
--- a/testsuite/tests/typing-private-bugs/pr5026_bad.ml
+++ b/testsuite/tests/typing-private-bugs/pr5026_bad.ml
@@ -3,7 +3,7 @@ type -'a typed = private untyped;;
type -'typing wrapped = private sexp
and +'a t = 'a typed wrapped
and sexp = private untyped wrapped;;
-class type ['a] s3 = object
+class type ['a] s3 = object
val underlying : 'a t
end;;
class ['a] s3object r : ['a] s3 = object
diff --git a/testsuite/tests/typing-private/Makefile b/testsuite/tests/typing-private/Makefile
index 5f42b70577..9625a3fbc3 100644
--- a/testsuite/tests/typing-private/Makefile
+++ b/testsuite/tests/typing-private/Makefile
@@ -1,4 +1,3 @@
BASEDIR=../..
include $(BASEDIR)/makefiles/Makefile.toplevel
include $(BASEDIR)/makefiles/Makefile.common
-
diff --git a/testsuite/tests/typing-private/private.ml b/testsuite/tests/typing-private/private.ml
index 636f231ba4..6f19b89d1c 100644
--- a/testsuite/tests/typing-private/private.ml
+++ b/testsuite/tests/typing-private/private.ml
@@ -57,18 +57,18 @@ module M3 : sig
val mk : int -> t
end = M;;
-module M4 : sig
+module M4 : sig
type t = M.t = T of int
val mk : int -> t
end = M;;
(* Error: The variant or record definition does not match that of type M.t *)
-module M5 : sig
+module M5 : sig
type t = M.t = private T of int
val mk : int -> t
end = M;;
-module M6 : sig
+module M6 : sig
type t = private T of int
val mk : int -> t
end = M;;
diff --git a/testsuite/tests/typing-private/private.ml.reference b/testsuite/tests/typing-private/private.ml.reference
index f5b85b2055..8a7b3db469 100644
--- a/testsuite/tests/typing-private/private.ml.reference
+++ b/testsuite/tests/typing-private/private.ml.reference
@@ -7,7 +7,7 @@
Error: This expression has type F0.t but an expression was expected of type
Foobar.t
# module F : sig type t = Foobar.t end
-# val f : F.t -> F.t = <fun>
+# val f : F.t -> Foobar.t = <fun>
# module M : sig type t = < m : int > end
# module M1 : sig type t = private < m : int; .. > end
# module M2 : sig type t = private < m : int; .. > end
@@ -73,7 +73,7 @@ Error: Signature mismatch:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Signature mismatch:
Modules do not match:
- sig type t = int val f : t -> t end
+ sig type t = int val f : int -> t end
is not included in
sig type t = private Foobar.t val f : int -> t end
Type declarations do not match:
@@ -84,7 +84,7 @@ Error: Signature mismatch:
# module M1 : sig type t = M.t val mk : int -> t end
# module M2 : sig type t = M.t val mk : int -> t end
# module M3 : sig type t = M.t val mk : int -> t end
-# Characters 29-47:
+# Characters 26-44:
type t = M.t = T of int
^^^^^^^^^^^^^^^^^^
Error: This variant or record definition does not match that of type M.t
diff --git a/testsuite/tests/typing-recmod/t02bad.ml b/testsuite/tests/typing-recmod/t02bad.ml
index ac9d6390c2..b4301a417e 100644
--- a/testsuite/tests/typing-recmod/t02bad.ml
+++ b/testsuite/tests/typing-recmod/t02bad.ml
@@ -1,4 +1,3 @@
(* Bad (t = t) *)
module rec A : sig type t = B.t end = struct type t = B.t end
and B : sig type t = A.t end = struct type t = A.t end;;
-
diff --git a/testsuite/tests/typing-recmod/t08bad.ml b/testsuite/tests/typing-recmod/t08bad.ml
index 7df3d47609..5ebafd11ab 100644
--- a/testsuite/tests/typing-recmod/t08bad.ml
+++ b/testsuite/tests/typing-recmod/t08bad.ml
@@ -2,4 +2,3 @@
module rec A : sig type 'a t = <m: 'a list B.t; n: 'a array B.t> end
= struct type 'a t = <m: 'a list B.t; n: 'a array B.t> end
and B : sig type 'a t = 'a A.t end = struct type 'a t = 'a A.t end;;
-
diff --git a/testsuite/tests/typing-recmod/t13ok.ml b/testsuite/tests/typing-recmod/t13ok.ml
index 729afd516a..4fea6e1faf 100644
--- a/testsuite/tests/typing-recmod/t13ok.ml
+++ b/testsuite/tests/typing-recmod/t13ok.ml
@@ -1,5 +1,5 @@
(* OK *)
class type [ 'node ] extension = object method node : 'node end
-class type [ 'ext ] node = object constraint 'ext = 'ext node #extension end
+class type [ 'ext ] node = object constraint 'ext = 'ext node #extension end
class x = object method node : x node = assert false end
type t = x node;;
diff --git a/testsuite/tests/typing-recmod/t14bad.ml b/testsuite/tests/typing-recmod/t14bad.ml
index 5c665368e8..1b92a28c5c 100644
--- a/testsuite/tests/typing-recmod/t14bad.ml
+++ b/testsuite/tests/typing-recmod/t14bad.ml
@@ -13,5 +13,5 @@ module PR_4261 = struct
end
module rec U : T with module D = U' = U
- and U' : S with type t = U'.t = U
+ and U' : S with type t = U'.t = U
end;;
diff --git a/testsuite/tests/typing-recmod/t16ok.ml b/testsuite/tests/typing-recmod/t16ok.ml
index f42de7b7a6..583b69bb52 100644
--- a/testsuite/tests/typing-recmod/t16ok.ml
+++ b/testsuite/tests/typing-recmod/t16ok.ml
@@ -28,4 +28,3 @@ module PR_4450_2 = struct
let create l = new c l
end
end;;
-
diff --git a/testsuite/tests/typing-recmod/t17ok.ml b/testsuite/tests/typing-recmod/t17ok.ml
index a2ea895adb..4521b66cfa 100644
--- a/testsuite/tests/typing-recmod/t17ok.ml
+++ b/testsuite/tests/typing-recmod/t17ok.ml
@@ -25,18 +25,17 @@ struct
type t = I of int * int | D of int * Diet.t * int
val compare : t -> t -> int
val iter : (int -> unit) -> t -> unit
- end =
+ end =
struct
type t = I of int * int | D of int * Diet.t * int
let compare x1 x2 = 0
let rec iter f = function
| I (l, r) -> for i = l to r do f i done
| D (_, d, _) -> Diet.iter (iter f) d
- end
+ end
and Diet : SET with type t = Elt.t tree and type elt = Elt.t = MakeDiet(Elt)
type t = Diet.t
let iter f = Diet.iter (Elt.iter f)
end
-
diff --git a/testsuite/tests/typing-recmod/t18ok.ml b/testsuite/tests/typing-recmod/t18ok.ml
index 4f5814deb2..64fcf6aba8 100644
--- a/testsuite/tests/typing-recmod/t18ok.ml
+++ b/testsuite/tests/typing-recmod/t18ok.ml
@@ -22,5 +22,4 @@ and DirHash
end
= struct
type t = DirCompare.t list
- end
-
+ end
diff --git a/testsuite/tests/typing-recmod/t19ok.ml b/testsuite/tests/typing-recmod/t19ok.ml
index cd2dde8ec2..62e5f45486 100644
--- a/testsuite/tests/typing-recmod/t19ok.ml
+++ b/testsuite/tests/typing-recmod/t19ok.ml
@@ -10,4 +10,3 @@ module PR_4758 = struct
module Other = A
end
end
-
diff --git a/testsuite/tests/typing-recmod/t22ok.ml b/testsuite/tests/typing-recmod/t22ok.ml
index 0aa63afdd6..de96eced55 100644
--- a/testsuite/tests/typing-recmod/t22ok.ml
+++ b/testsuite/tests/typing-recmod/t22ok.ml
@@ -112,7 +112,7 @@ module rec Strengthen
;;
module rec Strengthen2
- : sig type t
+ : sig type t
val f : t -> t
module M : sig type u end
module R : sig type v end
@@ -150,7 +150,7 @@ module rec PolyRec
| Node(l,r) -> 1 + max (PolyRec.depth l) (PolyRec.depth r)
end
;;
-
+
(* Wrong LHS signatures (PR#4336) *)
(*
@@ -212,7 +212,7 @@ and Binding
: sig
type t = (string * Expr.t) list
val fv: t -> StringSet.t
- val bv: t -> StringSet.t
+ val bv: t -> StringSet.t
val simpl: t -> t
end
= struct
@@ -258,7 +258,7 @@ module type HEAP =
val deleteMin: heap -> heap
end
-module Bootstrap (MakeH: functor (Element:ORDERED) ->
+module Bootstrap (MakeH: functor (Element:ORDERED) ->
HEAP with module Elem = Element)
(Element: ORDERED) : HEAP with module Elem = Element =
struct
@@ -268,7 +268,7 @@ module Bootstrap (MakeH: functor (Element:ORDERED) ->
val eq: t -> t -> bool
val lt: t -> t -> bool
val leq: t -> t -> bool
- end
+ end
= struct
type t = E | H of Elem.t * PrimH.heap
let leq t1 t2 =
@@ -432,7 +432,7 @@ module rec Coerce1
module A = (Coerce1: sig val f: int -> int end)
let g x = x
let f x = if x <= 0 then 1 else A.f (x-1) * x
- end
+ end
;;
let _ =
@@ -461,7 +461,7 @@ module Coerce4(A : sig val f : int -> int end) = struct
end
module rec Coerce5
- : sig val blabla: int -> int val f: int -> int end
+ : sig val blabla: int -> int val f: int -> int end
= struct let blabla x = 0 let f x = 5 end
and Coerce6
: sig val at: int -> int end
@@ -473,16 +473,16 @@ let _ =
(* Miscellaneous bug reports *)
-module rec F
+module rec F
: sig type t = X of int | Y of int
val f: t -> bool
end
= struct
- type t = X of int | Y of int
+ type t = X of int | Y of int
let f = function
| X _ -> false
| _ -> true
- end;;
+ end;;
let _ =
test 100 (F.f (F.X 1)) false;
diff --git a/testsuite/tests/typing-signatures/Makefile b/testsuite/tests/typing-signatures/Makefile
index 5f42b70577..9625a3fbc3 100644
--- a/testsuite/tests/typing-signatures/Makefile
+++ b/testsuite/tests/typing-signatures/Makefile
@@ -1,4 +1,3 @@
BASEDIR=../..
include $(BASEDIR)/makefiles/Makefile.toplevel
include $(BASEDIR)/makefiles/Makefile.common
-
diff --git a/testsuite/tests/typing-signatures/els.ml b/testsuite/tests/typing-signatures/els.ml
index f3c9c7936a..3713b64e5c 100644
--- a/testsuite/tests/typing-signatures/els.ml
+++ b/testsuite/tests/typing-signatures/els.ml
@@ -45,12 +45,12 @@ module type INTERP = sig
include EVALUATOR
module Parser : PARSER with type chunk = Ast.chunk
val dostring : state -> string -> value list
- val mk : unit -> state
+ val mk : unit -> state
end;;
module type USERTYPE = sig
type t
- val eq : t -> t -> bool
+ val eq : t -> t -> bool
val to_string : t -> string
end;;
diff --git a/testsuite/tests/typing-sigsubst/Makefile b/testsuite/tests/typing-sigsubst/Makefile
index 5f42b70577..9625a3fbc3 100644
--- a/testsuite/tests/typing-sigsubst/Makefile
+++ b/testsuite/tests/typing-sigsubst/Makefile
@@ -1,4 +1,3 @@
BASEDIR=../..
include $(BASEDIR)/makefiles/Makefile.toplevel
include $(BASEDIR)/makefiles/Makefile.common
-
diff --git a/testsuite/tests/typing-sigsubst/sigsubst.ml b/testsuite/tests/typing-sigsubst/sigsubst.ml
index 4cb22fa2db..6759f63ab2 100644
--- a/testsuite/tests/typing-sigsubst/sigsubst.ml
+++ b/testsuite/tests/typing-sigsubst/sigsubst.ml
@@ -9,7 +9,7 @@ end;;
module type PrintableComparable = sig
include Printable
include Comparable with type t = t
-end;;
+end;; (* Fails *)
module type PrintableComparable = sig
type t
include Printable with type t := t
@@ -35,3 +35,6 @@ module type S =
sig module T : sig type exp type arg end val f : T.exp -> T.arg end;;
module M = struct type exp = string type arg = int end;;
module type S' = S with module T := M;;
+
+
+module type S = sig type 'a t end with type 'a t := unit;; (* Fails *)
diff --git a/testsuite/tests/typing-sigsubst/sigsubst.ml.reference b/testsuite/tests/typing-sigsubst/sigsubst.ml.reference
index 3adcb82a98..5a160347b4 100644
--- a/testsuite/tests/typing-sigsubst/sigsubst.ml.reference
+++ b/testsuite/tests/typing-sigsubst/sigsubst.ml.reference
@@ -33,4 +33,8 @@ Error: Multiple definition of the type name t.
sig module T : sig type exp type arg end val f : T.exp -> T.arg end
# module M : sig type exp = string type arg = int end
# module type S' = sig val f : M.exp -> M.arg end
+# Characters 41-58:
+ module type S = sig type 'a t end with type 'a t := unit;; (* Fails *)
+ ^^^^^^^^^^^^^^^^^
+Error: Only type constructors with identical parameters can be substituted.
#
diff --git a/testsuite/tests/typing-typeparam/Makefile b/testsuite/tests/typing-typeparam/Makefile
index 748631f909..9625a3fbc3 100644
--- a/testsuite/tests/typing-typeparam/Makefile
+++ b/testsuite/tests/typing-typeparam/Makefile
@@ -1,7 +1,3 @@
-#MODULES=
BASEDIR=../..
-MAIN_MODULE=newtype
-ADD_COMPFLAGS=-w a
-
-include $(BASEDIR)/makefiles/Makefile.one
+include $(BASEDIR)/makefiles/Makefile.toplevel
include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/typing-typeparam/newtype.ml b/testsuite/tests/typing-typeparam/newtype.ml
index 24eb2fcfc0..abe587634c 100644
--- a/testsuite/tests/typing-typeparam/newtype.ml
+++ b/testsuite/tests/typing-typeparam/newtype.ml
@@ -1,6 +1,7 @@
let property (type t) () =
let module M = struct exception E of t end in
(fun x -> M.E x), (function M.E x -> Some x | _ -> None)
+;;
let () =
let (int_inj, int_proj) = property () in
@@ -13,15 +14,19 @@ let () =
Printf.printf "%b\n%!" (int_proj s = None);
Printf.printf "%b\n%!" (string_proj i = None);
Printf.printf "%b\n%!" (string_proj s = None)
-
-
-
+;;
let sort_uniq (type s) cmp l =
let module S = Set.Make(struct type t = s let compare = cmp end) in
S.elements (List.fold_right S.add l S.empty)
+;;
let () =
print_endline (String.concat "," (sort_uniq compare [ "abc"; "xyz"; "abc" ]))
+;;
-
+let f x (type a) (y : a) = (x = y);; (* Fails *)
+class ['a] c = object (self)
+ method m : 'a -> 'a = fun x -> x
+ method n : 'a -> 'a = fun (type g) (x:g) -> self#m x
+end;; (* Fails *)
diff --git a/testsuite/tests/typing-typeparam/newtype.ml.reference b/testsuite/tests/typing-typeparam/newtype.ml.reference
new file mode 100644
index 0000000000..c28cf53a6e
--- /dev/null
+++ b/testsuite/tests/typing-typeparam/newtype.ml.reference
@@ -0,0 +1,19 @@
+
+# val property : unit -> ('a -> exn) * (exn -> 'a option) = <fun>
+# false
+true
+true
+false
+# val sort_uniq : ('a -> 'a -> int) -> 'a list -> 'a list = <fun>
+# abc,xyz
+# Characters 33-34:
+ let f x (type a) (y : a) = (x = y);; (* Fails *)
+ ^
+Error: This expression has type a but an expression was expected of type a
+ The type constructor a would escape its scope
+# Characters 117-118:
+ method n : 'a -> 'a = fun (type g) (x:g) -> self#m x
+ ^
+Error: This expression has type g but an expression was expected of type g
+ The type constructor g would escape its scope
+#
diff --git a/testsuite/tests/typing-typeparam/newtype.reference b/testsuite/tests/typing-typeparam/newtype.reference
deleted file mode 100644
index ab102d7d6b..0000000000
--- a/testsuite/tests/typing-typeparam/newtype.reference
+++ /dev/null
@@ -1,5 +0,0 @@
-false
-true
-true
-false
-abc,xyz