summaryrefslogtreecommitdiff
path: root/ocaml-binary-annot/testsuite/tests/tool-ocaml/t193-setfloatfield-2.ml
blob: 7dde0a2cf57cf862c2447c2c19c8c30dbdf472eb (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 : float;
  mutable b : float;
};;

let x = { a = 0.1; b = 0.2 } in
x.b <- 0.3;
if x.b <> 0.3 then raise Not_found
;;

(**
       0 CONSTINT 42
       2 PUSHACC0 
       3 MAKEBLOCK1 0
       5 POP 1
       7 SETGLOBAL Lib
       9 GETGLOBAL 0.2
      11 PUSHGETGLOBAL 0.1
      13 MAKEFLOATBLOCK 2
      15 PUSHGETGLOBAL 0.3
      17 PUSHACC1 
      18 SETFLOATFIELD 1
      20 GETGLOBAL 0.3
      22 PUSHACC1 
      23 GETFLOATFIELD 1
      25 C_CALL2 neq_float
      27 BRANCHIFNOT 34
      29 GETGLOBAL Not_found
      31 MAKEBLOCK1 0
      33 RAISE 
      34 POP 1
      36 ATOM0 
      37 SETGLOBAL T193-setfloatfield-2
      39 STOP 
**)