diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/basic/typed_continuations_suspend.wast | 49 | ||||
-rw-r--r-- | test/lit/wat-kitchen-sink.wast | 44 |
2 files changed, 77 insertions, 16 deletions
diff --git a/test/lit/basic/typed_continuations_suspend.wast b/test/lit/basic/typed_continuations_suspend.wast new file mode 100644 index 000000000..62a09c213 --- /dev/null +++ b/test/lit/basic/typed_continuations_suspend.wast @@ -0,0 +1,49 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. + +;; RUN: wasm-opt %s -all -o %t.text.wast -g -S +;; RUN: wasm-as %s -all -g -o %t.wasm +;; RUN: wasm-dis %t.wasm -all -o %t.bin.wast +;; RUN: wasm-as %s -all -o %t.nodebug.wasm +;; RUN: wasm-dis %t.nodebug.wasm -all -o %t.bin.nodebug.wast +;; RUN: cat %t.text.wast | filecheck %s --check-prefix=CHECK-TEXT +;; RUN: cat %t.bin.wast | filecheck %s --check-prefix=CHECK-BIN +;; RUN: cat %t.bin.nodebug.wast | filecheck %s --check-prefix=CHECK-BIN-NODEBUG + +(module + ;; CHECK-TEXT: (type $0 (func (param i32) (result i64))) + + ;; CHECK-TEXT: (type $1 (func (result i64))) + + ;; CHECK-TEXT: (tag $t (param i32) (result i64)) + ;; CHECK-BIN: (type $0 (func (param i32) (result i64))) + + ;; CHECK-BIN: (type $1 (func (result i64))) + + ;; CHECK-BIN: (tag $t (param i32) (result i64)) + (tag $t (param i32) (result i64)) + + ;; CHECK-TEXT: (func $f (type $1) (result i64) + ;; CHECK-TEXT-NEXT: (suspend $t + ;; CHECK-TEXT-NEXT: (i32.const 123) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-BIN: (func $f (type $1) (result i64) + ;; CHECK-BIN-NEXT: (suspend $t + ;; CHECK-BIN-NEXT: (i32.const 123) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: ) + (func $f (result i64) + (suspend $t (i32.const 123)) + ) +) +;; CHECK-BIN-NODEBUG: (type $0 (func (param i32) (result i64))) + +;; CHECK-BIN-NODEBUG: (type $1 (func (result i64))) + +;; CHECK-BIN-NODEBUG: (tag $tag$0 (param i32) (result i64)) + +;; CHECK-BIN-NODEBUG: (func $0 (type $1) (result i64) +;; CHECK-BIN-NODEBUG-NEXT: (suspend $tag$0 +;; CHECK-BIN-NODEBUG-NEXT: (i32.const 123) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: ) diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast index af9ce7ff0..c56523af1 100644 --- a/test/lit/wat-kitchen-sink.wast +++ b/test/lit/wat-kitchen-sink.wast @@ -13,9 +13,9 @@ (type $ret2 (func (result i32 i32))) (rec - ;; CHECK: (type $pair (struct (field $first (mut i32)) (field $second (mut i64)))) + ;; CHECK: (type $3 (func (result i32 i64))) - ;; CHECK: (type $4 (func (result i32 i64))) + ;; CHECK: (type $pair (struct (field $first (mut i32)) (field $second (mut i64)))) ;; CHECK: (type $5 (func (param i32 i64))) @@ -315,7 +315,7 @@ ;; CHECK: (import "mod" "f5" (func $fimport$0 (type $void))) - ;; CHECK: (import "mod" "imported-f" (func $fimport$1 (type $4) (result i32 i64))) + ;; CHECK: (import "mod" "imported-f" (func $fimport$1 (type $3) (result i32 i64))) ;; CHECK: (import "mod" "t0" (tag $imported (param i32 i64))) @@ -1874,8 +1874,8 @@ end ) - ;; CHECK: (func $try-catch-params (type $4) (result i32 i64) - ;; CHECK-NEXT: (try (type $4) (result i32 i64) + ;; CHECK: (func $try-catch-params (type $3) (result i32 i64) + ;; CHECK-NEXT: (try (type $3) (result i32 i64) ;; CHECK-NEXT: (do ;; CHECK-NEXT: (tuple.make 2 ;; CHECK-NEXT: (i32.const 0) @@ -1895,8 +1895,8 @@ end ) - ;; CHECK: (func $try-catch-pop (type $4) (result i32 i64) - ;; CHECK-NEXT: (try (type $4) (result i32 i64) + ;; CHECK: (func $try-catch-pop (type $3) (result i32 i64) + ;; CHECK-NEXT: (try (type $3) (result i32 i64) ;; CHECK-NEXT: (do ;; CHECK-NEXT: (tuple.make 2 ;; CHECK-NEXT: (i32.const 0) @@ -2754,8 +2754,8 @@ br 0 ) - ;; CHECK: (func $br-multivalue (type $4) (result i32 i64) - ;; CHECK-NEXT: (block $label (type $4) (result i32 i64) + ;; CHECK: (func $br-multivalue (type $3) (result i32 i64) + ;; CHECK-NEXT: (block $label (type $3) (result i32 i64) ;; CHECK-NEXT: (br $label ;; CHECK-NEXT: (tuple.make 2 ;; CHECK-NEXT: (i32.const 0) @@ -2770,9 +2770,9 @@ br 0 ) - ;; CHECK: (func $br-multivalue-drop (type $4) (result i32 i64) - ;; CHECK-NEXT: (block $label (type $4) (result i32 i64) - ;; CHECK-NEXT: (block (type $4) (result i32 i64) + ;; CHECK: (func $br-multivalue-drop (type $3) (result i32 i64) + ;; CHECK-NEXT: (block $label (type $3) (result i32 i64) + ;; CHECK-NEXT: (block (type $3) (result i32 i64) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (f32.const 0) ;; CHECK-NEXT: ) @@ -2972,9 +2972,9 @@ end ) - ;; CHECK: (func $br-table-multivalue (type $4) (result i32 i64) - ;; CHECK-NEXT: (block $a (type $4) (result i32 i64) - ;; CHECK-NEXT: (block $b (type $4) (result i32 i64) + ;; CHECK: (func $br-table-multivalue (type $3) (result i32 i64) + ;; CHECK-NEXT: (block $a (type $3) (result i32 i64) + ;; CHECK-NEXT: (block $b (type $3) (result i32 i64) ;; CHECK-NEXT: (br_table $a $b ;; CHECK-NEXT: (tuple.make 2 ;; CHECK-NEXT: (i32.const 42) @@ -3662,7 +3662,7 @@ return ) - ;; CHECK: (func $return-multivalue (type $4) (result i32 i64) + ;; CHECK: (func $return-multivalue (type $3) (result i32 i64) ;; CHECK-NEXT: (return ;; CHECK-NEXT: (call $return-multivalue) ;; CHECK-NEXT: ) @@ -5141,6 +5141,18 @@ cont.bind $cont-bind-before $simple-cont ) + ;; CHECK: (func $suspend (type $3) (result i32 i64) + ;; CHECK-NEXT: (suspend $tag-pair-to-pair + ;; CHECK-NEXT: (i32.const 123) + ;; CHECK-NEXT: (i64.const 456) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $suspend (result i32 i64) + i32.const 123 + i64.const 456 + suspend $tag-pair-to-pair + ) + ;; CHECK: (func $source-maps (type $void) ;; CHECK-NEXT: ;;@ src.cpp:40:1 ;; CHECK-NEXT: (drop |