Skip to content

Commit 401a667

Browse files
committed
update tests
1 parent fabc8ef commit 401a667

20 files changed

+633
-484
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,41 @@
11
(setglobal Anonymous!
22
(seq
33
(ignore
4-
(let (x =[(consts ()) (non_consts ([0: [int], [int]]))] [0: 13 37])
4+
(let
5+
(x, debug:Anonymous.0 =[(consts ()) (non_consts ([0: [int], [int]]))]
6+
[0: 13 37])
57
(makeblock 0 x)))
68
(let
7-
(A =
9+
(A, debug:<internal> =
810
(apply (field_imm 0 (global CamlinternalMod!))
911
[0: "anonymous.ml" 25 6] [0: [0]])
10-
B =
12+
B, debug:<internal> =
1113
(apply (field_imm 0 (global CamlinternalMod!))
1214
[0: "anonymous.ml" 35 6] [0: [0]]))
1315
(seq
1416
(ignore
15-
(let (x =[(consts ()) (non_consts ([0: [int], [int]]))] [0: 4 2])
17+
(let
18+
(x, debug:Anonymous.14 =[(consts ())
19+
(non_consts ([0: [int], [int]]))]
20+
[0: 4 2])
1621
(makeblock 0 x)))
1722
(apply (field_imm 1 (global CamlinternalMod!)) [0: [0]] A A)
1823
(apply (field_imm 1 (global CamlinternalMod!)) [0: [0]] B
19-
(let (x =[(consts ()) (non_consts ([0: *, *]))] [0: "foo" "bar"])
24+
(let
25+
(x, debug:Anonymous.16 =[(consts ()) (non_consts ([0: *, *]))]
26+
[0: "foo" "bar"])
2027
(makeblock 0)))
2128
(let
22-
(f = (function {nlocal = 0} param : int 0)
23-
s = (makemutable 0 (*) ""))
29+
(f, debug:Anonymous.18 = (function {nlocal = 0} param : int 0)
30+
s, debug:Anonymous.21 = (makemutable 0 (*) ""))
2431
(seq
2532
(ignore
26-
(let (*match* =[int] (setfield_ptr 0 s "Hello World!"))
33+
(let
34+
(*match*, debug:<internal> =[int]
35+
(setfield_ptr 0 s "Hello World!"))
2736
(makeblock 0)))
2837
(let
29-
(drop = (function {nlocal = 0} param : int 0)
30-
*match* =[int] (apply drop (field_mut 0 s)))
38+
(drop, debug:Anonymous.23 =
39+
(function {nlocal = 0} param : int 0)
40+
*match*, debug:<internal> =[int] (apply drop (field_mut 0 s)))
3141
(makeblock 0 A B f s drop))))))))
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,39 @@
11
(seq
22
(ignore
3-
(let (x =[(consts ()) (non_consts ([0: [int], [int]]))] [0: 13 37])
3+
(let
4+
(x, debug:Anonymous.0 =[(consts ()) (non_consts ([0: [int], [int]]))]
5+
[0: 13 37])
46
(makeblock 0 x)))
57
(let
6-
(A =
8+
(A, debug:<internal> =
79
(apply (field_imm 0 (global CamlinternalMod!))
810
[0: "anonymous.ml" 25 6] [0: [0]])
9-
B =
11+
B, debug:<internal> =
1012
(apply (field_imm 0 (global CamlinternalMod!))
1113
[0: "anonymous.ml" 35 6] [0: [0]]))
1214
(seq
1315
(ignore
14-
(let (x =[(consts ()) (non_consts ([0: [int], [int]]))] [0: 4 2])
16+
(let
17+
(x, debug:Anonymous.14 =[(consts ())
18+
(non_consts ([0: [int], [int]]))]
19+
[0: 4 2])
1520
(makeblock 0 x)))
1621
(apply (field_imm 1 (global CamlinternalMod!)) [0: [0]] A A)
1722
(apply (field_imm 1 (global CamlinternalMod!)) [0: [0]] B
18-
(let (x =[(consts ()) (non_consts ([0: *, *]))] [0: "foo" "bar"])
23+
(let
24+
(x, debug:Anonymous.16 =[(consts ()) (non_consts ([0: *, *]))]
25+
[0: "foo" "bar"])
1926
(makeblock 0)))
2027
(let
21-
(f = (function {nlocal = 0} param : int 0)
22-
s = (makemutable 0 (*) ""))
28+
(f, debug:Anonymous.18 = (function {nlocal = 0} param : int 0)
29+
s, debug:Anonymous.21 = (makemutable 0 (*) ""))
2330
(seq
2431
(ignore
25-
(let (*match* =[int] (setfield_ptr 0 s "Hello World!"))
32+
(let
33+
(*match*, debug:<internal> =[int]
34+
(setfield_ptr 0 s "Hello World!"))
2635
(makeblock 0)))
2736
(let
28-
(drop = (function {nlocal = 0} param : int 0)
29-
*match* =[int] (apply drop (field_mut 0 s)))
37+
(drop, debug:Anonymous.23 = (function {nlocal = 0} param : int 0)
38+
*match*, debug:<internal> =[int] (apply drop (field_mut 0 s)))
3039
(makeblock 0 A B f s drop)))))))

testsuite/tests/basic/patmatch_for_multiple.ml

+58-40
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,20 @@ match (3, 2, 1) with
2626
| _ -> false
2727
;;
2828
[%%expect{|
29-
(let (*match*/283 =[int] 3 *match*/284 =[int] 2 *match*/285 =[int] 1)
29+
(let
30+
(*match*/283, debug:<internal> =[int] 3
31+
*match*/284, debug:<internal> =[int] 2
32+
*match*/285, debug:<internal> =[int] 1)
3033
(catch
3134
(catch
3235
(catch (if (!= *match*/284 3) (exit 3) (exit 1)) with (3)
3336
(if (!= *match*/283 1) (exit 2) (exit 1)))
3437
with (2) 0)
3538
with (1) 1))
36-
(let (*match*/283 =[int] 3 *match*/284 =[int] 2 *match*/285 =[int] 1)
39+
(let
40+
(*match*/283, debug:<internal> =[int] 3
41+
*match*/284, debug:<internal> =[int] 2
42+
*match*/285, debug:<internal> =[int] 1)
3743
(catch (if (!= *match*/284 3) (if (!= *match*/283 1) 0 (exit 1)) (exit 1))
3844
with (1) 1))
3945
- : bool = false
@@ -47,31 +53,39 @@ match (3, 2, 1) with
4753
| _ -> false
4854
;;
4955
[%%expect{|
50-
(let (*match*/288 =[int] 3 *match*/289 =[int] 2 *match*/290 =[int] 1)
56+
(let
57+
(*match*/288, debug:<internal> =[int] 3
58+
*match*/289, debug:<internal> =[int] 2
59+
*match*/290, debug:<internal> =[int] 1)
5160
(catch
5261
(catch
5362
(catch
5463
(if (!= *match*/289 3) (exit 6)
5564
(let
56-
(x/292 =a[(consts ()) (non_consts ([0: [int], [int], [int]]))]
65+
(x/292, debug:.0 =a[(consts ())
66+
(non_consts ([0: [int], [int], [int]]))]
5767
(makeblock 0 *match*/288 *match*/289 *match*/290))
5868
(exit 4 x/292)))
5969
with (6)
6070
(if (!= *match*/288 1) (exit 5)
6171
(let
62-
(x/291 =a[(consts ()) (non_consts ([0: [int], [int], [int]]))]
72+
(x/291, debug:.0 =a[(consts ())
73+
(non_consts ([0: [int], [int], [int]]))]
6374
(makeblock 0 *match*/288 *match*/289 *match*/290))
6475
(exit 4 x/291))))
6576
with (5) 0)
66-
with (4 x/286[(consts ()) (non_consts ([0: [int], [int], [int]]))])
77+
with (4 x/286[(consts ()) (non_consts ([0: [int], [int], [int]]))], debug:.0)
6778
(seq (ignore x/286) 1)))
68-
(let (*match*/288 =[int] 3 *match*/289 =[int] 2 *match*/290 =[int] 1)
79+
(let
80+
(*match*/288, debug:<internal> =[int] 3
81+
*match*/289, debug:<internal> =[int] 2
82+
*match*/290, debug:<internal> =[int] 1)
6983
(catch
7084
(if (!= *match*/289 3)
7185
(if (!= *match*/288 1) 0
7286
(exit 4 (makeblock 0 *match*/288 *match*/289 *match*/290)))
7387
(exit 4 (makeblock 0 *match*/288 *match*/289 *match*/290)))
74-
with (4 x/286[(consts ()) (non_consts ([0: [int], [int], [int]]))])
88+
with (4 x/286[(consts ()) (non_consts ([0: [int], [int], [int]]))], debug:.0)
7589
(seq (ignore x/286) 1)))
7690
- : bool = false
7791
|}];;
@@ -104,9 +118,10 @@ let _ = fun a b -> match a, b with
104118
[%%expect {|
105119
(function {nlocal = 0} a/297[int] b/298
106120
[(consts ()) (non_consts ([0: [int], *]))](let
107-
(p/299 =a[(consts ())
108-
(non_consts (
109-
[0: [int], *]))]
121+
(p/299, debug:.8 =a[(consts ())
122+
(non_consts (
123+
[0: [int],
124+
*]))]
110125
(makeblock 0 a/297 b/298))
111126
p/299))
112127
(function {nlocal = 0} a/297[int] b/298
@@ -121,9 +136,10 @@ let _ = fun a b -> match a, b with
121136
[%%expect{|
122137
(function {nlocal = 0} a/301[int] b/302
123138
[(consts ()) (non_consts ([0: [int], *]))](let
124-
(p/303 =a[(consts ())
125-
(non_consts (
126-
[0: [int], *]))]
139+
(p/303, debug:.12 =a[(consts ())
140+
(non_consts (
141+
[0: [int],
142+
*]))]
127143
(makeblock 0 a/301 b/302))
128144
p/303))
129145
(function {nlocal = 0} a/301[int] b/302
@@ -140,8 +156,8 @@ let _ = fun a b -> match a, b with
140156
[(consts ())
141157
(non_consts ([0: [int], [(consts ()) (non_consts ([0: [int], *]))]]))]
142158
(let
143-
(x/309 =a[int] a/307
144-
p/310 =a[(consts ()) (non_consts ([0: [int], *]))]
159+
(x/309, debug:.16 =a[int] a/307
160+
p/310, debug:.17 =a[(consts ()) (non_consts ([0: [int], *]))]
145161
(makeblock 0 a/307 b/308))
146162
(makeblock 0 (int,[(consts ()) (non_consts ([0: [int], *]))]) x/309
147163
p/310)))
@@ -162,8 +178,8 @@ let _ = fun a b -> match a, b with
162178
[(consts ())
163179
(non_consts ([0: [int], [(consts ()) (non_consts ([0: [int], *]))]]))]
164180
(let
165-
(x/315 =a[int] a/313
166-
p/316 =a[(consts ()) (non_consts ([0: [int], *]))]
181+
(x/315, debug:.22 =a[int] a/313
182+
p/316, debug:.23 =a[(consts ()) (non_consts ([0: [int], *]))]
167183
(makeblock 0 a/313 b/314))
168184
(makeblock 0 (int,[(consts ()) (non_consts ([0: [int], *]))]) x/315
169185
p/316)))
@@ -185,14 +201,14 @@ let _ = fun a b -> match a, b with
185201
(non_consts ([0: [int], [(consts ()) (non_consts ([0: [int], [int]]))]]))]
186202
(if a/323
187203
(let
188-
(x/325 =a[int] a/323
189-
p/326 =a[(consts ()) (non_consts ([0: [int], [int]]))]
204+
(x/325, debug:.28 =a[int] a/323
205+
p/326, debug:.29 =a[(consts ()) (non_consts ([0: [int], [int]]))]
190206
(makeblock 0 a/323 b/324))
191207
(makeblock 0 (int,[(consts ()) (non_consts ([0: [int], [int]]))]) x/325
192208
p/326))
193209
(let
194-
(x/327 =a[(consts ()) (non_consts ([0: ]))] b/324
195-
p/328 =a[(consts ()) (non_consts ([0: [int], [int]]))]
210+
(x/327, debug:.30 =a[(consts ()) (non_consts ([0: ]))] b/324
211+
p/328, debug:.31 =a[(consts ()) (non_consts ([0: [int], [int]]))]
196212
(makeblock 0 a/323 b/324))
197213
(makeblock 0 (int,[(consts ()) (non_consts ([0: [int], [int]]))]) x/327
198214
p/328))))
@@ -219,16 +235,17 @@ let _ = fun a b -> match a, b with
219235
(catch
220236
(if a/329
221237
(let
222-
(x/337 =a[int] a/329
223-
p/338 =a[(consts ()) (non_consts ([0: [int], [int]]))]
238+
(x/337, debug:.34 =a[int] a/329
239+
p/338, debug:.35 =a[(consts ()) (non_consts ([0: [int], [int]]))]
224240
(makeblock 0 a/329 b/330))
225241
(exit 10 x/337 p/338))
226242
(let
227-
(x/335 =a[(consts ()) (non_consts ([0: ]))] b/330
228-
p/336 =a[(consts ()) (non_consts ([0: [int], [int]]))]
243+
(x/335, debug:.36 =a[(consts ()) (non_consts ([0: ]))] b/330
244+
p/336, debug:.35 =a[(consts ()) (non_consts ([0: [int], [int]]))]
229245
(makeblock 0 a/329 b/330))
230246
(exit 10 x/335 p/336)))
231-
with (10 x/331[int] p/332[(consts ()) (non_consts ([0: [int], [int]]))])
247+
with (10 x/331[int], debug:.34 p/332[(consts ())
248+
(non_consts ([0: [int], [int]]))], debug:.35)
232249
(makeblock 0 (int,[(consts ()) (non_consts ([0: [int], [int]]))]) x/331
233250
p/332)))
234251
(function {nlocal = 0} a/329[int] b/330[int]
@@ -237,7 +254,8 @@ let _ = fun a b -> match a, b with
237254
(catch
238255
(if a/329 (exit 10 a/329 (makeblock 0 a/329 b/330))
239256
(exit 10 b/330 (makeblock 0 a/329 b/330)))
240-
with (10 x/331[int] p/332[(consts ()) (non_consts ([0: [int], [int]]))])
257+
with (10 x/331[int], debug:.34 p/332[(consts ())
258+
(non_consts ([0: [int], [int]]))], debug:.35)
241259
(makeblock 0 (int,[(consts ()) (non_consts ([0: [int], [int]]))]) x/331
242260
p/332)))
243261
- : bool -> bool -> bool * (bool * bool) = <fun>
@@ -257,14 +275,14 @@ let _ = fun a b -> match a, b with
257275
(non_consts ([0: [int], [(consts ()) (non_consts ([0: [int], [int]]))]]))]
258276
(if a/339
259277
(let
260-
(x/341 =a[int] a/339
261-
_p/342 =a[(consts ()) (non_consts ([0: [int], [int]]))]
278+
(x/341, debug:.40 =a[int] a/339
279+
_p/342, debug:.41 =a[(consts ()) (non_consts ([0: [int], [int]]))]
262280
(makeblock 0 a/339 b/340))
263281
(makeblock 0 (int,[(consts ()) (non_consts ([0: [int], [int]]))]) x/341
264282
[0: 1 1]))
265283
(let
266-
(x/343 =a[int] a/339
267-
p/344 =a[(consts ()) (non_consts ([0: [int], [int]]))]
284+
(x/343, debug:.42 =a[int] a/339
285+
p/344, debug:.43 =a[(consts ()) (non_consts ([0: [int], [int]]))]
268286
(makeblock 0 a/339 b/340))
269287
(makeblock 0 (int,[(consts ()) (non_consts ([0: [int], [int]]))]) x/343
270288
p/344))))
@@ -288,8 +306,8 @@ let _ = fun a b -> match a, b with
288306
[(consts ())
289307
(non_consts ([0: [int], [(consts ()) (non_consts ([0: [int], *]))]]))]
290308
(let
291-
(x/347 =a[int] a/345
292-
p/348 =a[(consts ()) (non_consts ([0: [int], *]))]
309+
(x/347, debug:.46 =a[int] a/345
310+
p/348, debug:.47 =a[(consts ()) (non_consts ([0: [int], *]))]
293311
(makeblock 0 a/345 b/346))
294312
(makeblock 0 (int,[(consts ()) (non_consts ([0: [int], *]))]) x/347
295313
p/348)))
@@ -322,15 +340,15 @@ let _ =fun a b -> match a, b with
322340
(if a/358
323341
(if b/359
324342
(let
325-
(p/360 =a
343+
(p/360, debug:<internal> =a
326344
(field_imm 0
327345
b/359))
328346
p/360)
329347
(exit 12))
330348
(exit 12))
331349
with (12)
332350
(let
333-
(p/361 =a
351+
(p/361, debug:.56 =a
334352
[(consts ())
335353
(non_consts (
336354
[0:
@@ -374,7 +392,7 @@ let _ = fun a b -> match a, b with
374392
(if a/362
375393
(if b/363
376394
(let
377-
(p/367 =a
395+
(p/367, debug:<internal> =a
378396
(field_imm 0
379397
b/363))
380398
(exit 13
@@ -383,7 +401,7 @@ let _ = fun a b -> match a, b with
383401
(exit 14))
384402
with (14)
385403
(let
386-
(p/366 =a
404+
(p/366, debug:.59 =a
387405
[(consts ())
388406
(non_consts (
389407
[0:
@@ -403,7 +421,7 @@ let _ = fun a b -> match a, b with
403421
[int],
404422
[(consts (0))
405423
(non_consts (
406-
[0: *]))]]))])
424+
[0: *]))]]))], debug:.59)
407425
p/364))
408426
(function {nlocal = 0} a/362[int]
409427
b/363[(consts (0))
@@ -430,7 +448,7 @@ let _ = fun a b -> match a, b with
430448
[int],
431449
[(consts (0))
432450
(non_consts (
433-
[0: *]))]]))])
451+
[0: *]))]]))], debug:.59)
434452
p/364))
435453
- : bool -> bool tuplist -> bool * bool tuplist = <fun>
436454
|}]

0 commit comments

Comments
 (0)