summaryrefslogtreecommitdiff
path: root/testsuite/tests/tool-ocaml/t131-setvectitem.ml
blob: 8f7065ea97d849e9d77ef99d0f00ee93372ec3d5 (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
37
38
39
40
41
(* TEST
 include tool-ocaml-lib;
 flags = "-w -a";
 ocaml_script_as_argument = "true";
 setup-ocaml-build-env;
 ocaml;
*)

open Lib;;
let x = [| 1; 2 |] in
x.(0) <- 3;
if x.(0) <> 3 then raise Not_found
;;

(**
       0 CONSTINT 42
       2 PUSHACC0
       3 MAKEBLOCK1 0
       5 POP 1
       7 SETGLOBAL Lib
       9 CONST2
      10 PUSHCONST1
      11 MAKEBLOCK2 0
      13 PUSHCONST3
      14 PUSHCONST0
      15 PUSHACC2
      16 SETVECTITEM
      17 CONST3
      18 PUSHCONST0
      19 PUSHACC2
      20 GETVECTITEM
      21 NEQ
      22 BRANCHIFNOT 29
      24 GETGLOBAL Not_found
      26 MAKEBLOCK1 0
      28 RAISE
      29 POP 1
      31 ATOM0
      32 SETGLOBAL T131-setvectitem
      34 STOP
**)