summaryrefslogtreecommitdiff
path: root/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2021-07-08 18:15:13 +0000
committerGitHub <noreply@github.com>2021-07-08 11:15:13 -0700
commit397a06e5992b11eb89493b0ebce08990bd2830c2 (patch)
tree49fb77f5f361997b85769879c4ec5a2694d83daf /test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast
parent0a682d32870c3a7b2c908b0d7d7cab95338393c5 (diff)
downloadbinaryen-397a06e5992b11eb89493b0ebce08990bd2830c2.tar.gz
binaryen-397a06e5992b11eb89493b0ebce08990bd2830c2.tar.bz2
binaryen-397a06e5992b11eb89493b0ebce08990bd2830c2.zip
Port test/passes/asyncify* to lit (#3970)
Diffstat (limited to 'test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast')
-rw-r--r--test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast193
1 files changed, 193 insertions, 0 deletions
diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast
new file mode 100644
index 000000000..aed1e015f
--- /dev/null
+++ b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast
@@ -0,0 +1,193 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; NOTE: This test was ported using port_test.py and could be cleaned up.
+
+;; RUN: foreach %s %t wasm-opt --asyncify --pass-arg=asyncify-addlist@foo -S -o - | filecheck %s
+
+(module
+ (memory 1 2)
+ ;; CHECK: (type $none_=>_none (func))
+
+ ;; CHECK: (type $i32_=>_none (func (param i32)))
+
+ ;; CHECK: (type $none_=>_i32 (func (result i32)))
+
+ ;; CHECK: (import "env" "import" (func $import))
+ (import "env" "import" (func $import))
+ ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0))
+
+ ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0))
+
+ ;; CHECK: (memory $0 1 2)
+
+ ;; CHECK: (export "asyncify_start_unwind" (func $asyncify_start_unwind))
+
+ ;; CHECK: (export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
+
+ ;; CHECK: (export "asyncify_start_rewind" (func $asyncify_start_rewind))
+
+ ;; CHECK: (export "asyncify_stop_rewind" (func $asyncify_stop_rewind))
+
+ ;; CHECK: (export "asyncify_get_state" (func $asyncify_get_state))
+
+ ;; CHECK: (func $foo
+ ;; CHECK-NEXT: (local $0 i32)
+ ;; CHECK-NEXT: (local $1 i32)
+ ;; CHECK-NEXT: (if
+ ;; CHECK-NEXT: (i32.eq
+ ;; CHECK-NEXT: (global.get $__asyncify_state)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.tee $0
+ ;; CHECK-NEXT: (block $__asyncify_unwind
+ ;; CHECK-NEXT: (block
+ ;; CHECK-NEXT: (block
+ ;; CHECK-NEXT: (if
+ ;; CHECK-NEXT: (i32.eq
+ ;; CHECK-NEXT: (global.get $__asyncify_state)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (block
+ ;; CHECK-NEXT: (i32.store
+ ;; CHECK-NEXT: (global.get $__asyncify_data)
+ ;; CHECK-NEXT: (i32.add
+ ;; CHECK-NEXT: (i32.load
+ ;; CHECK-NEXT: (global.get $__asyncify_data)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.const -4)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $1
+ ;; CHECK-NEXT: (i32.load
+ ;; CHECK-NEXT: (i32.load
+ ;; CHECK-NEXT: (global.get $__asyncify_data)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (if
+ ;; CHECK-NEXT: (i32.eq
+ ;; CHECK-NEXT: (global.get $__asyncify_state)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $nothing)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (return)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (block
+ ;; CHECK-NEXT: (i32.store
+ ;; CHECK-NEXT: (i32.load
+ ;; CHECK-NEXT: (global.get $__asyncify_data)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.get $0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.store
+ ;; CHECK-NEXT: (global.get $__asyncify_data)
+ ;; CHECK-NEXT: (i32.add
+ ;; CHECK-NEXT: (i32.load
+ ;; CHECK-NEXT: (global.get $__asyncify_data)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
+ (func $foo ;; doesn't look like it needs instrumentation, but in add list
+ (call $nothing)
+ )
+ ;; CHECK: (func $bar
+ ;; CHECK-NEXT: (call $nothing)
+ ;; CHECK-NEXT: )
+ (func $bar ;; doesn't look like it needs instrumentation, and not in add list
+ (call $nothing)
+ )
+ ;; CHECK: (func $nothing
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
+ (func $nothing
+ )
+)
+
+;; CHECK: (func $asyncify_start_unwind (param $0 i32)
+;; CHECK-NEXT: (global.set $__asyncify_state
+;; CHECK-NEXT: (i32.const 1)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (global.set $__asyncify_data
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (if
+;; CHECK-NEXT: (i32.gt_u
+;; CHECK-NEXT: (i32.load
+;; CHECK-NEXT: (global.get $__asyncify_data)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (i32.load offset=4
+;; CHECK-NEXT: (global.get $__asyncify_data)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (unreachable)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $asyncify_stop_unwind
+;; CHECK-NEXT: (global.set $__asyncify_state
+;; CHECK-NEXT: (i32.const 0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (if
+;; CHECK-NEXT: (i32.gt_u
+;; CHECK-NEXT: (i32.load
+;; CHECK-NEXT: (global.get $__asyncify_data)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (i32.load offset=4
+;; CHECK-NEXT: (global.get $__asyncify_data)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (unreachable)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $asyncify_start_rewind (param $0 i32)
+;; CHECK-NEXT: (global.set $__asyncify_state
+;; CHECK-NEXT: (i32.const 2)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (global.set $__asyncify_data
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (if
+;; CHECK-NEXT: (i32.gt_u
+;; CHECK-NEXT: (i32.load
+;; CHECK-NEXT: (global.get $__asyncify_data)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (i32.load offset=4
+;; CHECK-NEXT: (global.get $__asyncify_data)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (unreachable)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $asyncify_stop_rewind
+;; CHECK-NEXT: (global.set $__asyncify_state
+;; CHECK-NEXT: (i32.const 0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (if
+;; CHECK-NEXT: (i32.gt_u
+;; CHECK-NEXT: (i32.load
+;; CHECK-NEXT: (global.get $__asyncify_data)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (i32.load offset=4
+;; CHECK-NEXT: (global.get $__asyncify_data)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (unreachable)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $asyncify_get_state (result i32)
+;; CHECK-NEXT: (global.get $__asyncify_state)
+;; CHECK-NEXT: )