summaryrefslogtreecommitdiff
path: root/testsuite/tests/translprim/array_spec.ml.reference-noflat
blob: ba90062d4110518ec3e3cf4045af7b545d93968c (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
(setglobal Array_spec!
  (let
    (int_a = (makearray[int] 1 2 3)
     float_a = (makearray[addr] 1. 2. 3.)
     addr_a = (makearray[addr] "a" "b" "c"))
    (seq (array.length[int] int_a) (array.length[addr] float_a)
      (array.length[addr] addr_a)
      (function a (array.length[addr] a))
      (array.get[int] int_a 0) (array.get[addr] float_a 0)
      (array.get[addr] addr_a 0)
      (function a (array.get[addr] a 0))
      (array.unsafe_get[int] int_a 0)
      (array.unsafe_get[addr] float_a 0)
      (array.unsafe_get[addr] addr_a 0)
      (function a (array.unsafe_get[addr] a 0))
      (array.set[int] int_a 0 1) (array.set[addr] float_a 0 1.)
      (array.set[addr] addr_a 0 "a")
      (function a x (array.set[addr] a 0 x))
      (array.unsafe_set[int] int_a 0 1)
      (array.unsafe_set[addr] float_a 0 1.)
      (array.unsafe_set[addr] addr_a 0 "a")
      (function a x (array.unsafe_set[addr] a 0 x))
      (let
        (eta_gen_len =
           (function prim stub (array.length[addr] prim))
         eta_gen_safe_get =
           (function prim prim stub
             (array.get[addr] prim prim))
         eta_gen_unsafe_get =
           (function prim prim stub
             (array.unsafe_get[addr] prim prim))
         eta_gen_safe_set =
           (function prim prim prim stub
             (array.set[addr] prim prim prim))
         eta_gen_unsafe_set =
           (function prim prim prim stub
             (array.unsafe_set[addr] prim prim prim))
         eta_int_len =
           (function prim stub (array.length[int] prim))
         eta_int_safe_get =
           (function prim prim stub
             (array.get[int] prim prim))
         eta_int_unsafe_get =
           (function prim prim stub
             (array.unsafe_get[int] prim prim))
         eta_int_safe_set =
           (function prim prim prim stub
             (array.set[int] prim prim prim))
         eta_int_unsafe_set =
           (function prim prim prim stub
             (array.unsafe_set[int] prim prim prim))
         eta_float_len =
           (function prim stub (array.length[addr] prim))
         eta_float_safe_get =
           (function prim prim stub
             (array.get[addr] prim prim))
         eta_float_unsafe_get =
           (function prim prim stub
             (array.unsafe_get[addr] prim prim))
         eta_float_safe_set =
           (function prim prim prim stub
             (array.set[addr] prim prim prim))
         eta_float_unsafe_set =
           (function prim prim prim stub
             (array.unsafe_set[addr] prim prim prim))
         eta_addr_len =
           (function prim stub (array.length[addr] prim))
         eta_addr_safe_get =
           (function prim prim stub
             (array.get[addr] prim prim))
         eta_addr_unsafe_get =
           (function prim prim stub
             (array.unsafe_get[addr] prim prim))
         eta_addr_safe_set =
           (function prim prim prim stub
             (array.set[addr] prim prim prim))
         eta_addr_unsafe_set =
           (function prim prim prim stub
             (array.unsafe_set[addr] prim prim prim)))
        (makeblock 0 int_a float_a addr_a eta_gen_len
          eta_gen_safe_get eta_gen_unsafe_get eta_gen_safe_set
          eta_gen_unsafe_set eta_int_len eta_int_safe_get
          eta_int_unsafe_get eta_int_safe_set
          eta_int_unsafe_set eta_float_len eta_float_safe_get
          eta_float_unsafe_get eta_float_safe_set
          eta_float_unsafe_set eta_addr_len eta_addr_safe_get
          eta_addr_unsafe_get eta_addr_safe_set
          eta_addr_unsafe_set)))))