summaryrefslogtreecommitdiff
path: root/testsuite/tests/asmcomp
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/asmcomp')
-rw-r--r--testsuite/tests/asmcomp/bind_tuples.ml2
-rw-r--r--testsuite/tests/asmcomp/compare.ml2
-rw-r--r--testsuite/tests/asmcomp/evaluation_order.ml3
-rw-r--r--testsuite/tests/asmcomp/func_sections.ml33
-rw-r--r--testsuite/tests/asmcomp/lift_mutable_let_flambda.ml4
-rw-r--r--testsuite/tests/asmcomp/optargs.ml4
-rw-r--r--testsuite/tests/asmcomp/poll_attr_both.ml34
-rw-r--r--testsuite/tests/asmcomp/poll_attr_inserted.ml20
-rw-r--r--testsuite/tests/asmcomp/poll_attr_prologue.ml34
-rw-r--r--testsuite/tests/asmcomp/poll_attr_user.ml34
-rw-r--r--testsuite/tests/asmcomp/polling_insertion.ml8
-rw-r--r--testsuite/tests/asmcomp/prevent_fma.ml2
-rw-r--r--testsuite/tests/asmcomp/register_typing.ml2
-rw-r--r--testsuite/tests/asmcomp/register_typing_switch.ml2
-rw-r--r--testsuite/tests/asmcomp/select_addr.ml14
-rw-r--r--testsuite/tests/asmcomp/select_addr.reference1
-rw-r--r--testsuite/tests/asmcomp/staticalloc.ml6
-rw-r--r--testsuite/tests/asmcomp/unrolling_flambda.ml4
-rw-r--r--testsuite/tests/asmcomp/unrolling_flambda2.ml4
19 files changed, 138 insertions, 75 deletions
diff --git a/testsuite/tests/asmcomp/bind_tuples.ml b/testsuite/tests/asmcomp/bind_tuples.ml
index 156b08721e..384965b428 100644
--- a/testsuite/tests/asmcomp/bind_tuples.ml
+++ b/testsuite/tests/asmcomp/bind_tuples.ml
@@ -1,5 +1,5 @@
(* TEST
- * native
+ native;
*)
(* Check the effectiveness of optimized compilation of tuple binding
diff --git a/testsuite/tests/asmcomp/compare.ml b/testsuite/tests/asmcomp/compare.ml
index b51116e372..1a14c4dd32 100644
--- a/testsuite/tests/asmcomp/compare.ml
+++ b/testsuite/tests/asmcomp/compare.ml
@@ -1,5 +1,5 @@
(* TEST
- * native
+ native;
*)
let[@inline never] float () = print_string "hello\n"; 42.
let[@inline never] f () = compare (float ()) 0.5;;
diff --git a/testsuite/tests/asmcomp/evaluation_order.ml b/testsuite/tests/asmcomp/evaluation_order.ml
index 2fb7f917ff..f9cce72ef5 100644
--- a/testsuite/tests/asmcomp/evaluation_order.ml
+++ b/testsuite/tests/asmcomp/evaluation_order.ml
@@ -1,5 +1,4 @@
-(* TEST
-*)
+(* TEST *)
external unsafe_get : 'a array -> int -> 'a = "%array_unsafe_get"
external caml_bytes_get_16 : bytes -> int -> int = "%caml_bytes_get16"
external caml_bytes_set_16 : bytes -> int -> int -> unit = "%caml_bytes_set16"
diff --git a/testsuite/tests/asmcomp/func_sections.ml b/testsuite/tests/asmcomp/func_sections.ml
index 7a58afc60c..bdfcaf4529 100644
--- a/testsuite/tests/asmcomp/func_sections.ml
+++ b/testsuite/tests/asmcomp/func_sections.ml
@@ -1,18 +1,23 @@
(* TEST
-* function_sections
-flags = "-S -function-sections"
-** arch_arm
-*** native
-reference = "${test_source_directory}/func_sections.arm.reference"
-** arch_arm64
-*** native
-reference = "${test_source_directory}/func_sections.arm.reference"
-** arch_amd64
-*** native
-reference = "${test_source_directory}/func_sections.reference"
-** arch_i386
-*** native
-reference = "${test_source_directory}/func_sections.reference"
+ flags = "-S -function-sections";
+ function_sections;
+ {
+ arch_arm;
+ reference = "${test_source_directory}/func_sections.arm.reference";
+ native;
+ }{
+ arch_arm64;
+ reference = "${test_source_directory}/func_sections.arm.reference";
+ native;
+ }{
+ arch_amd64;
+ reference = "${test_source_directory}/func_sections.reference";
+ native;
+ }{
+ arch_i386;
+ reference = "${test_source_directory}/func_sections.reference";
+ native;
+ }
*)
(* We have a separate reference output for ARM because
diff --git a/testsuite/tests/asmcomp/lift_mutable_let_flambda.ml b/testsuite/tests/asmcomp/lift_mutable_let_flambda.ml
index 8c8b017d49..7f2758ef94 100644
--- a/testsuite/tests/asmcomp/lift_mutable_let_flambda.ml
+++ b/testsuite/tests/asmcomp/lift_mutable_let_flambda.ml
@@ -1,6 +1,6 @@
(* TEST
- * flambda
- ** native
+ flambda;
+ native;
*)
type t = T of { pos : int }
diff --git a/testsuite/tests/asmcomp/optargs.ml b/testsuite/tests/asmcomp/optargs.ml
index 65e4152bf2..32aafd48e0 100644
--- a/testsuite/tests/asmcomp/optargs.ml
+++ b/testsuite/tests/asmcomp/optargs.ml
@@ -1,6 +1,6 @@
(* TEST
- flags = "-g"
- * native
+ flags = "-g";
+ native;
*)
(* Check the effectiveness of inlining the wrapper which fills in
diff --git a/testsuite/tests/asmcomp/poll_attr_both.ml b/testsuite/tests/asmcomp/poll_attr_both.ml
index d67d2fd973..56f6fe4a7f 100644
--- a/testsuite/tests/asmcomp/poll_attr_both.ml
+++ b/testsuite/tests/asmcomp/poll_attr_both.ml
@@ -1,13 +1,13 @@
-(* TEST
- * setup-ocamlopt.byte-build-env
- ** ocamlopt.byte
-ocamlopt_byte_exit_status = "2"
- *** check-ocamlopt.byte-output
-
- * setup-ocamlopt.opt-build-env
- ** ocamlopt.opt
-ocamlopt_opt_exit_status = "2"
- *** check-ocamlopt.opt-output
+(* TEST_BELOW
+(* Blank lines added here to preserve locations. *)
+
+
+
+
+
+
+
+
*)
let[@inline never][@local never] v x = x + 1
@@ -19,3 +19,17 @@ let[@poll error] c x =
ignore(Sys.opaque_identity(42))
done;
x2 + !y
+
+(* TEST
+ {
+ setup-ocamlopt.byte-build-env;
+ ocamlopt_byte_exit_status = "2";
+ ocamlopt.byte;
+ check-ocamlopt.byte-output;
+ }{
+ setup-ocamlopt.opt-build-env;
+ ocamlopt_opt_exit_status = "2";
+ ocamlopt.opt;
+ check-ocamlopt.opt-output;
+ }
+*)
diff --git a/testsuite/tests/asmcomp/poll_attr_inserted.ml b/testsuite/tests/asmcomp/poll_attr_inserted.ml
index 0ea17755b7..2738fe4558 100644
--- a/testsuite/tests/asmcomp/poll_attr_inserted.ml
+++ b/testsuite/tests/asmcomp/poll_attr_inserted.ml
@@ -1,13 +1,15 @@
(* TEST
- * setup-ocamlopt.byte-build-env
- ** ocamlopt.byte
-ocamlopt_byte_exit_status = "2"
- *** check-ocamlopt.byte-output
-
- * setup-ocamlopt.opt-build-env
- ** ocamlopt.opt
-ocamlopt_opt_exit_status = "2"
- *** check-ocamlopt.opt-output
+ {
+ setup-ocamlopt.byte-build-env;
+ ocamlopt_byte_exit_status = "2";
+ ocamlopt.byte;
+ check-ocamlopt.byte-output;
+ }{
+ setup-ocamlopt.opt-build-env;
+ ocamlopt_opt_exit_status = "2";
+ ocamlopt.opt;
+ check-ocamlopt.opt-output;
+ }
*)
let[@poll error] c x =
diff --git a/testsuite/tests/asmcomp/poll_attr_prologue.ml b/testsuite/tests/asmcomp/poll_attr_prologue.ml
index 41b3f6b92f..4e32b79f40 100644
--- a/testsuite/tests/asmcomp/poll_attr_prologue.ml
+++ b/testsuite/tests/asmcomp/poll_attr_prologue.ml
@@ -1,16 +1,30 @@
-(* TEST
- * setup-ocamlopt.byte-build-env
- ** ocamlopt.byte
-ocamlopt_byte_exit_status = "2"
- *** check-ocamlopt.byte-output
-
- * setup-ocamlopt.opt-build-env
- ** ocamlopt.opt
-ocamlopt_opt_exit_status = "2"
- *** check-ocamlopt.opt-output
+(* TEST_BELOW
+(* Blank lines added here to preserve locations. *)
+
+
+
+
+
+
+
+
*)
let[@poll error] rec c x l =
match l with
| [] -> 0
| _ :: tl -> (c[@tailcall]) (x+1) tl
+
+(* TEST
+ {
+ setup-ocamlopt.byte-build-env;
+ ocamlopt_byte_exit_status = "2";
+ ocamlopt.byte;
+ check-ocamlopt.byte-output;
+ }{
+ setup-ocamlopt.opt-build-env;
+ ocamlopt_opt_exit_status = "2";
+ ocamlopt.opt;
+ check-ocamlopt.opt-output;
+ }
+*)
diff --git a/testsuite/tests/asmcomp/poll_attr_user.ml b/testsuite/tests/asmcomp/poll_attr_user.ml
index e807bd60d4..9b68489f26 100644
--- a/testsuite/tests/asmcomp/poll_attr_user.ml
+++ b/testsuite/tests/asmcomp/poll_attr_user.ml
@@ -1,13 +1,13 @@
-(* TEST
- * setup-ocamlopt.byte-build-env
- ** ocamlopt.byte
-ocamlopt_byte_exit_status = "2"
- *** check-ocamlopt.byte-output
-
- * setup-ocamlopt.opt-build-env
- ** ocamlopt.opt
-ocamlopt_opt_exit_status = "2"
- *** check-ocamlopt.opt-output
+(* TEST_BELOW
+(* Blank lines added here to preserve locations. *)
+
+
+
+
+
+
+
+
*)
let[@inline never][@local never] v x = x + 1
@@ -19,3 +19,17 @@ let[@poll error] c x =
ignore(Sys.opaque_identity(ref 42))
done;
x2 + !y
+
+(* TEST
+ {
+ setup-ocamlopt.byte-build-env;
+ ocamlopt_byte_exit_status = "2";
+ ocamlopt.byte;
+ check-ocamlopt.byte-output;
+ }{
+ setup-ocamlopt.opt-build-env;
+ ocamlopt_opt_exit_status = "2";
+ ocamlopt.opt;
+ check-ocamlopt.opt-output;
+ }
+*)
diff --git a/testsuite/tests/asmcomp/polling_insertion.ml b/testsuite/tests/asmcomp/polling_insertion.ml
index f19ae93293..9574ddbe57 100644
--- a/testsuite/tests/asmcomp/polling_insertion.ml
+++ b/testsuite/tests/asmcomp/polling_insertion.ml
@@ -1,8 +1,8 @@
(* TEST
- modules = "polling.c"
- compare_programs = "false"
- * arch64
- ** native
+ modules = "polling.c";
+ compare_programs = "false";
+ arch64;
+ native;
*)
(* This set of tests examine poll insertion behaviour. We do this by requesting
diff --git a/testsuite/tests/asmcomp/prevent_fma.ml b/testsuite/tests/asmcomp/prevent_fma.ml
index 6ce124fce0..79506c9c88 100644
--- a/testsuite/tests/asmcomp/prevent_fma.ml
+++ b/testsuite/tests/asmcomp/prevent_fma.ml
@@ -1,5 +1,5 @@
(* TEST
- * native
+ native;
*)
let ( *. ) x y = Sys.opaque_identity (x *. y)
diff --git a/testsuite/tests/asmcomp/register_typing.ml b/testsuite/tests/asmcomp/register_typing.ml
index 3bf3104f20..424aa16ab3 100644
--- a/testsuite/tests/asmcomp/register_typing.ml
+++ b/testsuite/tests/asmcomp/register_typing.ml
@@ -1,5 +1,5 @@
(* TEST
- * native
+ native;
*)
type 'a typ = Int : int typ | Ptr : int list typ
diff --git a/testsuite/tests/asmcomp/register_typing_switch.ml b/testsuite/tests/asmcomp/register_typing_switch.ml
index 73960c4bcc..f6a3367d7b 100644
--- a/testsuite/tests/asmcomp/register_typing_switch.ml
+++ b/testsuite/tests/asmcomp/register_typing_switch.ml
@@ -1,5 +1,5 @@
(* TEST
- * native
+ native;
*)
type 'a typ = Int : int typ | Ptr : int list typ | Int2 : int typ
diff --git a/testsuite/tests/asmcomp/select_addr.ml b/testsuite/tests/asmcomp/select_addr.ml
new file mode 100644
index 0000000000..25718bbc32
--- /dev/null
+++ b/testsuite/tests/asmcomp/select_addr.ml
@@ -0,0 +1,14 @@
+(* TEST *)
+
+let[@inline never][@local never] f n =
+ let n = Int64.of_int n in
+ let open Int64 in
+ to_int (add n (of_int Int.min_int))
+
+let _ =
+ (* The test only works on architectures where Sys.int_size is 63,
+ as it depends on the exact value of Int.min_int. *)
+ if Sys.int_size <> 63 then
+ Printf.printf "0x4000000000000001\n"
+ else
+ Printf.printf "0x%x\n%!" (f 1)
diff --git a/testsuite/tests/asmcomp/select_addr.reference b/testsuite/tests/asmcomp/select_addr.reference
new file mode 100644
index 0000000000..f7cd3db8cb
--- /dev/null
+++ b/testsuite/tests/asmcomp/select_addr.reference
@@ -0,0 +1 @@
+0x4000000000000001
diff --git a/testsuite/tests/asmcomp/staticalloc.ml b/testsuite/tests/asmcomp/staticalloc.ml
index 8f241847f8..38d5587f0f 100644
--- a/testsuite/tests/asmcomp/staticalloc.ml
+++ b/testsuite/tests/asmcomp/staticalloc.ml
@@ -1,7 +1,7 @@
(* TEST
- include config
- * native
- flags = "config.cmx"
+ include config;
+ flags = "config.cmx";
+ native;
*)
(* Check the effectiveness of structured constant propagation and
diff --git a/testsuite/tests/asmcomp/unrolling_flambda.ml b/testsuite/tests/asmcomp/unrolling_flambda.ml
index dcfcb03303..c7c47b3383 100644
--- a/testsuite/tests/asmcomp/unrolling_flambda.ml
+++ b/testsuite/tests/asmcomp/unrolling_flambda.ml
@@ -1,6 +1,6 @@
(* TEST
- * flambda
- ** native
+ flambda;
+ native;
*)
let rec f x =
diff --git a/testsuite/tests/asmcomp/unrolling_flambda2.ml b/testsuite/tests/asmcomp/unrolling_flambda2.ml
index 3079b7327e..70843c69ec 100644
--- a/testsuite/tests/asmcomp/unrolling_flambda2.ml
+++ b/testsuite/tests/asmcomp/unrolling_flambda2.ml
@@ -1,6 +1,6 @@
(* TEST
- * flambda
- ** native
+ flambda;
+ native;
*)
type t = { fn : t -> t -> int -> unit -> unit }