blob: 2c12cec49d58321c1a02f95c1b1a20875bd7212d (
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
|
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
;; Check that pops of GC types work correctly.
;; RUN: wasm-opt -all %s -S -o - | filecheck %s
(module
;; CHECK: (type $A (struct (field (mut i32))))
(type $A (struct
(field (mut i32))
))
;; CHECK: (tag $tagA (param (ref $A)))
(tag $tagA (param (ref $A)))
;; CHECK: (func $foo (type $2) (result (ref null $A))
;; CHECK-NEXT: (try
;; CHECK-NEXT: (do
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: )
;; CHECK-NEXT: (catch $tagA
;; CHECK-NEXT: (return
;; CHECK-NEXT: (pop (ref $A))
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
(func $foo (result (ref null $A))
(try
(do
(nop)
)
(catch $tagA
(return
(pop (ref $A))
)
)
)
(ref.null $A)
)
)
|