diff options
Diffstat (limited to 'test/lit')
-rw-r--r-- | test/lit/gc-eh.wast | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/lit/gc-eh.wast b/test/lit/gc-eh.wast new file mode 100644 index 000000000..808060df1 --- /dev/null +++ b/test/lit/gc-eh.wast @@ -0,0 +1,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 (result (ref null $A)) + ;; CHECK-NEXT: (try $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 $A) + ;; CHECK-NEXT: ) + (func $foo (result (ref null $A)) + (try + (do + (nop) + ) + (catch $tagA + (return + (pop (ref $A)) + ) + ) + ) + (ref.null $A) + ) +) |