summaryrefslogtreecommitdiffstats
path: root/testsuite/tests/tool-ocaml/t210-setfield0.ml
blob: aa31d41fe4eb44875863980427d7980176333beb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
open Lib;;
type t = {
  mutable a : int;
};;

let x = {a = 7} in
x.a <- 11;
if x.a <> 11 then raise Not_found;
x
;;

(**
       0 CONSTINT 42
       2 PUSHACC0 
       3 MAKEBLOCK1 0
       5 POP 1
       7 SETGLOBAL Lib
       9 CONSTINT 7
      11 MAKEBLOCK1 0
      13 PUSHCONSTINT 11
      15 PUSHACC1 
      16 SETFIELD0 
      17 CONSTINT 11
      19 PUSHACC1 
      20 GETFIELD0 
      21 NEQ 
      22 BRANCHIFNOT 29
      24 GETGLOBAL Not_found
      26 MAKEBLOCK1 0
      28 RAISE 
      29 ACC0 
      30 POP 1
      32 ATOM0 
      33 SETGLOBAL T210-setfield0
      35 STOP 
**)