diff options
author | Simon Cruanes <simon.cruanes.2007@m4x.org> | 2015-11-12 22:18:14 +0100 |
---|---|---|
committer | Simon Cruanes <simon.cruanes.2007@m4x.org> | 2015-12-06 19:24:31 +0100 |
commit | 6c5665393e1d755c4c7a5ca5687e303224001b93 (patch) | |
tree | 2de0f38cd0bc77828c15cb37c7f28649cad6ba4e /testsuite/tests/translprim | |
parent | b349cb64e9fa70eb8c403aba44715b21bffd6910 (diff) | |
download | ocaml-6c5665393e1d755c4c7a5ca5687e303224001b93.tar.gz |
fix 0007026
- remove write barrier for constant poly variants
- add tests
Diffstat (limited to 'testsuite/tests/translprim')
-rw-r--r-- | testsuite/tests/translprim/ref_spec.ml | 10 | ||||
-rw-r--r-- | testsuite/tests/translprim/ref_spec.ml.reference | 29 |
2 files changed, 33 insertions, 6 deletions
diff --git a/testsuite/tests/translprim/ref_spec.ml b/testsuite/tests/translprim/ref_spec.ml index 37553ef914..3a01bf8dba 100644 --- a/testsuite/tests/translprim/ref_spec.ml +++ b/testsuite/tests/translprim/ref_spec.ml @@ -40,3 +40,13 @@ gen_rec.y <- D "foo";; gen_rec.y <- C;; flt_rec.y <- 1.;; flt_rec'.z <- 1.;; + +(* must use a write barrier, type is open *) +let set_open_poly (r:[>`Foo] ref) y = r := y ;; +let set_open_poly (r:[<`Foo] ref) y = r := y ;; +let set_open_poly (r:[`Foo] ref) y = r := y ;; +let set_open_poly (r:[< `Bar | `Foo | `Baz > `Foo `Bar] ref) y = r := y ;; +let set_open_poly (r:[>`Foo of int] ref) y = r := y ;; +let set_open_poly (r:[<`Foo of int] ref) y = r := y ;; +let set_open_poly (r:[`Foo of int] ref) y = r := y ;; +let set_open_poly (r:[< `Bar | `Foo of float | `Baz > `Foo `Bar] ref) y = r := y ;; diff --git a/testsuite/tests/translprim/ref_spec.ml.reference b/testsuite/tests/translprim/ref_spec.ml.reference index ff0753dc6c..ed1784add8 100644 --- a/testsuite/tests/translprim/ref_spec.ml.reference +++ b/testsuite/tests/translprim/ref_spec.ml.reference @@ -6,7 +6,7 @@ cst_ref = (makemutable 0 0a) gen_ref = (makemutable 0 0a) flt_ref = (makemutable 0 0.)) - (seq (setfield_imm 0 int_ref 2) (setfield_ptr 0 var_ref 66a) + (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"]) @@ -20,14 +20,31 @@ flt_rec = (makemutable 0 0a 0.) flt_rec' = (makearray[float] 0. 0.)) (seq (setfield_imm 1 int_rec 2) - (setfield_ptr 1 var_rec 66a) + (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.) - (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')))))) + (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))))))) |