summaryrefslogtreecommitdiff
path: root/testsuite/tests/asmcomp/staticalloc.ml
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2014-03-20 13:27:50 +0000
committerAlain Frisch <alain@frisch.fr>2014-03-20 13:27:50 +0000
commit7578b585a18d135b8787eb3ba9ea3c3b582b8029 (patch)
tree90e25085c2b038d35ba1569b65eee059952441b1 /testsuite/tests/asmcomp/staticalloc.ml
parent8583d7f9d5e411d483d9426e270b0b8e0ecbd65f (diff)
downloadocaml-7578b585a18d135b8787eb3ba9ea3c3b582b8029.tar.gz
Also check sharing of immutable constants.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14470 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'testsuite/tests/asmcomp/staticalloc.ml')
-rw-r--r--testsuite/tests/asmcomp/staticalloc.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/testsuite/tests/asmcomp/staticalloc.ml b/testsuite/tests/asmcomp/staticalloc.ml
index 25f4f56992..e21fdee633 100644
--- a/testsuite/tests/asmcomp/staticalloc.ml
+++ b/testsuite/tests/asmcomp/staticalloc.ml
@@ -11,7 +11,9 @@ let () =
let a = pair 1 2 in
let b = pair a ["x";"y"] in
let g () = (a, fst b) in
- assert (g () == g ());
+ assert (g () == ((1,2), (1,2)));
+ assert (fst (pair a a) == (1, 2));
+ assert (snd b != ["x"; "y"]); (* mutable "constant", cannot be shared *)
let x2 = Gc.allocated_bytes () in
assert(x1 -. x0 = x2 -. x1)
(* check that we did not allocated anything between x1 and x2 *)