@@ -58,6 +58,14 @@ let () = print_endline "Success!"
58
58
let () = print_endline " Testing optimization (this is a no-op in bytecode)..."
59
59
60
60
let () =
61
+ (* Both classic mode and optimized mode should be able to statically
62
+ allocate the inconstant list. *)
63
+ let s = Sys. opaque_identity " foo" in
64
+ let bytes_start0 = Gc. allocated_bytes () in
65
+ let bytes_start1 = Gc. allocated_bytes () in
66
+ let _ =
67
+ Sys. opaque_identity [A #4.0 ; B (" B" , #5.0 ); C (" C" , #6.0 , 6 ); D s]
68
+ in
61
69
match Sys. backend_type with
62
70
| Bytecode -> ()
63
71
| Native | Other _ ->
@@ -74,14 +82,6 @@ let () =
74
82
== (Sys. opaque_identity create_a) () );
75
83
assert ((Sys. opaque_identity create_vs) ()
76
84
== (Sys. opaque_identity create_vs) () );
77
- (* Both classic mode and optimized mode should be able to statically
78
- allocate the inconstant list. *)
79
- let s = Sys. opaque_identity " foo" in
80
- let bytes_start0 = Gc. allocated_bytes () in
81
- let bytes_start1 = Gc. allocated_bytes () in
82
- let _ =
83
- Sys. opaque_identity [A #4.0 ; B (" B" , #5.0 ); C (" C" , #6.0 , 6 ); D s]
84
- in
85
85
let bytes_end = Gc. allocated_bytes () in
86
86
assert (bytes_start0 +. bytes_end = 2. *. bytes_start1)
87
87
;;
0 commit comments