diff options
| author | Sébastien Hinderer <Sebastien.Hinderer@inria.fr> | 2018-02-08 18:59:41 +0100 |
|---|---|---|
| committer | Sébastien Hinderer <Sebastien.Hinderer@inria.fr> | 2018-02-20 18:18:48 +0100 |
| commit | a9aa39d735eaae94d91e40ca65052db0ab0ef5c2 (patch) | |
| tree | a73424fe95112e0b068f884381fa4abf60c24880 | |
| parent | da342263cb35bd2743b6bd7881943b408d174ed5 (diff) | |
| download | ocaml-a9aa39d735eaae94d91e40ca65052db0ab0ef5c2.tar.gz | |
Migrate the translprim tests to ocamltest
For an explanation of the changes in the reference files, see the log
message of the previous commit.
19 files changed, 677 insertions, 883 deletions
diff --git a/.gitignore b/.gitignore index 92429b70c2..6af7d4e994 100644 --- a/.gitignore +++ b/.gitignore @@ -343,11 +343,6 @@ _ocamltest /testsuite/tests/typing-unboxed-types/true.flat-float /testsuite/tests/typing-unboxed-types/test.ml.reference -/testsuite/tests/translprim/false.flat-float -/testsuite/tests/translprim/true.flat-float -/testsuite/tests/translprim/array_spec.ml.reference -/testsuite/tests/translprim/module_coercion.ml.reference - /testsuite/tests/unboxed-primitive-args/main.ml /testsuite/tests/unboxed-primitive-args/stubs.c diff --git a/testsuite/tests/translprim/Makefile b/testsuite/tests/translprim/Makefile deleted file mode 100644 index cdfef9a21c..0000000000 --- a/testsuite/tests/translprim/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -newdefault: array_spec.ml.reference module_coercion.ml.reference - $(MAKE) default - -BASEDIR=../.. -TOPFLAGS+=-dlambda -include $(BASEDIR)/makefiles/Makefile.dlambda -include $(BASEDIR)/makefiles/Makefile.common - -GENERATED_SOURCES = array_spec.ml.reference module_coercion.ml.reference \ - *.flat-float - -ifeq "$(FLAT_FLOAT_ARRAY)" "true" -suffix = -flat -else -suffix = -noflat -endif - -array_spec.ml.reference: array_spec.ml.reference$(suffix) \ - $(FLAT_FLOAT_ARRAY).flat-float - cp $< $@ - -module_coercion.ml.reference: module_coercion.ml.reference$(suffix) \ - $(FLAT_FLOAT_ARRAY).flat-float - cp $< $@ - -%.flat-float: - @rm -f $(GENERATED_SOURCES) - @touch $@ diff --git a/testsuite/tests/translprim/array_spec.compilers.reference.flat b/testsuite/tests/translprim/array_spec.compilers.reference.flat new file mode 100644 index 0000000000..73738bbfae --- /dev/null +++ b/testsuite/tests/translprim/array_spec.compilers.reference.flat @@ -0,0 +1,88 @@ +(setglobal Array_spec! + (let + (int_a/1007 = (makearray[int] 1 2 3) + float_a/1008 = (makearray[float] 1. 2. 3.) + addr_a/1009 = (makearray[addr] "a" "b" "c")) + (seq (array.length[int] int_a/1007) (array.length[float] float_a/1008) + (array.length[addr] addr_a/1009) + (function a/1010 (array.length[gen] a/1010)) + (array.get[int] int_a/1007 0) (array.get[float] float_a/1008 0) + (array.get[addr] addr_a/1009 0) + (function a/1011 (array.get[gen] a/1011 0)) + (array.unsafe_get[int] int_a/1007 0) + (array.unsafe_get[float] float_a/1008 0) + (array.unsafe_get[addr] addr_a/1009 0) + (function a/1012 (array.unsafe_get[gen] a/1012 0)) + (array.set[int] int_a/1007 0 1) (array.set[float] float_a/1008 0 1.) + (array.set[addr] addr_a/1009 0 "a") + (function a/1013 x/1014 (array.set[gen] a/1013 0 x/1014)) + (array.unsafe_set[int] int_a/1007 0 1) + (array.unsafe_set[float] float_a/1008 0 1.) + (array.unsafe_set[addr] addr_a/1009 0 "a") + (function a/1015 x/1016 (array.unsafe_set[gen] a/1015 0 x/1016)) + (let + (eta_gen_len/1017 = + (function prim/1108 stub (array.length[gen] prim/1108)) + eta_gen_safe_get/1018 = + (function prim/1107 prim/1106 stub + (array.get[gen] prim/1107 prim/1106)) + eta_gen_unsafe_get/1019 = + (function prim/1105 prim/1104 stub + (array.unsafe_get[gen] prim/1105 prim/1104)) + eta_gen_safe_set/1020 = + (function prim/1103 prim/1102 prim/1101 stub + (array.set[gen] prim/1103 prim/1102 prim/1101)) + eta_gen_unsafe_set/1021 = + (function prim/1100 prim/1099 prim/1098 stub + (array.unsafe_set[gen] prim/1100 prim/1099 prim/1098)) + eta_int_len/1022 = + (function prim/1097 stub (array.length[int] prim/1097)) + eta_int_safe_get/1023 = + (function prim/1096 prim/1095 stub + (array.get[int] prim/1096 prim/1095)) + eta_int_unsafe_get/1024 = + (function prim/1094 prim/1093 stub + (array.unsafe_get[int] prim/1094 prim/1093)) + eta_int_safe_set/1025 = + (function prim/1092 prim/1091 prim/1090 stub + (array.set[int] prim/1092 prim/1091 prim/1090)) + eta_int_unsafe_set/1026 = + (function prim/1089 prim/1088 prim/1087 stub + (array.unsafe_set[int] prim/1089 prim/1088 prim/1087)) + eta_float_len/1027 = + (function prim/1086 stub (array.length[float] prim/1086)) + eta_float_safe_get/1028 = + (function prim/1085 prim/1084 stub + (array.get[float] prim/1085 prim/1084)) + eta_float_unsafe_get/1029 = + (function prim/1083 prim/1082 stub + (array.unsafe_get[float] prim/1083 prim/1082)) + eta_float_safe_set/1030 = + (function prim/1081 prim/1080 prim/1079 stub + (array.set[float] prim/1081 prim/1080 prim/1079)) + eta_float_unsafe_set/1031 = + (function prim/1078 prim/1077 prim/1076 stub + (array.unsafe_set[float] prim/1078 prim/1077 prim/1076)) + eta_addr_len/1032 = + (function prim/1075 stub (array.length[addr] prim/1075)) + eta_addr_safe_get/1033 = + (function prim/1074 prim/1073 stub + (array.get[addr] prim/1074 prim/1073)) + eta_addr_unsafe_get/1034 = + (function prim/1072 prim/1071 stub + (array.unsafe_get[addr] prim/1072 prim/1071)) + eta_addr_safe_set/1035 = + (function prim/1070 prim/1069 prim/1068 stub + (array.set[addr] prim/1070 prim/1069 prim/1068)) + eta_addr_unsafe_set/1036 = + (function prim/1067 prim/1066 prim/1065 stub + (array.unsafe_set[addr] prim/1067 prim/1066 prim/1065))) + (makeblock 0 int_a/1007 float_a/1008 addr_a/1009 eta_gen_len/1017 + eta_gen_safe_get/1018 eta_gen_unsafe_get/1019 eta_gen_safe_set/1020 + eta_gen_unsafe_set/1021 eta_int_len/1022 eta_int_safe_get/1023 + eta_int_unsafe_get/1024 eta_int_safe_set/1025 + eta_int_unsafe_set/1026 eta_float_len/1027 eta_float_safe_get/1028 + eta_float_unsafe_get/1029 eta_float_safe_set/1030 + eta_float_unsafe_set/1031 eta_addr_len/1032 eta_addr_safe_get/1033 + eta_addr_unsafe_get/1034 eta_addr_safe_set/1035 + eta_addr_unsafe_set/1036))))) diff --git a/testsuite/tests/translprim/array_spec.compilers.reference.no-flat b/testsuite/tests/translprim/array_spec.compilers.reference.no-flat new file mode 100644 index 0000000000..d2fc7b48f3 --- /dev/null +++ b/testsuite/tests/translprim/array_spec.compilers.reference.no-flat @@ -0,0 +1,88 @@ +(setglobal Array_spec! + (let + (int_a/1007 = (makearray[int] 1 2 3) + float_a/1008 = (makearray[addr] 1. 2. 3.) + addr_a/1009 = (makearray[addr] "a" "b" "c")) + (seq (array.length[int] int_a/1007) (array.length[addr] float_a/1008) + (array.length[addr] addr_a/1009) + (function a/1010 (array.length[addr] a/1010)) + (array.get[int] int_a/1007 0) (array.get[addr] float_a/1008 0) + (array.get[addr] addr_a/1009 0) + (function a/1011 (array.get[addr] a/1011 0)) + (array.unsafe_get[int] int_a/1007 0) + (array.unsafe_get[addr] float_a/1008 0) + (array.unsafe_get[addr] addr_a/1009 0) + (function a/1012 (array.unsafe_get[addr] a/1012 0)) + (array.set[int] int_a/1007 0 1) (array.set[addr] float_a/1008 0 1.) + (array.set[addr] addr_a/1009 0 "a") + (function a/1013 x/1014 (array.set[addr] a/1013 0 x/1014)) + (array.unsafe_set[int] int_a/1007 0 1) + (array.unsafe_set[addr] float_a/1008 0 1.) + (array.unsafe_set[addr] addr_a/1009 0 "a") + (function a/1015 x/1016 (array.unsafe_set[addr] a/1015 0 x/1016)) + (let + (eta_gen_len/1017 = + (function prim/1108 stub (array.length[addr] prim/1108)) + eta_gen_safe_get/1018 = + (function prim/1107 prim/1106 stub + (array.get[addr] prim/1107 prim/1106)) + eta_gen_unsafe_get/1019 = + (function prim/1105 prim/1104 stub + (array.unsafe_get[addr] prim/1105 prim/1104)) + eta_gen_safe_set/1020 = + (function prim/1103 prim/1102 prim/1101 stub + (array.set[addr] prim/1103 prim/1102 prim/1101)) + eta_gen_unsafe_set/1021 = + (function prim/1100 prim/1099 prim/1098 stub + (array.unsafe_set[addr] prim/1100 prim/1099 prim/1098)) + eta_int_len/1022 = + (function prim/1097 stub (array.length[int] prim/1097)) + eta_int_safe_get/1023 = + (function prim/1096 prim/1095 stub + (array.get[int] prim/1096 prim/1095)) + eta_int_unsafe_get/1024 = + (function prim/1094 prim/1093 stub + (array.unsafe_get[int] prim/1094 prim/1093)) + eta_int_safe_set/1025 = + (function prim/1092 prim/1091 prim/1090 stub + (array.set[int] prim/1092 prim/1091 prim/1090)) + eta_int_unsafe_set/1026 = + (function prim/1089 prim/1088 prim/1087 stub + (array.unsafe_set[int] prim/1089 prim/1088 prim/1087)) + eta_float_len/1027 = + (function prim/1086 stub (array.length[addr] prim/1086)) + eta_float_safe_get/1028 = + (function prim/1085 prim/1084 stub + (array.get[addr] prim/1085 prim/1084)) + eta_float_unsafe_get/1029 = + (function prim/1083 prim/1082 stub + (array.unsafe_get[addr] prim/1083 prim/1082)) + eta_float_safe_set/1030 = + (function prim/1081 prim/1080 prim/1079 stub + (array.set[addr] prim/1081 prim/1080 prim/1079)) + eta_float_unsafe_set/1031 = + (function prim/1078 prim/1077 prim/1076 stub + (array.unsafe_set[addr] prim/1078 prim/1077 prim/1076)) + eta_addr_len/1032 = + (function prim/1075 stub (array.length[addr] prim/1075)) + eta_addr_safe_get/1033 = + (function prim/1074 prim/1073 stub + (array.get[addr] prim/1074 prim/1073)) + eta_addr_unsafe_get/1034 = + (function prim/1072 prim/1071 stub + (array.unsafe_get[addr] prim/1072 prim/1071)) + eta_addr_safe_set/1035 = + (function prim/1070 prim/1069 prim/1068 stub + (array.set[addr] prim/1070 prim/1069 prim/1068)) + eta_addr_unsafe_set/1036 = + (function prim/1067 prim/1066 prim/1065 stub + (array.unsafe_set[addr] prim/1067 prim/1066 prim/1065))) + (makeblock 0 int_a/1007 float_a/1008 addr_a/1009 eta_gen_len/1017 + eta_gen_safe_get/1018 eta_gen_unsafe_get/1019 eta_gen_safe_set/1020 + eta_gen_unsafe_set/1021 eta_int_len/1022 eta_int_safe_get/1023 + eta_int_unsafe_get/1024 eta_int_safe_set/1025 + eta_int_unsafe_set/1026 eta_float_len/1027 eta_float_safe_get/1028 + eta_float_unsafe_get/1029 eta_float_safe_set/1030 + eta_float_unsafe_set/1031 eta_addr_len/1032 eta_addr_safe_get/1033 + eta_addr_unsafe_get/1034 eta_addr_safe_set/1035 + eta_addr_unsafe_set/1036))))) diff --git a/testsuite/tests/translprim/array_spec.ml b/testsuite/tests/translprim/array_spec.ml index e78c96343c..46faf80d99 100644 --- a/testsuite/tests/translprim/array_spec.ml +++ b/testsuite/tests/translprim/array_spec.ml @@ -1,3 +1,15 @@ +(* TEST + * setup-ocamlc.byte-build-env + ** ocamlc.byte + flags = "-dlambda -dunique-ids" + *** flat-float-array + **** check-ocamlc.byte-output + compiler_reference = "${test_source_directory}/array_spec.compilers.reference.flat" + *** no-flat-float-array + **** check-ocamlc.byte-output + compiler_reference = "${test_source_directory}/array_spec.compilers.reference.no-flat" +*) + external len : 'a array -> int = "%array_length" external safe_get : 'a array -> int -> 'a = "%array_safe_get" external unsafe_get : 'a array -> int -> 'a = "%array_unsafe_get" diff --git a/testsuite/tests/translprim/array_spec.ml.reference-flat b/testsuite/tests/translprim/array_spec.ml.reference-flat deleted file mode 100644 index 83fe0c4cdc..0000000000 --- a/testsuite/tests/translprim/array_spec.ml.reference-flat +++ /dev/null @@ -1,88 +0,0 @@ -(setglobal Array_spec! - (let - (int_a = (makearray[int] 1 2 3) - float_a = (makearray[float] 1. 2. 3.) - addr_a = (makearray[addr] "a" "b" "c")) - (seq (array.length[int] int_a) (array.length[float] float_a) - (array.length[addr] addr_a) - (function a (array.length[gen] a)) - (array.get[int] int_a 0) (array.get[float] float_a 0) - (array.get[addr] addr_a 0) - (function a (array.get[gen] a 0)) - (array.unsafe_get[int] int_a 0) - (array.unsafe_get[float] float_a 0) - (array.unsafe_get[addr] addr_a 0) - (function a (array.unsafe_get[gen] a 0)) - (array.set[int] int_a 0 1) (array.set[float] float_a 0 1.) - (array.set[addr] addr_a 0 "a") - (function a x (array.set[gen] a 0 x)) - (array.unsafe_set[int] int_a 0 1) - (array.unsafe_set[float] float_a 0 1.) - (array.unsafe_set[addr] addr_a 0 "a") - (function a x (array.unsafe_set[gen] a 0 x)) - (let - (eta_gen_len = - (function prim stub (array.length[gen] prim)) - eta_gen_safe_get = - (function prim prim stub - (array.get[gen] prim prim)) - eta_gen_unsafe_get = - (function prim prim stub - (array.unsafe_get[gen] prim prim)) - eta_gen_safe_set = - (function prim prim prim stub - (array.set[gen] prim prim prim)) - eta_gen_unsafe_set = - (function prim prim prim stub - (array.unsafe_set[gen] prim prim prim)) - eta_int_len = - (function prim stub (array.length[int] prim)) - eta_int_safe_get = - (function prim prim stub - (array.get[int] prim prim)) - eta_int_unsafe_get = - (function prim prim stub - (array.unsafe_get[int] prim prim)) - eta_int_safe_set = - (function prim prim prim stub - (array.set[int] prim prim prim)) - eta_int_unsafe_set = - (function prim prim prim stub - (array.unsafe_set[int] prim prim prim)) - eta_float_len = - (function prim stub (array.length[float] prim)) - eta_float_safe_get = - (function prim prim stub - (array.get[float] prim prim)) - eta_float_unsafe_get = - (function prim prim stub - (array.unsafe_get[float] prim prim)) - eta_float_safe_set = - (function prim prim prim stub - (array.set[float] prim prim prim)) - eta_float_unsafe_set = - (function prim prim prim stub - (array.unsafe_set[float] prim prim prim)) - eta_addr_len = - (function prim stub (array.length[addr] prim)) - eta_addr_safe_get = - (function prim prim stub - (array.get[addr] prim prim)) - eta_addr_unsafe_get = - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - eta_addr_safe_set = - (function prim prim prim stub - (array.set[addr] prim prim prim)) - eta_addr_unsafe_set = - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim))) - (makeblock 0 int_a float_a addr_a eta_gen_len - eta_gen_safe_get eta_gen_unsafe_get eta_gen_safe_set - eta_gen_unsafe_set eta_int_len eta_int_safe_get - eta_int_unsafe_get eta_int_safe_set - eta_int_unsafe_set eta_float_len eta_float_safe_get - eta_float_unsafe_get eta_float_safe_set - eta_float_unsafe_set eta_addr_len eta_addr_safe_get - eta_addr_unsafe_get eta_addr_safe_set - eta_addr_unsafe_set))))) diff --git a/testsuite/tests/translprim/array_spec.ml.reference-noflat b/testsuite/tests/translprim/array_spec.ml.reference-noflat deleted file mode 100644 index ba90062d41..0000000000 --- a/testsuite/tests/translprim/array_spec.ml.reference-noflat +++ /dev/null @@ -1,88 +0,0 @@ -(setglobal Array_spec! - (let - (int_a = (makearray[int] 1 2 3) - float_a = (makearray[addr] 1. 2. 3.) - addr_a = (makearray[addr] "a" "b" "c")) - (seq (array.length[int] int_a) (array.length[addr] float_a) - (array.length[addr] addr_a) - (function a (array.length[addr] a)) - (array.get[int] int_a 0) (array.get[addr] float_a 0) - (array.get[addr] addr_a 0) - (function a (array.get[addr] a 0)) - (array.unsafe_get[int] int_a 0) - (array.unsafe_get[addr] float_a 0) - (array.unsafe_get[addr] addr_a 0) - (function a (array.unsafe_get[addr] a 0)) - (array.set[int] int_a 0 1) (array.set[addr] float_a 0 1.) - (array.set[addr] addr_a 0 "a") - (function a x (array.set[addr] a 0 x)) - (array.unsafe_set[int] int_a 0 1) - (array.unsafe_set[addr] float_a 0 1.) - (array.unsafe_set[addr] addr_a 0 "a") - (function a x (array.unsafe_set[addr] a 0 x)) - (let - (eta_gen_len = - (function prim stub (array.length[addr] prim)) - eta_gen_safe_get = - (function prim prim stub - (array.get[addr] prim prim)) - eta_gen_unsafe_get = - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - eta_gen_safe_set = - (function prim prim prim stub - (array.set[addr] prim prim prim)) - eta_gen_unsafe_set = - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim)) - eta_int_len = - (function prim stub (array.length[int] prim)) - eta_int_safe_get = - (function prim prim stub - (array.get[int] prim prim)) - eta_int_unsafe_get = - (function prim prim stub - (array.unsafe_get[int] prim prim)) - eta_int_safe_set = - (function prim prim prim stub - (array.set[int] prim prim prim)) - eta_int_unsafe_set = - (function prim prim prim stub - (array.unsafe_set[int] prim prim prim)) - eta_float_len = - (function prim stub (array.length[addr] prim)) - eta_float_safe_get = - (function prim prim stub - (array.get[addr] prim prim)) - eta_float_unsafe_get = - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - eta_float_safe_set = - (function prim prim prim stub - (array.set[addr] prim prim prim)) - eta_float_unsafe_set = - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim)) - eta_addr_len = - (function prim stub (array.length[addr] prim)) - eta_addr_safe_get = - (function prim prim stub - (array.get[addr] prim prim)) - eta_addr_unsafe_get = - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - eta_addr_safe_set = - (function prim prim prim stub - (array.set[addr] prim prim prim)) - eta_addr_unsafe_set = - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim))) - (makeblock 0 int_a float_a addr_a eta_gen_len - eta_gen_safe_get eta_gen_unsafe_get eta_gen_safe_set - eta_gen_unsafe_set eta_int_len eta_int_safe_get - eta_int_unsafe_get eta_int_safe_set - eta_int_unsafe_set eta_float_len eta_float_safe_get - eta_float_unsafe_get eta_float_safe_set - eta_float_unsafe_set eta_addr_len eta_addr_safe_get - eta_addr_unsafe_get eta_addr_safe_set - eta_addr_unsafe_set))))) diff --git a/testsuite/tests/translprim/comparison_table.compilers.reference b/testsuite/tests/translprim/comparison_table.compilers.reference new file mode 100644 index 0000000000..b3c439fe52 --- /dev/null +++ b/testsuite/tests/translprim/comparison_table.compilers.reference @@ -0,0 +1,248 @@ +(setglobal Comparison_table! + (let + (gen_cmp = (function x y (caml_compare x y)) + int_cmp = (function x y (caml_int_compare x y)) + bool_cmp = (function x y (caml_int_compare x y)) + intlike_cmp = (function x y (caml_int_compare x y)) + float_cmp = (function x y (caml_float_compare x y)) + string_cmp = (function x y (caml_string_compare x y)) + int32_cmp = (function x y (caml_int32_compare x y)) + int64_cmp = (function x y (caml_int64_compare x y)) + nativeint_cmp = (function x y (caml_nativeint_compare x y)) + gen_eq = (function x y (caml_equal x y)) + int_eq = (function x y (== x y)) + bool_eq = (function x y (== x y)) + intlike_eq = (function x y (== x y)) + float_eq = (function x y (==. x y)) + string_eq = (function x y (caml_string_equal x y)) + int32_eq = (function x y (Int32.== x y)) + int64_eq = (function x y (Int64.== x y)) + nativeint_eq = (function x y (Nativeint.== x y)) + gen_ne = (function x y (caml_notequal x y)) + int_ne = (function x y (!= x y)) + bool_ne = (function x y (!= x y)) + intlike_ne = (function x y (!= x y)) + float_ne = (function x y (!=. x y)) + string_ne = (function x y (caml_string_notequal x y)) + int32_ne = (function x y (Int32.!= x y)) + int64_ne = (function x y (Int64.!= x y)) + nativeint_ne = (function x y (Nativeint.!= x y)) + gen_lt = (function x y (caml_lessthan x y)) + int_lt = (function x y (< x y)) + bool_lt = (function x y (< x y)) + intlike_lt = (function x y (< x y)) + float_lt = (function x y (<. x y)) + string_lt = (function x y (caml_string_lessthan x y)) + int32_lt = (function x y (Int32.< x y)) + int64_lt = (function x y (Int64.< x y)) + nativeint_lt = (function x y (Nativeint.< x y)) + gen_gt = (function x y (caml_greaterthan x y)) + int_gt = (function x y (> x y)) + bool_gt = (function x y (> x y)) + intlike_gt = (function x y (> x y)) + float_gt = (function x y (>. x y)) + string_gt = (function x y (caml_string_greaterthan x y)) + int32_gt = (function x y (Int32.> x y)) + int64_gt = (function x y (Int64.> x y)) + nativeint_gt = (function x y (Nativeint.> x y)) + gen_le = (function x y (caml_lessequal x y)) + int_le = (function x y (<= x y)) + bool_le = (function x y (<= x y)) + intlike_le = (function x y (<= x y)) + float_le = (function x y (<=. x y)) + string_le = (function x y (caml_string_lessequal x y)) + int32_le = (function x y (Int32.<= x y)) + int64_le = (function x y (Int64.<= x y)) + nativeint_le = (function x y (Nativeint.<= x y)) + gen_ge = (function x y (caml_greaterequal x y)) + int_ge = (function x y (>= x y)) + bool_ge = (function x y (>= x y)) + intlike_ge = (function x y (>= x y)) + float_ge = (function x y (>=. x y)) + string_ge = (function x y (caml_string_greaterequal x y)) + int32_ge = (function x y (Int32.>= x y)) + int64_ge = (function x y (Int64.>= x y)) + nativeint_ge = (function x y (Nativeint.>= x y)) + eta_gen_cmp = (function prim prim stub (caml_compare prim prim)) + eta_int_cmp = (function prim prim stub (caml_int_compare prim prim)) + eta_bool_cmp = (function prim prim stub (caml_int_compare prim prim)) + eta_intlike_cmp = (function prim prim stub (caml_int_compare prim prim)) + eta_float_cmp = (function prim prim stub (caml_float_compare prim prim)) + eta_string_cmp = + (function prim prim stub (caml_string_compare prim prim)) + eta_int32_cmp = (function prim prim stub (caml_int32_compare prim prim)) + eta_int64_cmp = (function prim prim stub (caml_int64_compare prim prim)) + eta_nativeint_cmp = + (function prim prim stub (caml_nativeint_compare prim prim)) + eta_gen_eq = (function prim prim stub (caml_equal prim prim)) + eta_int_eq = (function prim prim stub (== prim prim)) + eta_bool_eq = (function prim prim stub (== prim prim)) + eta_intlike_eq = (function prim prim stub (== prim prim)) + eta_float_eq = (function prim prim stub (==. prim prim)) + eta_string_eq = (function prim prim stub (caml_string_equal prim prim)) + eta_int32_eq = (function prim prim stub (Int32.== prim prim)) + eta_int64_eq = (function prim prim stub (Int64.== prim prim)) + eta_nativeint_eq = (function prim prim stub (Nativeint.== prim prim)) + eta_gen_ne = (function prim prim stub (caml_notequal prim prim)) + eta_int_ne = (function prim prim stub (!= prim prim)) + eta_bool_ne = (function prim prim stub (!= prim prim)) + eta_intlike_ne = (function prim prim stub (!= prim prim)) + eta_float_ne = (function prim prim stub (!=. prim prim)) + eta_string_ne = + (function prim prim stub (caml_string_notequal prim prim)) + eta_int32_ne = (function prim prim stub (Int32.!= prim prim)) + eta_int64_ne = (function prim prim stub (Int64.!= prim prim)) + eta_nativeint_ne = (function prim prim stub (Nativeint.!= prim prim)) + eta_gen_lt = (function prim prim stub (caml_lessthan prim prim)) + eta_int_lt = (function prim prim stub (< prim prim)) + eta_bool_lt = (function prim prim stub (< prim prim)) + eta_intlike_lt = (function prim prim stub (< prim prim)) + eta_float_lt = (function prim prim stub (<. prim prim)) + eta_string_lt = + (function prim prim stub (caml_string_lessthan prim prim)) + eta_int32_lt = (function prim prim stub (Int32.< prim prim)) + eta_int64_lt = (function prim prim stub (Int64.< prim prim)) + eta_nativeint_lt = (function prim prim stub (Nativeint.< prim prim)) + eta_gen_gt = (function prim prim stub (caml_greaterthan prim prim)) + eta_int_gt = (function prim prim stub (> prim prim)) + eta_bool_gt = (function prim prim stub (> prim prim)) + eta_intlike_gt = (function prim prim stub (> prim prim)) + eta_float_gt = (function prim prim stub (>. prim prim)) + eta_string_gt = + (function prim prim stub (caml_string_greaterthan prim prim)) + eta_int32_gt = (function prim prim stub (Int32.> prim prim)) + eta_int64_gt = (function prim prim stub (Int64.> prim prim)) + eta_nativeint_gt = (function prim prim stub (Nativeint.> prim prim)) + eta_gen_le = (function prim prim stub (caml_lessequal prim prim)) + eta_int_le = (function prim prim stub (<= prim prim)) + eta_bool_le = (function prim prim stub (<= prim prim)) + eta_intlike_le = (function prim prim stub (<= prim prim)) + eta_float_le = (function prim prim stub (<=. prim prim)) + eta_string_le = + (function prim prim stub (caml_string_lessequal prim prim)) + eta_int32_le = (function prim prim stub (Int32.<= prim prim)) + eta_int64_le = (function prim prim stub (Int64.<= prim prim)) + eta_nativeint_le = (function prim prim stub (Nativeint.<= prim prim)) + eta_gen_ge = (function prim prim stub (caml_greaterequal prim prim)) + eta_int_ge = (function prim prim stub (>= prim prim)) + eta_bool_ge = (function prim prim stub (>= prim prim)) + eta_intlike_ge = (function prim prim stub (>= prim prim)) + eta_float_ge = (function prim prim stub (>=. prim prim)) + eta_string_ge = + (function prim prim stub (caml_string_greaterequal prim prim)) + eta_int32_ge = (function prim prim stub (Int32.>= prim prim)) + eta_int64_ge = (function prim prim stub (Int64.>= prim prim)) + eta_nativeint_ge = (function prim prim stub (Nativeint.>= prim prim)) + int_vec = [0: [0: 1 1] [0: [0: 1 2] [0: [0: 2 1] 0a]]] + bool_vec = [0: [0: 0a 0a] [0: [0: 0a 1a] [0: [0: 1a 0a] 0a]]] + intlike_vec = [0: [0: 0a 0a] [0: [0: 0a 1a] [0: [0: 1a 0a] 0a]]] + float_vec = [0: [0: 1. 1.] [0: [0: 1. 2.] [0: [0: 2. 1.] 0a]]] + string_vec = [0: [0: "1" "1"] [0: [0: "1" "2"] [0: [0: "2" "1"] 0a]]] + int32_vec = [0: [0: 1l 1l] [0: [0: 1l 2l] [0: [0: 2l 1l] 0a]]] + int64_vec = [0: [0: 1L 1L] [0: [0: 1L 2L] [0: [0: 2L 1L] 0a]]] + nativeint_vec = [0: [0: 1n 1n] [0: [0: 1n 2n] [0: [0: 2n 1n] 0a]]] + test_vec = + (function cmp eq ne lt gt le ge vec + (let + (uncurry = + (function f param (apply f (field 0 param) (field 1 param))) + map = + (function f l + (apply (field 16 (global Stdlib__list!)) (apply uncurry f) l))) + (makeblock 0 + (makeblock 0 (apply map gen_cmp vec) (apply map cmp vec)) + (apply map + (function gen spec + (makeblock 0 (apply map gen vec) (apply map spec vec))) + (makeblock 0 (makeblock 0 gen_eq eq) + (makeblock 0 (makeblock 0 gen_ne ne) + (makeblock 0 (makeblock 0 gen_lt lt) + (makeblock 0 (makeblock 0 gen_gt gt) + (makeblock 0 (makeblock 0 gen_le le) + (makeblock 0 (makeblock 0 gen_ge ge) 0a))))))))))) + (seq + (apply test_vec int_cmp int_eq int_ne int_lt int_gt int_le int_ge + int_vec) + (apply test_vec bool_cmp bool_eq bool_ne bool_lt bool_gt bool_le + bool_ge bool_vec) + (apply test_vec intlike_cmp intlike_eq intlike_ne intlike_lt intlike_gt + intlike_le intlike_ge intlike_vec) + (apply test_vec float_cmp float_eq float_ne float_lt float_gt float_le + float_ge float_vec) + (apply test_vec string_cmp string_eq string_ne string_lt string_gt + string_le string_ge string_vec) + (apply test_vec int32_cmp int32_eq int32_ne int32_lt int32_gt int32_le + int32_ge int32_vec) + (apply test_vec int64_cmp int64_eq int64_ne int64_lt int64_gt int64_le + int64_ge int64_vec) + (apply test_vec nativeint_cmp nativeint_eq nativeint_ne nativeint_lt + nativeint_gt nativeint_le nativeint_ge nativeint_vec) + (let + (eta_test_vec = + (function cmp eq ne lt gt le ge vec + (let + (uncurry = + (function f param + (apply f (field 0 param) (field 1 param))) + map = + (function f l + (apply (field 16 (global Stdlib__list!)) + (apply uncurry f) l))) + (makeblock 0 + (makeblock 0 (apply map eta_gen_cmp vec) + (apply map cmp vec)) + (apply map + (function gen spec + (makeblock 0 (apply map gen vec) (apply map spec vec))) + (makeblock 0 (makeblock 0 eta_gen_eq eq) + (makeblock 0 (makeblock 0 eta_gen_ne ne) + (makeblock 0 (makeblock 0 eta_gen_lt lt) + (makeblock 0 (makeblock 0 eta_gen_gt gt) + (makeblock 0 (makeblock 0 eta_gen_le le) + (makeblock 0 (makeblock 0 eta_gen_ge ge) 0a))))))))))) + (seq + (apply eta_test_vec eta_int_cmp eta_int_eq eta_int_ne eta_int_lt + eta_int_gt eta_int_le eta_int_ge int_vec) + (apply eta_test_vec eta_bool_cmp eta_bool_eq eta_bool_ne + eta_bool_lt eta_bool_gt eta_bool_le eta_bool_ge bool_vec) + (apply eta_test_vec eta_intlike_cmp eta_intlike_eq eta_intlike_ne + eta_intlike_lt eta_intlike_gt eta_intlike_le eta_intlike_ge + intlike_vec) + (apply eta_test_vec eta_float_cmp eta_float_eq eta_float_ne + eta_float_lt eta_float_gt eta_float_le eta_float_ge float_vec) + (apply eta_test_vec eta_string_cmp eta_string_eq eta_string_ne + eta_string_lt eta_string_gt eta_string_le eta_string_ge + string_vec) + (apply eta_test_vec eta_int32_cmp eta_int32_eq eta_int32_ne + eta_int32_lt eta_int32_gt eta_int32_le eta_int32_ge int32_vec) + (apply eta_test_vec eta_int64_cmp eta_int64_eq eta_int64_ne + eta_int64_lt eta_int64_gt eta_int64_le eta_int64_ge int64_vec) + (apply eta_test_vec eta_nativeint_cmp eta_nativeint_eq + eta_nativeint_ne eta_nativeint_lt eta_nativeint_gt + eta_nativeint_le eta_nativeint_ge nativeint_vec) + (makeblock 0 gen_cmp int_cmp bool_cmp intlike_cmp float_cmp + string_cmp int32_cmp int64_cmp nativeint_cmp gen_eq int_eq + bool_eq intlike_eq float_eq string_eq int32_eq int64_eq + nativeint_eq gen_ne int_ne bool_ne intlike_ne float_ne string_ne + int32_ne int64_ne nativeint_ne gen_lt int_lt bool_lt intlike_lt + float_lt string_lt int32_lt int64_lt nativeint_lt gen_gt int_gt + bool_gt intlike_gt float_gt string_gt int32_gt int64_gt + nativeint_gt gen_le int_le bool_le intlike_le float_le string_le + int32_le int64_le nativeint_le gen_ge int_ge bool_ge intlike_ge + float_ge string_ge int32_ge int64_ge nativeint_ge eta_gen_cmp + eta_int_cmp eta_bool_cmp eta_intlike_cmp eta_float_cmp + eta_string_cmp eta_int32_cmp eta_int64_cmp eta_nativeint_cmp + eta_gen_eq eta_int_eq eta_bool_eq eta_intlike_eq eta_float_eq + eta_string_eq eta_int32_eq eta_int64_eq eta_nativeint_eq + eta_gen_ne eta_int_ne eta_bool_ne eta_intlike_ne eta_float_ne + eta_string_ne eta_int32_ne eta_int64_ne eta_nativeint_ne + eta_gen_lt eta_int_lt eta_bool_lt eta_intlike_lt eta_float_lt + eta_string_lt eta_int32_lt eta_int64_lt eta_nativeint_lt + eta_gen_gt eta_int_gt eta_bool_gt eta_intlike_gt eta_float_gt + eta_string_gt eta_int32_gt eta_int64_gt eta_nativeint_gt + eta_gen_le eta_int_le eta_bool_le eta_intlike_le eta_float_le + eta_string_le eta_int32_le eta_int64_le eta_nativeint_le + eta_gen_ge eta_int_ge eta_bool_ge eta_intlike_ge eta_float_ge + eta_string_ge eta_int32_ge eta_int64_ge eta_nativeint_ge int_vec + bool_vec intlike_vec float_vec string_vec int32_vec int64_vec + nativeint_vec test_vec eta_test_vec)))))) diff --git a/testsuite/tests/translprim/comparison_table.ml b/testsuite/tests/translprim/comparison_table.ml index 129ea5c55f..1a91430681 100644 --- a/testsuite/tests/translprim/comparison_table.ml +++ b/testsuite/tests/translprim/comparison_table.ml @@ -1,3 +1,10 @@ +(* TEST + * setup-ocamlc.byte-build-env + ** ocamlc.byte + flags = "-dlambda -dno-unique-ids" + *** check-ocamlc.byte-output +*) + external cmp : 'a -> 'a -> int = "%compare";; external eq : 'a -> 'a -> bool = "%equal";; external ne : 'a -> 'a -> bool = "%notequal";; diff --git a/testsuite/tests/translprim/comparison_table.ml.reference b/testsuite/tests/translprim/comparison_table.ml.reference deleted file mode 100644 index acc22beecf..0000000000 --- a/testsuite/tests/translprim/comparison_table.ml.reference +++ /dev/null @@ -1,375 +0,0 @@ -(setglobal Comparison_table! - (let - (gen_cmp = (function x y (caml_compare x y)) - int_cmp = (function x y (caml_int_compare x y)) - bool_cmp = - (function x y (caml_int_compare x y)) - intlike_cmp = - (function x y (caml_int_compare x y)) - float_cmp = - (function x y (caml_float_compare x y)) - string_cmp = - (function x y (caml_string_compare x y)) - int32_cmp = - (function x y (caml_int32_compare x y)) - int64_cmp = - (function x y (caml_int64_compare x y)) - nativeint_cmp = - (function x y (caml_nativeint_compare x y)) - gen_eq = (function x y (caml_equal x y)) - int_eq = (function x y (== x y)) - bool_eq = (function x y (== x y)) - intlike_eq = (function x y (== x y)) - float_eq = (function x y (==. x y)) - string_eq = - (function x y (caml_string_equal x y)) - int32_eq = (function x y (Int32.== x y)) - int64_eq = (function x y (Int64.== x y)) - nativeint_eq = - (function x y (Nativeint.== x y)) - gen_ne = (function x y (caml_notequal x y)) - int_ne = (function x y (!= x y)) - bool_ne = (function x y (!= x y)) - intlike_ne = (function x y (!= x y)) - float_ne = (function x y (!=. x y)) - string_ne = - (function x y (caml_string_notequal x y)) - int32_ne = (function x y (Int32.!= x y)) - int64_ne = (function x y (Int64.!= x y)) - nativeint_ne = - (function x y (Nativeint.!= x y)) - gen_lt = (function x y (caml_lessthan x y)) - int_lt = (function x y (< x y)) - bool_lt = (function x y (< x y)) - intlike_lt = (function x y (< x y)) - float_lt = (function x y (<. x y)) - string_lt = - (function x y (caml_string_lessthan x y)) - int32_lt = (function x y (Int32.< x y)) - int64_lt = (function x y (Int64.< x y)) - nativeint_lt = (function x y (Nativeint.< x y)) - gen_gt = (function x y (caml_greaterthan x y)) - int_gt = (function x y (> x y)) - bool_gt = (function x y (> x y)) - intlike_gt = (function x y (> x y)) - float_gt = (function x y (>. x y)) - string_gt = - (function x y (caml_string_greaterthan x y)) - int32_gt = (function x y (Int32.> x y)) - int64_gt = (function x y (Int64.> x y)) - nativeint_gt = (function x y (Nativeint.> x y)) - gen_le = (function x y (caml_lessequal x y)) - int_le = (function x y (<= x y)) - bool_le = (function x y (<= x y)) - intlike_le = (function x y (<= x y)) - float_le = (function x y (<=. x y)) - string_le = - (function x y (caml_string_lessequal x y)) - int32_le = (function x y (Int32.<= x y)) - int64_le = (function x y (Int64.<= x y)) - nativeint_le = - (function x y (Nativeint.<= x y)) - gen_ge = (function x y (caml_greaterequal x y)) - int_ge = (function x y (>= x y)) - bool_ge = (function x y (>= x y)) - intlike_ge = (function x y (>= x y)) - float_ge = (function x y (>=. x y)) - string_ge = - (function x y (caml_string_greaterequal x y)) - int32_ge = (function x y (Int32.>= x y)) - int64_ge = (function x y (Int64.>= x y)) - nativeint_ge = - (function x y (Nativeint.>= x y)) - eta_gen_cmp = - (function prim prim stub (caml_compare prim prim)) - eta_int_cmp = - (function prim prim stub - (caml_int_compare prim prim)) - eta_bool_cmp = - (function prim prim stub - (caml_int_compare prim prim)) - eta_intlike_cmp = - (function prim prim stub - (caml_int_compare prim prim)) - eta_float_cmp = - (function prim prim stub - (caml_float_compare prim prim)) - eta_string_cmp = - (function prim prim stub - (caml_string_compare prim prim)) - eta_int32_cmp = - (function prim prim stub - (caml_int32_compare prim prim)) - eta_int64_cmp = - (function prim prim stub - (caml_int64_compare prim prim)) - eta_nativeint_cmp = - (function prim prim stub - (caml_nativeint_compare prim prim)) - eta_gen_eq = - (function prim prim stub (caml_equal prim prim)) - eta_int_eq = - (function prim prim stub (== prim prim)) - eta_bool_eq = - (function prim prim stub (== prim prim)) - eta_intlike_eq = - (function prim prim stub (== prim prim)) - eta_float_eq = - (function prim prim stub (==. prim prim)) - eta_string_eq = - (function prim prim stub - (caml_string_equal prim prim)) - eta_int32_eq = - (function prim prim stub (Int32.== prim prim)) - eta_int64_eq = - (function prim prim stub (Int64.== prim prim)) - eta_nativeint_eq = - (function prim prim stub (Nativeint.== prim prim)) - eta_gen_ne = - (function prim prim stub - (caml_notequal prim prim)) - eta_int_ne = - (function prim prim stub (!= prim prim)) - eta_bool_ne = - (function prim prim stub (!= prim prim)) - eta_intlike_ne = - (function prim prim stub (!= prim prim)) - eta_float_ne = - (function prim prim stub (!=. prim prim)) - eta_string_ne = - (function prim prim stub - (caml_string_notequal prim prim)) - eta_int32_ne = - (function prim prim stub (Int32.!= prim prim)) - eta_int64_ne = - (function prim prim stub (Int64.!= prim prim)) - eta_nativeint_ne = - (function prim prim stub (Nativeint.!= prim prim)) - eta_gen_lt = - (function prim prim stub - (caml_lessthan prim prim)) - eta_int_lt = - (function prim prim stub (< prim prim)) - eta_bool_lt = - (function prim prim stub (< prim prim)) - eta_intlike_lt = - (function prim prim stub (< prim prim)) - eta_float_lt = - (function prim prim stub (<. prim prim)) - eta_string_lt = - (function prim prim stub - (caml_string_lessthan prim prim)) - eta_int32_lt = - (function prim prim stub (Int32.< prim prim)) - eta_int64_lt = - (function prim prim stub (Int64.< prim prim)) - eta_nativeint_lt = - (function prim prim stub (Nativeint.< prim prim)) - eta_gen_gt = - (function prim prim stub - (caml_greaterthan prim prim)) - eta_int_gt = - (function prim prim stub (> prim prim)) - eta_bool_gt = - (function prim prim stub (> prim prim)) - eta_intlike_gt = - (function prim prim stub (> prim prim)) - eta_float_gt = - (function prim prim stub (>. prim prim)) - eta_string_gt = - (function prim prim stub - (caml_string_greaterthan prim prim)) - eta_int32_gt = - (function prim prim stub (Int32.> prim prim)) - eta_int64_gt = - (function prim prim stub (Int64.> prim prim)) - eta_nativeint_gt = - (function prim prim stub (Nativeint.> prim prim)) - eta_gen_le = - (function prim prim stub - (caml_lessequal prim prim)) - eta_int_le = - (function prim prim stub (<= prim prim)) - eta_bool_le = - (function prim prim stub (<= prim prim)) - eta_intlike_le = - (function prim prim stub (<= prim prim)) - eta_float_le = - (function prim prim stub (<=. prim prim)) - eta_string_le = - (function prim prim stub - (caml_string_lessequal prim prim)) - eta_int32_le = - (function prim prim stub (Int32.<= prim prim)) - eta_int64_le = - (function prim prim stub (Int64.<= prim prim)) - eta_nativeint_le = - (function prim prim stub (Nativeint.<= prim prim)) - eta_gen_ge = - (function prim prim stub - (caml_greaterequal prim prim)) - eta_int_ge = - (function prim prim stub (>= prim prim)) - eta_bool_ge = - (function prim prim stub (>= prim prim)) - eta_intlike_ge = - (function prim prim stub (>= prim prim)) - eta_float_ge = - (function prim prim stub (>=. prim prim)) - eta_string_ge = - (function prim prim stub - (caml_string_greaterequal prim prim)) - eta_int32_ge = - (function prim prim stub (Int32.>= prim prim)) - eta_int64_ge = - (function prim prim stub (Int64.>= prim prim)) - eta_nativeint_ge = - (function prim prim stub (Nativeint.>= prim prim)) - int_vec = [0: [0: 1 1] [0: [0: 1 2] [0: [0: 2 1] 0a]]] - bool_vec = [0: [0: 0a 0a] [0: [0: 0a 1a] [0: [0: 1a 0a] 0a]]] - intlike_vec = [0: [0: 0a 0a] [0: [0: 0a 1a] [0: [0: 1a 0a] 0a]]] - float_vec = [0: [0: 1. 1.] [0: [0: 1. 2.] [0: [0: 2. 1.] 0a]]] - string_vec = - [0: [0: "1" "1"] [0: [0: "1" "2"] [0: [0: "2" "1"] 0a]]] - int32_vec = [0: [0: 1l 1l] [0: [0: 1l 2l] [0: [0: 2l 1l] 0a]]] - int64_vec = [0: [0: 1L 1L] [0: [0: 1L 2L] [0: [0: 2L 1L] 0a]]] - nativeint_vec = [0: [0: 1n 1n] [0: [0: 1n 2n] [0: [0: 2n 1n] 0a]]] - test_vec = - (function cmp eq ne lt gt le ge - vec - (let - (uncurry = - (function f param - (apply f (field 0 param) (field 1 param))) - map = - (function f l - (apply (field 16 (global Stdlib__list!)) - (apply uncurry f) l))) - (makeblock 0 - (makeblock 0 (apply map gen_cmp vec) - (apply map cmp vec)) - (apply map - (function gen spec - (makeblock 0 (apply map gen vec) - (apply map spec vec))) - (makeblock 0 (makeblock 0 gen_eq eq) - (makeblock 0 (makeblock 0 gen_ne ne) - (makeblock 0 (makeblock 0 gen_lt lt) - (makeblock 0 (makeblock 0 gen_gt gt) - (makeblock 0 (makeblock 0 gen_le le) - (makeblock 0 (makeblock 0 gen_ge ge) 0a))))))))))) - (seq - (apply test_vec int_cmp int_eq int_ne int_lt - int_gt int_le int_ge int_vec) - (apply test_vec bool_cmp bool_eq bool_ne - bool_lt bool_gt bool_le bool_ge bool_vec) - (apply test_vec intlike_cmp intlike_eq intlike_ne - intlike_lt intlike_gt intlike_le intlike_ge - intlike_vec) - (apply test_vec float_cmp float_eq float_ne - float_lt float_gt float_le float_ge - float_vec) - (apply test_vec string_cmp string_eq string_ne - string_lt string_gt string_le string_ge - string_vec) - (apply test_vec int32_cmp int32_eq int32_ne - int32_lt int32_gt int32_le int32_ge - int32_vec) - (apply test_vec int64_cmp int64_eq int64_ne - int64_lt int64_gt int64_le int64_ge - int64_vec) - (apply test_vec nativeint_cmp nativeint_eq - nativeint_ne nativeint_lt nativeint_gt - nativeint_le nativeint_ge nativeint_vec) - (let - (eta_test_vec = - (function cmp eq ne lt gt le ge - vec - (let - (uncurry = - (function f param - (apply f (field 0 param) (field 1 param))) - map = - (function f l - (apply (field 16 (global Stdlib__list!)) - (apply uncurry f) l))) - (makeblock 0 - (makeblock 0 (apply map eta_gen_cmp vec) - (apply map cmp vec)) - (apply map - (function gen spec - (makeblock 0 (apply map gen vec) - (apply map spec vec))) - (makeblock 0 (makeblock 0 eta_gen_eq eq) - (makeblock 0 (makeblock 0 eta_gen_ne ne) - (makeblock 0 (makeblock 0 eta_gen_lt lt) - (makeblock 0 (makeblock 0 eta_gen_gt gt) - (makeblock 0 (makeblock 0 eta_gen_le le) - (makeblock 0 - (makeblock 0 eta_gen_ge ge) 0a))))))))))) - (seq - (apply eta_test_vec eta_int_cmp eta_int_eq - eta_int_ne eta_int_lt eta_int_gt eta_int_le - eta_int_ge int_vec) - (apply eta_test_vec eta_bool_cmp eta_bool_eq - eta_bool_ne eta_bool_lt eta_bool_gt - eta_bool_le eta_bool_ge bool_vec) - (apply eta_test_vec eta_intlike_cmp eta_intlike_eq - eta_intlike_ne eta_intlike_lt eta_intlike_gt - eta_intlike_le eta_intlike_ge intlike_vec) - (apply eta_test_vec eta_float_cmp eta_float_eq - eta_float_ne eta_float_lt eta_float_gt - eta_float_le eta_float_ge float_vec) - (apply eta_test_vec eta_string_cmp eta_string_eq - eta_string_ne eta_string_lt eta_string_gt - eta_string_le eta_string_ge string_vec) - (apply eta_test_vec eta_int32_cmp eta_int32_eq - eta_int32_ne eta_int32_lt eta_int32_gt - eta_int32_le eta_int32_ge int32_vec) - (apply eta_test_vec eta_int64_cmp eta_int64_eq - eta_int64_ne eta_int64_lt eta_int64_gt - eta_int64_le eta_int64_ge int64_vec) - (apply eta_test_vec eta_nativeint_cmp - eta_nativeint_eq eta_nativeint_ne eta_nativeint_lt - eta_nativeint_gt eta_nativeint_le eta_nativeint_ge - nativeint_vec) - (makeblock 0 gen_cmp int_cmp bool_cmp - intlike_cmp float_cmp string_cmp int32_cmp - int64_cmp nativeint_cmp gen_eq int_eq - bool_eq intlike_eq float_eq string_eq - int32_eq int64_eq nativeint_eq gen_ne - int_ne bool_ne intlike_ne float_ne - string_ne int32_ne int64_ne nativeint_ne - gen_lt int_lt bool_lt intlike_lt - float_lt string_lt int32_lt int64_lt - nativeint_lt gen_gt int_gt bool_gt - intlike_gt float_gt string_gt int32_gt - int64_gt nativeint_gt gen_le int_le - bool_le intlike_le float_le string_le - int32_le int64_le nativeint_le gen_ge - int_ge bool_ge intlike_ge float_ge - string_ge int32_ge int64_ge nativeint_ge - eta_gen_cmp eta_int_cmp eta_bool_cmp - eta_intlike_cmp eta_float_cmp eta_string_cmp - eta_int32_cmp eta_int64_cmp eta_nativeint_cmp - eta_gen_eq eta_int_eq eta_bool_eq - eta_intlike_eq eta_float_eq eta_string_eq - eta_int32_eq eta_int64_eq eta_nativeint_eq - eta_gen_ne eta_int_ne eta_bool_ne - eta_intlike_ne eta_float_ne eta_string_ne - eta_int32_ne eta_int64_ne eta_nativeint_ne - eta_gen_lt eta_int_lt eta_bool_lt - eta_intlike_lt eta_float_lt eta_string_lt - eta_int32_lt eta_int64_lt eta_nativeint_lt - eta_gen_gt eta_int_gt eta_bool_gt - eta_intlike_gt eta_float_gt eta_string_gt - eta_int32_gt eta_int64_gt eta_nativeint_gt - eta_gen_le eta_int_le eta_bool_le - eta_intlike_le eta_float_le eta_string_le - eta_int32_le eta_int64_le eta_nativeint_le - eta_gen_ge eta_int_ge eta_bool_ge - eta_intlike_ge eta_float_ge eta_string_ge - eta_int32_ge eta_int64_ge eta_nativeint_ge - int_vec bool_vec intlike_vec float_vec - string_vec int32_vec int64_vec nativeint_vec - test_vec eta_test_vec)))))) diff --git a/testsuite/tests/translprim/module_coercion.compilers.reference.flat b/testsuite/tests/translprim/module_coercion.compilers.reference.flat new file mode 100644 index 0000000000..b70909ee83 --- /dev/null +++ b/testsuite/tests/translprim/module_coercion.compilers.reference.flat @@ -0,0 +1,87 @@ +(setglobal Module_coercion! + (let (M = (module-defn(M) module_coercion.ml(13):417-1116 (makeblock 0))) + (makeblock 0 M + (module-defn(M_int) module_coercion.ml(44):1533-1572 + (makeblock 0 (function prim stub (array.length[int] prim)) + (function prim prim stub (array.get[int] prim prim)) + (function prim prim stub (array.unsafe_get[int] prim prim)) + (function prim prim prim stub (array.set[int] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[int] prim prim prim)) + (function prim prim stub (caml_int_compare prim prim)) + (function prim prim stub (== prim prim)) + (function prim prim stub (!= prim prim)) + (function prim prim stub (< prim prim)) + (function prim prim stub (> prim prim)) + (function prim prim stub (<= prim prim)) + (function prim prim stub (>= prim prim)))) + (module-defn(M_float) module_coercion.ml(45):1575-1618 + (makeblock 0 (function prim stub (array.length[float] prim)) + (function prim prim stub (array.get[float] prim prim)) + (function prim prim stub (array.unsafe_get[float] prim prim)) + (function prim prim prim stub (array.set[float] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[float] prim prim prim)) + (function prim prim stub (caml_float_compare prim prim)) + (function prim prim stub (==. prim prim)) + (function prim prim stub (!=. prim prim)) + (function prim prim stub (<. prim prim)) + (function prim prim stub (>. prim prim)) + (function prim prim stub (<=. prim prim)) + (function prim prim stub (>=. prim prim)))) + (module-defn(M_string) module_coercion.ml(46):1621-1666 + (makeblock 0 (function prim stub (array.length[addr] prim)) + (function prim prim stub (array.get[addr] prim prim)) + (function prim prim stub (array.unsafe_get[addr] prim prim)) + (function prim prim prim stub (array.set[addr] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[addr] prim prim prim)) + (function prim prim stub (caml_string_compare prim prim)) + (function prim prim stub (caml_string_equal prim prim)) + (function prim prim stub (caml_string_notequal prim prim)) + (function prim prim stub (caml_string_lessthan prim prim)) + (function prim prim stub (caml_string_greaterthan prim prim)) + (function prim prim stub (caml_string_lessequal prim prim)) + (function prim prim stub (caml_string_greaterequal prim prim)))) + (module-defn(M_int32) module_coercion.ml(47):1669-1712 + (makeblock 0 (function prim stub (array.length[addr] prim)) + (function prim prim stub (array.get[addr] prim prim)) + (function prim prim stub (array.unsafe_get[addr] prim prim)) + (function prim prim prim stub (array.set[addr] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[addr] prim prim prim)) + (function prim prim stub (caml_int32_compare prim prim)) + (function prim prim stub (Int32.== prim prim)) + (function prim prim stub (Int32.!= prim prim)) + (function prim prim stub (Int32.< prim prim)) + (function prim prim stub (Int32.> prim prim)) + (function prim prim stub (Int32.<= prim prim)) + (function prim prim stub (Int32.>= prim prim)))) + (module-defn(M_int64) module_coercion.ml(48):1715-1758 + (makeblock 0 (function prim stub (array.length[addr] prim)) + (function prim prim stub (array.get[addr] prim prim)) + (function prim prim stub (array.unsafe_get[addr] prim prim)) + (function prim prim prim stub (array.set[addr] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[addr] prim prim prim)) + (function prim prim stub (caml_int64_compare prim prim)) + (function prim prim stub (Int64.== prim prim)) + (function prim prim stub (Int64.!= prim prim)) + (function prim prim stub (Int64.< prim prim)) + (function prim prim stub (Int64.> prim prim)) + (function prim prim stub (Int64.<= prim prim)) + (function prim prim stub (Int64.>= prim prim)))) + (module-defn(M_nativeint) module_coercion.ml(49):1761-1812 + (makeblock 0 (function prim stub (array.length[addr] prim)) + (function prim prim stub (array.get[addr] prim prim)) + (function prim prim stub (array.unsafe_get[addr] prim prim)) + (function prim prim prim stub (array.set[addr] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[addr] prim prim prim)) + (function prim prim stub (caml_nativeint_compare prim prim)) + (function prim prim stub (Nativeint.== prim prim)) + (function prim prim stub (Nativeint.!= prim prim)) + (function prim prim stub (Nativeint.< prim prim)) + (function prim prim stub (Nativeint.> prim prim)) + (function prim prim stub (Nativeint.<= prim prim)) + (function prim prim stub (Nativeint.>= prim prim))))))) diff --git a/testsuite/tests/translprim/module_coercion.compilers.reference.no-flat b/testsuite/tests/translprim/module_coercion.compilers.reference.no-flat new file mode 100644 index 0000000000..3a9503ee63 --- /dev/null +++ b/testsuite/tests/translprim/module_coercion.compilers.reference.no-flat @@ -0,0 +1,87 @@ +(setglobal Module_coercion! + (let (M = (module-defn(M) module_coercion.ml(13):417-1116 (makeblock 0))) + (makeblock 0 M + (module-defn(M_int) module_coercion.ml(44):1533-1572 + (makeblock 0 (function prim stub (array.length[int] prim)) + (function prim prim stub (array.get[int] prim prim)) + (function prim prim stub (array.unsafe_get[int] prim prim)) + (function prim prim prim stub (array.set[int] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[int] prim prim prim)) + (function prim prim stub (caml_int_compare prim prim)) + (function prim prim stub (== prim prim)) + (function prim prim stub (!= prim prim)) + (function prim prim stub (< prim prim)) + (function prim prim stub (> prim prim)) + (function prim prim stub (<= prim prim)) + (function prim prim stub (>= prim prim)))) + (module-defn(M_float) module_coercion.ml(45):1575-1618 + (makeblock 0 (function prim stub (array.length[addr] prim)) + (function prim prim stub (array.get[addr] prim prim)) + (function prim prim stub (array.unsafe_get[addr] prim prim)) + (function prim prim prim stub (array.set[addr] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[addr] prim prim prim)) + (function prim prim stub (caml_float_compare prim prim)) + (function prim prim stub (==. prim prim)) + (function prim prim stub (!=. prim prim)) + (function prim prim stub (<. prim prim)) + (function prim prim stub (>. prim prim)) + (function prim prim stub (<=. prim prim)) + (function prim prim stub (>=. prim prim)))) + (module-defn(M_string) module_coercion.ml(46):1621-1666 + (makeblock 0 (function prim stub (array.length[addr] prim)) + (function prim prim stub (array.get[addr] prim prim)) + (function prim prim stub (array.unsafe_get[addr] prim prim)) + (function prim prim prim stub (array.set[addr] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[addr] prim prim prim)) + (function prim prim stub (caml_string_compare prim prim)) + (function prim prim stub (caml_string_equal prim prim)) + (function prim prim stub (caml_string_notequal prim prim)) + (function prim prim stub (caml_string_lessthan prim prim)) + (function prim prim stub (caml_string_greaterthan prim prim)) + (function prim prim stub (caml_string_lessequal prim prim)) + (function prim prim stub (caml_string_greaterequal prim prim)))) + (module-defn(M_int32) module_coercion.ml(47):1669-1712 + (makeblock 0 (function prim stub (array.length[addr] prim)) + (function prim prim stub (array.get[addr] prim prim)) + (function prim prim stub (array.unsafe_get[addr] prim prim)) + (function prim prim prim stub (array.set[addr] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[addr] prim prim prim)) + (function prim prim stub (caml_int32_compare prim prim)) + (function prim prim stub (Int32.== prim prim)) + (function prim prim stub (Int32.!= prim prim)) + (function prim prim stub (Int32.< prim prim)) + (function prim prim stub (Int32.> prim prim)) + (function prim prim stub (Int32.<= prim prim)) + (function prim prim stub (Int32.>= prim prim)))) + (module-defn(M_int64) module_coercion.ml(48):1715-1758 + (makeblock 0 (function prim stub (array.length[addr] prim)) + (function prim prim stub (array.get[addr] prim prim)) + (function prim prim stub (array.unsafe_get[addr] prim prim)) + (function prim prim prim stub (array.set[addr] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[addr] prim prim prim)) + (function prim prim stub (caml_int64_compare prim prim)) + (function prim prim stub (Int64.== prim prim)) + (function prim prim stub (Int64.!= prim prim)) + (function prim prim stub (Int64.< prim prim)) + (function prim prim stub (Int64.> prim prim)) + (function prim prim stub (Int64.<= prim prim)) + (function prim prim stub (Int64.>= prim prim)))) + (module-defn(M_nativeint) module_coercion.ml(49):1761-1812 + (makeblock 0 (function prim stub (array.length[addr] prim)) + (function prim prim stub (array.get[addr] prim prim)) + (function prim prim stub (array.unsafe_get[addr] prim prim)) + (function prim prim prim stub (array.set[addr] prim prim prim)) + (function prim prim prim stub + (array.unsafe_set[addr] prim prim prim)) + (function prim prim stub (caml_nativeint_compare prim prim)) + (function prim prim stub (Nativeint.== prim prim)) + (function prim prim stub (Nativeint.!= prim prim)) + (function prim prim stub (Nativeint.< prim prim)) + (function prim prim stub (Nativeint.> prim prim)) + (function prim prim stub (Nativeint.<= prim prim)) + (function prim prim stub (Nativeint.>= prim prim))))))) diff --git a/testsuite/tests/translprim/module_coercion.ml b/testsuite/tests/translprim/module_coercion.ml index 041b30341f..86f2ae95bb 100644 --- a/testsuite/tests/translprim/module_coercion.ml +++ b/testsuite/tests/translprim/module_coercion.ml @@ -1,3 +1,15 @@ +(* TEST + * setup-ocamlc.byte-build-env + ** ocamlc.byte + flags = "-dlambda -dno-unique-ids" + *** flat-float-array + **** check-ocamlc.byte-output + compiler_reference = "${test_source_directory}/module_coercion.compilers.reference.flat" + *** no-flat-float-array + **** check-ocamlc.byte-output + compiler_reference = "${test_source_directory}/module_coercion.compilers.reference.no-flat" +*) + module M = struct external len : 'a array -> int = "%array_length" external safe_get : 'a array -> int -> 'a = "%array_safe_get" diff --git a/testsuite/tests/translprim/module_coercion.ml.reference-flat b/testsuite/tests/translprim/module_coercion.ml.reference-flat deleted file mode 100644 index 27cd3f7329..0000000000 --- a/testsuite/tests/translprim/module_coercion.ml.reference-flat +++ /dev/null @@ -1,125 +0,0 @@ -(setglobal Module_coercion! - (let - (M = (module-defn(M) module_coercion.ml(1):0-699 (makeblock 0))) - (makeblock 0 M - (module-defn(M_int) module_coercion.ml(32):1116-1155 - (makeblock 0 (function prim stub (array.length[int] prim)) - (function prim prim stub - (array.get[int] prim prim)) - (function prim prim stub - (array.unsafe_get[int] prim prim)) - (function prim prim prim stub - (array.set[int] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[int] prim prim prim)) - (function prim prim stub - (caml_int_compare prim prim)) - (function prim prim stub (== prim prim)) - (function prim prim stub (!= prim prim)) - (function prim prim stub (< prim prim)) - (function prim prim stub (> prim prim)) - (function prim prim stub (<= prim prim)) - (function prim prim stub (>= prim prim)))) - (module-defn(M_float) module_coercion.ml(33):1158-1201 - (makeblock 0 - (function prim stub (array.length[float] prim)) - (function prim prim stub - (array.get[float] prim prim)) - (function prim prim stub - (array.unsafe_get[float] prim prim)) - (function prim prim prim stub - (array.set[float] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[float] prim prim prim)) - (function prim prim stub - (caml_float_compare prim prim)) - (function prim prim stub (==. prim prim)) - (function prim prim stub (!=. prim prim)) - (function prim prim stub (<. prim prim)) - (function prim prim stub (>. prim prim)) - (function prim prim stub (<=. prim prim)) - (function prim prim stub (>=. prim prim)))) - (module-defn(M_string) module_coercion.ml(34):1204-1249 - (makeblock 0 (function prim stub (array.length[addr] prim)) - (function prim prim stub - (array.get[addr] prim prim)) - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - (function prim prim prim stub - (array.set[addr] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim)) - (function prim prim stub - (caml_string_compare prim prim)) - (function prim prim stub - (caml_string_equal prim prim)) - (function prim prim stub - (caml_string_notequal prim prim)) - (function prim prim stub - (caml_string_lessthan prim prim)) - (function prim prim stub - (caml_string_greaterthan prim prim)) - (function prim prim stub - (caml_string_lessequal prim prim)) - (function prim prim stub - (caml_string_greaterequal prim prim)))) - (module-defn(M_int32/1104) module_coercion.ml(35):1252-1295 - (makeblock 0 (function prim stub (array.length[addr] prim)) - (function prim prim stub - (array.get[addr] prim prim)) - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - (function prim prim prim stub - (array.set[addr] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim)) - (function prim prim stub - (caml_int32_compare prim prim)) - (function prim prim stub (Int32.== prim prim)) - (function prim prim stub (Int32.!= prim prim)) - (function prim prim stub (Int32.< prim prim)) - (function prim prim stub (Int32.> prim prim)) - (function prim prim stub (Int32.<= prim prim)) - (function prim prim stub (Int32.>= prim prim)))) - (module-defn(M_int64/1129) module_coercion.ml(36):1298-1341 - (makeblock 0 (function prim stub (array.length[addr] prim)) - (function prim prim stub - (array.get[addr] prim prim)) - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - (function prim prim prim stub - (array.set[addr] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim)) - (function prim prim stub - (caml_int64_compare prim prim)) - (function prim prim stub (Int64.== prim prim)) - (function prim prim stub (Int64.!= prim prim)) - (function prim prim stub (Int64.< prim prim)) - (function prim prim stub (Int64.> prim prim)) - (function prim prim stub (Int64.<= prim prim)) - (function prim prim stub (Int64.>= prim prim)))) - (module-defn(M_nativeint) module_coercion.ml(37):1344-1395 - (makeblock 0 (function prim stub (array.length[addr] prim)) - (function prim prim stub - (array.get[addr] prim prim)) - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - (function prim prim prim stub - (array.set[addr] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim)) - (function prim prim stub - (caml_nativeint_compare prim prim)) - (function prim prim stub - (Nativeint.== prim prim)) - (function prim prim stub - (Nativeint.!= prim prim)) - (function prim prim stub - (Nativeint.< prim prim)) - (function prim prim stub - (Nativeint.> prim prim)) - (function prim prim stub - (Nativeint.<= prim prim)) - (function prim prim stub - (Nativeint.>= prim prim))))))) diff --git a/testsuite/tests/translprim/module_coercion.ml.reference-noflat b/testsuite/tests/translprim/module_coercion.ml.reference-noflat deleted file mode 100644 index b3cc51bc0d..0000000000 --- a/testsuite/tests/translprim/module_coercion.ml.reference-noflat +++ /dev/null @@ -1,124 +0,0 @@ -(setglobal Module_coercion! - (let - (M = (module-defn(M) module_coercion.ml(1):0-699 (makeblock 0))) - (makeblock 0 M - (module-defn(M_int) module_coercion.ml(32):1116-1155 - (makeblock 0 (function prim stub (array.length[int] prim)) - (function prim prim stub - (array.get[int] prim prim)) - (function prim prim stub - (array.unsafe_get[int] prim prim)) - (function prim prim prim stub - (array.set[int] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[int] prim prim prim)) - (function prim prim stub - (caml_int_compare prim prim)) - (function prim prim stub (== prim prim)) - (function prim prim stub (!= prim prim)) - (function prim prim stub (< prim prim)) - (function prim prim stub (> prim prim)) - (function prim prim stub (<= prim prim)) - (function prim prim stub (>= prim prim)))) - (module-defn(M_float) module_coercion.ml(33):1158-1201 - (makeblock 0 (function prim stub (array.length[addr] prim)) - (function prim prim stub - (array.get[addr] prim prim)) - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - (function prim prim prim stub - (array.set[addr] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim)) - (function prim prim stub - (caml_float_compare prim prim)) - (function prim prim stub (==. prim prim)) - (function prim prim stub (!=. prim prim)) - (function prim prim stub (<. prim prim)) - (function prim prim stub (>. prim prim)) - (function prim prim stub (<=. prim prim)) - (function prim prim stub (>=. prim prim)))) - (module-defn(M_string) module_coercion.ml(34):1204-1249 - (makeblock 0 (function prim stub (array.length[addr] prim)) - (function prim prim stub - (array.get[addr] prim prim)) - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - (function prim prim prim stub - (array.set[addr] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim)) - (function prim prim stub - (caml_string_compare prim prim)) - (function prim prim stub - (caml_string_equal prim prim)) - (function prim prim stub - (caml_string_notequal prim prim)) - (function prim prim stub - (caml_string_lessthan prim prim)) - (function prim prim stub - (caml_string_greaterthan prim prim)) - (function prim prim stub - (caml_string_lessequal prim prim)) - (function prim prim stub - (caml_string_greaterequal prim prim)))) - (module-defn(M_int32/1104) module_coercion.ml(35):1252-1295 - (makeblock 0 (function prim stub (array.length[addr] prim)) - (function prim prim stub - (array.get[addr] prim prim)) - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - (function prim prim prim stub - (array.set[addr] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim)) - (function prim prim stub - (caml_int32_compare prim prim)) - (function prim prim stub (Int32.== prim prim)) - (function prim prim stub (Int32.!= prim prim)) - (function prim prim stub (Int32.< prim prim)) - (function prim prim stub (Int32.> prim prim)) - (function prim prim stub (Int32.<= prim prim)) - (function prim prim stub (Int32.>= prim prim)))) - (module-defn(M_int64/1129) module_coercion.ml(36):1298-1341 - (makeblock 0 (function prim stub (array.length[addr] prim)) - (function prim prim stub - (array.get[addr] prim prim)) - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - (function prim prim prim stub - (array.set[addr] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim)) - (function prim prim stub - (caml_int64_compare prim prim)) - (function prim prim stub (Int64.== prim prim)) - (function prim prim stub (Int64.!= prim prim)) - (function prim prim stub (Int64.< prim prim)) - (function prim prim stub (Int64.> prim prim)) - (function prim prim stub (Int64.<= prim prim)) - (function prim prim stub (Int64.>= prim prim)))) - (module-defn(M_nativeint) module_coercion.ml(37):1344-1395 - (makeblock 0 (function prim stub (array.length[addr] prim)) - (function prim prim stub - (array.get[addr] prim prim)) - (function prim prim stub - (array.unsafe_get[addr] prim prim)) - (function prim prim prim stub - (array.set[addr] prim prim prim)) - (function prim prim prim stub - (array.unsafe_set[addr] prim prim prim)) - (function prim prim stub - (caml_nativeint_compare prim prim)) - (function prim prim stub - (Nativeint.== prim prim)) - (function prim prim stub - (Nativeint.!= prim prim)) - (function prim prim stub - (Nativeint.< prim prim)) - (function prim prim stub - (Nativeint.> prim prim)) - (function prim prim stub - (Nativeint.<= prim prim)) - (function prim prim stub - (Nativeint.>= prim prim))))))) diff --git a/testsuite/tests/translprim/ocamltests b/testsuite/tests/translprim/ocamltests new file mode 100644 index 0000000000..790d6dac84 --- /dev/null +++ b/testsuite/tests/translprim/ocamltests @@ -0,0 +1,4 @@ +array_spec.ml +comparison_table.ml +module_coercion.ml +ref_spec.ml diff --git a/testsuite/tests/translprim/ref_spec.compilers.reference b/testsuite/tests/translprim/ref_spec.compilers.reference new file mode 100644 index 0000000000..72b48d4f0b --- /dev/null +++ b/testsuite/tests/translprim/ref_spec.compilers.reference @@ -0,0 +1,37 @@ +(setglobal Ref_spec! + (let + (int_ref = (makemutable 0 (int) 1) + var_ref = (makemutable 0 65a) + vargen_ref = (makemutable 0 65a) + cst_ref = (makemutable 0 0a) + gen_ref = (makemutable 0 0a) + flt_ref = (makemutable 0 (float) 0.)) + (seq (setfield_imm 0 int_ref 2) (setfield_imm 0 var_ref 66a) + (setfield_ptr 0 vargen_ref [0: 66 0]) (setfield_ptr 0 vargen_ref 67a) + (setfield_imm 0 cst_ref 1a) (setfield_ptr 0 gen_ref [0: "foo"]) + (setfield_ptr 0 gen_ref 0a) (setfield_ptr 0 flt_ref 1.) + (let + (int_rec = (makemutable 0 (*,int) 0a 1) + var_rec = (makemutable 0 0a 65a) + vargen_rec = (makemutable 0 0a 65a) + cst_rec = (makemutable 0 0a 0a) + gen_rec = (makemutable 0 0a 0a) + flt_rec = (makemutable 0 (*,float) 0a 0.) + flt_rec' = (makearray[float] 0. 0.)) + (seq (setfield_imm 1 int_rec 2) (setfield_imm 1 var_rec 66a) + (setfield_ptr 1 vargen_rec [0: 66 0]) + (setfield_ptr 1 vargen_rec 67a) (setfield_imm 1 cst_rec 1a) + (setfield_ptr 1 gen_rec [0: "foo"]) (setfield_ptr 1 gen_rec 0a) + (setfield_ptr 1 flt_rec 1.) (setfloatfield 1 flt_rec' 1.) + (let + (set_open_poly = (function r y (setfield_ptr 0 r y)) + set_open_poly = (function r y (setfield_imm 0 r y)) + set_open_poly = (function r y (setfield_imm 0 r y)) + set_open_poly = (function r y (setfield_imm 0 r y)) + set_open_poly = (function r y (setfield_ptr 0 r y)) + set_open_poly = (function r y (setfield_ptr 0 r y)) + set_open_poly = (function r y (setfield_ptr 0 r y)) + set_open_poly = (function r y (setfield_ptr 0 r y))) + (makeblock 0 int_ref var_ref vargen_ref cst_ref gen_ref flt_ref + int_rec var_rec vargen_rec cst_rec gen_rec flt_rec flt_rec' + set_open_poly))))))) diff --git a/testsuite/tests/translprim/ref_spec.ml b/testsuite/tests/translprim/ref_spec.ml index 068fa884f2..82cbd1eeef 100644 --- a/testsuite/tests/translprim/ref_spec.ml +++ b/testsuite/tests/translprim/ref_spec.ml @@ -1,3 +1,10 @@ +(* TEST + * setup-ocamlc.byte-build-env + ** ocamlc.byte + flags = "-dlambda -dno-unique-ids" + *** check-ocamlc.byte-output +*) + type 'a custom_rec = { x : unit; mutable y : 'a } type float_rec = { w : float; mutable z : float } diff --git a/testsuite/tests/translprim/ref_spec.ml.reference b/testsuite/tests/translprim/ref_spec.ml.reference deleted file mode 100644 index c21b100b90..0000000000 --- a/testsuite/tests/translprim/ref_spec.ml.reference +++ /dev/null @@ -1,50 +0,0 @@ -(setglobal Ref_spec! - (let - (int_ref = (makemutable 0 (int) 1) - var_ref = (makemutable 0 65a) - vargen_ref = (makemutable 0 65a) - cst_ref = (makemutable 0 0a) - gen_ref = (makemutable 0 0a) - flt_ref = (makemutable 0 (float) 0.)) - (seq (setfield_imm 0 int_ref 2) (setfield_imm 0 var_ref 66a) - (setfield_ptr 0 vargen_ref [0: 66 0]) - (setfield_ptr 0 vargen_ref 67a) (setfield_imm 0 cst_ref 1a) - (setfield_ptr 0 gen_ref [0: "foo"]) - (setfield_ptr 0 gen_ref 0a) (setfield_ptr 0 flt_ref 1.) - (let - (int_rec = (makemutable 0 (*,int) 0a 1) - var_rec = (makemutable 0 0a 65a) - vargen_rec = (makemutable 0 0a 65a) - cst_rec = (makemutable 0 0a 0a) - gen_rec = (makemutable 0 0a 0a) - flt_rec = (makemutable 0 (*,float) 0a 0.) - flt_rec' = (makearray[float] 0. 0.)) - (seq (setfield_imm 1 int_rec 2) - (setfield_imm 1 var_rec 66a) - (setfield_ptr 1 vargen_rec [0: 66 0]) - (setfield_ptr 1 vargen_rec 67a) - (setfield_imm 1 cst_rec 1a) - (setfield_ptr 1 gen_rec [0: "foo"]) - (setfield_ptr 1 gen_rec 0a) (setfield_ptr 1 flt_rec 1.) - (setfloatfield 1 flt_rec' 1.) - (let - (set_open_poly = - (function r y (setfield_ptr 0 r y)) - set_open_poly = - (function r y (setfield_imm 0 r y)) - set_open_poly = - (function r y (setfield_imm 0 r y)) - set_open_poly = - (function r y (setfield_imm 0 r y)) - set_open_poly = - (function r y (setfield_ptr 0 r y)) - set_open_poly = - (function r y (setfield_ptr 0 r y)) - set_open_poly = - (function r y (setfield_ptr 0 r y)) - set_open_poly = - (function r y (setfield_ptr 0 r y))) - (makeblock 0 int_ref var_ref vargen_ref - cst_ref gen_ref flt_ref int_rec - var_rec vargen_rec cst_rec gen_rec - flt_rec flt_rec' set_open_poly))))))) |
