summaryrefslogtreecommitdiff
path: root/testsuite/tests/tool-ocaml/t180-appterm1.ml
blob: 42e6c323866668bc7582e6e9c87b9b63c522459e (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
42
43
(* TEST
include tool-ocaml-lib
flags = "-w -a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)

open Lib;;
let f _ = 12 in
let g _ = f 0 in
if g 0 <> 12 then raise Not_found
;;

(**
       0 CONSTINT 42
       2 PUSHACC0
       3 MAKEBLOCK1 0
       5 POP 1
       7 SETGLOBAL Lib
       9 BRANCH 19
      11 CONST0
      12 PUSHENVACC1
      13 APPTERM1 2
      15 CONSTINT 12
      17 RETURN 1
      19 CLOSURE 0, 15
      22 PUSHACC0
      23 CLOSURE 1, 11
      26 PUSHCONSTINT 12
      28 PUSHCONST0
      29 PUSHACC2
      30 APPLY1
      31 NEQ
      32 BRANCHIFNOT 39
      34 GETGLOBAL Not_found
      36 MAKEBLOCK1 0
      38 RAISE
      39 POP 2
      41 ATOM0
      42 SETGLOBAL T180-appterm1
      44 STOP
**)