diff options
Diffstat (limited to 'ocaml-binary-annot/testsuite/tests/tool-ocaml/t210-setfield3.ml')
| -rw-r--r-- | ocaml-binary-annot/testsuite/tests/tool-ocaml/t210-setfield3.ml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/ocaml-binary-annot/testsuite/tests/tool-ocaml/t210-setfield3.ml b/ocaml-binary-annot/testsuite/tests/tool-ocaml/t210-setfield3.ml new file mode 100644 index 0000000000..d50d2c2a63 --- /dev/null +++ b/ocaml-binary-annot/testsuite/tests/tool-ocaml/t210-setfield3.ml @@ -0,0 +1,42 @@ +open Lib;; +type t = { + mutable a : int; + mutable b : int; + mutable c : int; + mutable d : int; +};; + +let x = {a = 7; b = 6; c = 5; d = 4} in +x.d <- 11; +if x.d <> 11 then raise Not_found; +x +;; + +(** + 0 CONSTINT 42 + 2 PUSHACC0 + 3 MAKEBLOCK1 0 + 5 POP 1 + 7 SETGLOBAL Lib + 9 CONSTINT 4 + 11 PUSHCONSTINT 5 + 13 PUSHCONSTINT 6 + 15 PUSHCONSTINT 7 + 17 MAKEBLOCK 4, 0 + 20 PUSHCONSTINT 11 + 22 PUSHACC1 + 23 SETFIELD3 + 24 CONSTINT 11 + 26 PUSHACC1 + 27 GETFIELD3 + 28 NEQ + 29 BRANCHIFNOT 36 + 31 GETGLOBAL Not_found + 33 MAKEBLOCK1 0 + 35 RAISE + 36 ACC0 + 37 POP 1 + 39 ATOM0 + 40 SETGLOBAL T210-setfield3 + 42 STOP +**) |
