summaryrefslogtreecommitdiff
path: root/test/passes/asyncify_optimize-level=1.wast
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-07-15 14:50:04 -0700
committerGitHub <noreply@github.com>2019-07-15 14:50:04 -0700
commit774fdbb2f691e367113169d2641810402b8806ad (patch)
tree4847e46b5bb54b3a798817e4d5506c3ce0b60dd4 /test/passes/asyncify_optimize-level=1.wast
parentcdab4ef130626958790cb2601209f14d192fa10a (diff)
downloadbinaryen-774fdbb2f691e367113169d2641810402b8806ad.tar.gz
binaryen-774fdbb2f691e367113169d2641810402b8806ad.tar.bz2
binaryen-774fdbb2f691e367113169d2641810402b8806ad.zip
Bysyncify => Asyncify (#2226)
After some discussion this seems like a less confusing name: what the pass does is "asyncify" code, after all. The one downside is the name overlaps with the old emscripten "Asyncify" utility, which we'll need to clarify in the docs there. This keeps the old --bysyncify flag around for now, which is helpful for avoiding temporary breakage on CI as we move the emscripten side as well.
Diffstat (limited to 'test/passes/asyncify_optimize-level=1.wast')
-rw-r--r--test/passes/asyncify_optimize-level=1.wast97
1 files changed, 97 insertions, 0 deletions
diff --git a/test/passes/asyncify_optimize-level=1.wast b/test/passes/asyncify_optimize-level=1.wast
new file mode 100644
index 000000000..a89103e8a
--- /dev/null
+++ b/test/passes/asyncify_optimize-level=1.wast
@@ -0,0 +1,97 @@
+(module
+ (memory 1 2)
+ (import "env" "import" (func $import))
+ (import "env" "import2" (func $import2 (result i32)))
+ (import "env" "import3" (func $import3 (param i32)))
+ (func $calls-import
+ (call $import)
+ )
+ (func $calls-import2 (result i32)
+ (local $temp i32)
+ (local.set $temp (call $import2))
+ (return (local.get $temp))
+ )
+ (func $calls-import2-drop
+ (drop (call $import2))
+ )
+ (func $calls-nothing
+ (drop (i32.eqz (i32.const 17)))
+ )
+ (func $many-locals (param $x i32) (result i32)
+ (local $y i32)
+ (loop $l
+ (local.set $x
+ (i32.add (local.get $y) (i32.const 1))
+ )
+ (local.set $y
+ (i32.div_s (local.get $x) (i32.const 3))
+ )
+ (br_if $l (local.get $y))
+ )
+ (call $import)
+ (return (local.get $y))
+ )
+ (func $calls-import2-if (param $x i32)
+ (if (local.get $x)
+ (call $import)
+ )
+ )
+ (func $calls-import2-if-else (param $x i32)
+ (if (local.get $x)
+ (call $import3 (i32.const 1))
+ (call $import3 (i32.const 2))
+ )
+ )
+ (func $calls-import2-if-else-oneside (param $x i32) (result i32)
+ (if (local.get $x)
+ (return (i32.const 1))
+ (call $import3 (i32.const 2))
+ )
+ (return (i32.const 3))
+ )
+ (func $calls-import2-if-else-oneside2 (param $x i32) (result i32)
+ (if (local.get $x)
+ (call $import3 (i32.const 1))
+ (return (i32.const 2))
+ )
+ (return (i32.const 3))
+ )
+ (func $calls-loop (param $x i32)
+ (loop $l
+ (call $import3 (i32.const 1))
+ (local.set $x
+ (i32.add (local.get $x) (i32.const 1))
+ )
+ (br_if $l
+ (local.get $x)
+ )
+ )
+ )
+ (func $calls-loop2
+ (loop $l
+ (br_if $l
+ (call $import2)
+ )
+ )
+ )
+ (func $calls-mix
+ (call $boring)
+ (call $import)
+ (call $boring)
+ (call $import)
+ )
+ (func $boring)
+ (func $calls-mix-deep
+ (call $boring-deep)
+ (call $import-deep)
+ (call $boring)
+ (call $import)
+ )
+ (func $boring-deep
+ (call $boring)
+ )
+ (func $import-deep
+ (call $import)
+ )
+)
+