|
9 | 9 | ;; RUN: cat %t.bin.wast | filecheck %s --check-prefix=CHECK-BIN
|
10 | 10 | ;; RUN: cat %t.bin.nodebug.wast | filecheck %s --check-prefix=CHECK-BIN-NODEBUG
|
11 | 11 |
|
12 |
| -;; Also check that if we emit a binary without custom descriptors enabled, the |
13 |
| -;; types are generalized to be inexact. |
14 |
| - |
15 |
| -;; RUN: wasm-opt %s -all --disable-custom-descriptors -g -o %t.noexact.wasm |
16 |
| -;; RUN: wasm-opt %t.noexact.wasm -all -S -o - | filecheck %s --check-prefix=NO-EXACT |
17 |
| - |
18 | 12 | (module
|
19 | 13 | ;; CHECK-TEXT: (type $foo (struct (field (ref null (exact $foo))) (field (ref (exact $foo)))))
|
20 | 14 | ;; CHECK-BIN: (type $foo (struct (field (ref null (exact $foo))) (field (ref (exact $foo)))))
|
21 |
| - ;; NO-EXACT: (type $foo (struct (field (ref null $foo)) (field (ref $foo)))) |
22 | 15 | (type $foo (struct (field (ref null (exact $foo)) (ref (exact $foo)))))
|
23 | 16 |
|
24 | 17 | (rec
|
25 | 18 | ;; CHECK-TEXT: (rec
|
26 | 19 | ;; CHECK-TEXT-NEXT: (type $super (sub (struct)))
|
27 | 20 | ;; CHECK-BIN: (rec
|
28 | 21 | ;; CHECK-BIN-NEXT: (type $super (sub (struct)))
|
29 |
| - ;; NO-EXACT: (rec |
30 |
| - ;; NO-EXACT-NEXT: (type $super (sub (struct))) |
31 | 22 | (type $super (sub (struct)))
|
32 | 23 | ;; CHECK-TEXT: (type $sub1 (sub $super (struct)))
|
33 | 24 | ;; CHECK-BIN: (type $sub1 (sub $super (struct)))
|
34 |
| - ;; NO-EXACT: (type $sub1 (sub $super (struct))) |
35 | 25 | (type $sub1 (sub $super (struct)))
|
36 | 26 | ;; CHECK-TEXT: (type $sub2 (sub $super (struct)))
|
37 | 27 | ;; CHECK-BIN: (type $sub2 (sub $super (struct)))
|
38 |
| - ;; NO-EXACT: (type $sub2 (sub $super (struct))) |
39 | 28 | (type $sub2 (sub $super (struct)))
|
40 | 29 | )
|
41 | 30 |
|
| 31 | + |
42 | 32 | ;; CHECK-TEXT: (type $4 (func (param (ref null (exact $foo))) (result (ref (exact $foo)))))
|
43 | 33 |
|
44 | 34 | ;; CHECK-TEXT: (type $5 (func (param (ref null (exact $foo)))))
|
|
61 | 51 | ;; CHECK-BIN: (type $8 (func (param (ref null (exact $foo))) (result (ref null (exact $foo)))))
|
62 | 52 |
|
63 | 53 | ;; CHECK-BIN: (import "" "g1" (global $g1 (ref null (exact $foo))))
|
64 |
| - ;; NO-EXACT: (type $4 (func (param (ref null $foo)) (result (ref $foo)))) |
65 |
| - |
66 |
| - ;; NO-EXACT: (type $5 (func (param (ref null $foo)))) |
67 |
| - |
68 |
| - ;; NO-EXACT: (type $6 (func (param (ref null $super)) (result (ref null $super)))) |
69 |
| - |
70 |
| - ;; NO-EXACT: (type $7 (func (param (ref null $sub1)))) |
71 |
| - |
72 |
| - ;; NO-EXACT: (type $8 (func (param (ref null $foo)) (result (ref null $foo)))) |
73 |
| - |
74 |
| - ;; NO-EXACT: (import "" "g1" (global $g1 (ref null $foo))) |
75 | 54 | (import "" "g1" (global $g1 (ref null (exact $foo))))
|
76 | 55 |
|
77 | 56 | ;; CHECK-TEXT: (import "" "g2" (global $g2 (ref (exact $foo))))
|
78 | 57 | ;; CHECK-BIN: (import "" "g2" (global $g2 (ref (exact $foo))))
|
79 |
| - ;; NO-EXACT: (import "" "g2" (global $g2 (ref $foo))) |
80 | 58 | (import "" "g2" (global $g2 (ref (exact $foo))))
|
81 | 59 |
|
82 | 60 | ;; CHECK-TEXT: (func $ref-test (type $5) (param $0 (ref null (exact $foo)))
|
|
103 | 81 | ;; CHECK-BIN-NEXT: )
|
104 | 82 | ;; CHECK-BIN-NEXT: )
|
105 | 83 | ;; CHECK-BIN-NEXT: )
|
106 |
| - ;; NO-EXACT: (func $ref-test (type $5) (param $0 (ref null $foo)) |
107 |
| - ;; NO-EXACT-NEXT: (drop |
108 |
| - ;; NO-EXACT-NEXT: (ref.test (ref $foo) |
109 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
110 |
| - ;; NO-EXACT-NEXT: ) |
111 |
| - ;; NO-EXACT-NEXT: ) |
112 |
| - ;; NO-EXACT-NEXT: (drop |
113 |
| - ;; NO-EXACT-NEXT: (ref.test (ref null $foo) |
114 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
115 |
| - ;; NO-EXACT-NEXT: ) |
116 |
| - ;; NO-EXACT-NEXT: ) |
117 |
| - ;; NO-EXACT-NEXT: ) |
118 | 84 | (func $ref-test (param (ref null (exact $foo)))
|
119 | 85 | (drop
|
120 | 86 | (ref.test (ref (exact $foo))
|
|
162 | 128 | ;; CHECK-BIN-NEXT: )
|
163 | 129 | ;; CHECK-BIN-NEXT: )
|
164 | 130 | ;; CHECK-BIN-NEXT: )
|
165 |
| - ;; NO-EXACT: (func $ref-cast (type $7) (param $0 (ref null $sub1)) |
166 |
| - ;; NO-EXACT-NEXT: (drop |
167 |
| - ;; NO-EXACT-NEXT: (ref.cast (ref $sub1) |
168 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
169 |
| - ;; NO-EXACT-NEXT: ) |
170 |
| - ;; NO-EXACT-NEXT: ) |
171 |
| - ;; NO-EXACT-NEXT: (drop |
172 |
| - ;; NO-EXACT-NEXT: (ref.cast (ref null $sub1) |
173 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
174 |
| - ;; NO-EXACT-NEXT: ) |
175 |
| - ;; NO-EXACT-NEXT: ) |
176 |
| - ;; NO-EXACT-NEXT: (drop |
177 |
| - ;; NO-EXACT-NEXT: (ref.cast (ref none) |
178 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
179 |
| - ;; NO-EXACT-NEXT: ) |
180 |
| - ;; NO-EXACT-NEXT: ) |
181 |
| - ;; NO-EXACT-NEXT: ) |
182 | 131 | (func $ref-cast (param (ref null (exact $sub1)))
|
183 | 132 | (drop
|
184 | 133 | (ref.cast (ref (exact $sub1))
|
|
227 | 176 | ;; CHECK-BIN-NEXT: (local.get $0)
|
228 | 177 | ;; CHECK-BIN-NEXT: )
|
229 | 178 | ;; CHECK-BIN-NEXT: )
|
230 |
| - ;; NO-EXACT: (func $br-on-cast (type $6) (param $0 (ref null $super)) (result (ref null $super)) |
231 |
| - ;; NO-EXACT-NEXT: (block $block (result (ref null $super)) |
232 |
| - ;; NO-EXACT-NEXT: (drop |
233 |
| - ;; NO-EXACT-NEXT: (br_on_cast $block (ref null $super) (ref null $sub1) |
234 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
235 |
| - ;; NO-EXACT-NEXT: ) |
236 |
| - ;; NO-EXACT-NEXT: ) |
237 |
| - ;; NO-EXACT-NEXT: (drop |
238 |
| - ;; NO-EXACT-NEXT: (br_on_cast $block (ref null $super) (ref $sub1) |
239 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
240 |
| - ;; NO-EXACT-NEXT: ) |
241 |
| - ;; NO-EXACT-NEXT: ) |
242 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
243 |
| - ;; NO-EXACT-NEXT: ) |
244 |
| - ;; NO-EXACT-NEXT: ) |
245 | 179 | (func $br-on-cast (param (ref null $super)) (result (ref null $super))
|
246 | 180 | (drop
|
247 | 181 | (br_on_cast 0 anyref (ref null (exact $sub1))
|
|
286 | 220 | ;; CHECK-BIN-NEXT: (local.get $0)
|
287 | 221 | ;; CHECK-BIN-NEXT: )
|
288 | 222 | ;; CHECK-BIN-NEXT: )
|
289 |
| - ;; NO-EXACT: (func $br-on-cast-fail (type $6) (param $0 (ref null $super)) (result (ref null $super)) |
290 |
| - ;; NO-EXACT-NEXT: (block $block (result (ref null $super)) |
291 |
| - ;; NO-EXACT-NEXT: (drop |
292 |
| - ;; NO-EXACT-NEXT: (br_on_cast_fail $block (ref null $super) (ref null $sub1) |
293 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
294 |
| - ;; NO-EXACT-NEXT: ) |
295 |
| - ;; NO-EXACT-NEXT: ) |
296 |
| - ;; NO-EXACT-NEXT: (drop |
297 |
| - ;; NO-EXACT-NEXT: (br_on_cast_fail $block (ref null $super) (ref $sub1) |
298 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
299 |
| - ;; NO-EXACT-NEXT: ) |
300 |
| - ;; NO-EXACT-NEXT: ) |
301 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
302 |
| - ;; NO-EXACT-NEXT: ) |
303 |
| - ;; NO-EXACT-NEXT: ) |
304 | 223 | (func $br-on-cast-fail (param (ref null $super)) (result (ref null $super))
|
305 | 224 | (drop
|
306 | 225 | (br_on_cast_fail 0 anyref (ref null (exact $sub1))
|
|
325 | 244 | ;; CHECK-BIN-NEXT: (local.get $0)
|
326 | 245 | ;; CHECK-BIN-NEXT: )
|
327 | 246 | ;; CHECK-BIN-NEXT: )
|
328 |
| - ;; NO-EXACT: (func $valid-ref-as-non-null (type $4) (param $0 (ref null $foo)) (result (ref $foo)) |
329 |
| - ;; NO-EXACT-NEXT: (ref.as_non_null |
330 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
331 |
| - ;; NO-EXACT-NEXT: ) |
332 |
| - ;; NO-EXACT-NEXT: ) |
333 | 247 | (func $valid-ref-as-non-null (param (ref null (exact $foo))) (result (ref (exact $foo)))
|
334 | 248 | (ref.as_non_null
|
335 | 249 | (local.get 0)
|
|
356 | 270 | ;; CHECK-BIN-NEXT: )
|
357 | 271 | ;; CHECK-BIN-NEXT: )
|
358 | 272 | ;; CHECK-BIN-NEXT: )
|
359 |
| - ;; NO-EXACT: (func $valid-br-on-null (type $5) (param $0 (ref null $foo)) |
360 |
| - ;; NO-EXACT-NEXT: (block $block |
361 |
| - ;; NO-EXACT-NEXT: (drop |
362 |
| - ;; NO-EXACT-NEXT: (br_on_null $block |
363 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
364 |
| - ;; NO-EXACT-NEXT: ) |
365 |
| - ;; NO-EXACT-NEXT: ) |
366 |
| - ;; NO-EXACT-NEXT: ) |
367 |
| - ;; NO-EXACT-NEXT: ) |
368 | 273 | (func $valid-br-on-null (param (ref null (exact $foo)))
|
369 | 274 | (drop
|
370 | 275 | (block (result (ref (exact $foo)))
|
|
391 | 296 | ;; CHECK-BIN-NEXT: (unreachable)
|
392 | 297 | ;; CHECK-BIN-NEXT: )
|
393 | 298 | ;; CHECK-BIN-NEXT: )
|
394 |
| - ;; NO-EXACT: (func $valid-br-on-non-null (type $4) (param $0 (ref null $foo)) (result (ref $foo)) |
395 |
| - ;; NO-EXACT-NEXT: (block $block (result (ref $foo)) |
396 |
| - ;; NO-EXACT-NEXT: (br_on_non_null $block |
397 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
398 |
| - ;; NO-EXACT-NEXT: ) |
399 |
| - ;; NO-EXACT-NEXT: (unreachable) |
400 |
| - ;; NO-EXACT-NEXT: ) |
401 |
| - ;; NO-EXACT-NEXT: ) |
402 | 299 | (func $valid-br-on-non-null (param (ref null (exact $foo))) (result (ref (exact $foo)))
|
403 | 300 | (br_on_non_null 0
|
404 | 301 | (local.get 0)
|
|
428 | 325 | ;; CHECK-BIN-NEXT: (unreachable)
|
429 | 326 | ;; CHECK-BIN-NEXT: )
|
430 | 327 | ;; CHECK-BIN-NEXT: )
|
431 |
| - ;; NO-EXACT: (func $valid-br-on-cast (type $8) (param $0 (ref null $foo)) (result (ref null $foo)) |
432 |
| - ;; NO-EXACT-NEXT: (block $block (result (ref null $foo)) |
433 |
| - ;; NO-EXACT-NEXT: (drop |
434 |
| - ;; NO-EXACT-NEXT: (br_on_cast $block (ref null $foo) (ref null $foo) |
435 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
436 |
| - ;; NO-EXACT-NEXT: ) |
437 |
| - ;; NO-EXACT-NEXT: ) |
438 |
| - ;; NO-EXACT-NEXT: (unreachable) |
439 |
| - ;; NO-EXACT-NEXT: ) |
440 |
| - ;; NO-EXACT-NEXT: ) |
441 | 328 | (func $valid-br-on-cast (param (ref null (exact $foo))) (result (ref null (exact $foo)))
|
442 | 329 | (drop
|
443 | 330 | (block (result (ref (exact $foo)))
|
|
471 | 358 | ;; CHECK-BIN-NEXT: (unreachable)
|
472 | 359 | ;; CHECK-BIN-NEXT: )
|
473 | 360 | ;; CHECK-BIN-NEXT: )
|
474 |
| - ;; NO-EXACT: (func $valid-br-on-cast-fail (type $4) (param $0 (ref null $foo)) (result (ref $foo)) |
475 |
| - ;; NO-EXACT-NEXT: (block $block (result (ref $foo)) |
476 |
| - ;; NO-EXACT-NEXT: (drop |
477 |
| - ;; NO-EXACT-NEXT: (br_on_cast_fail $block (ref null $foo) (ref null $foo) |
478 |
| - ;; NO-EXACT-NEXT: (local.get $0) |
479 |
| - ;; NO-EXACT-NEXT: ) |
480 |
| - ;; NO-EXACT-NEXT: ) |
481 |
| - ;; NO-EXACT-NEXT: (unreachable) |
482 |
| - ;; NO-EXACT-NEXT: ) |
483 |
| - ;; NO-EXACT-NEXT: ) |
484 | 361 | (func $valid-br-on-cast-fail (param (ref null (exact $foo))) (result (ref (exact $foo)))
|
485 | 362 | (drop
|
486 | 363 | (block (result (ref null (exact $foo)))
|
|
0 commit comments