summaryrefslogtreecommitdiff
path: root/test/reduce
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-09-20 12:26:10 -0700
committerGitHub <noreply@github.com>2018-09-20 12:26:10 -0700
commitad9152e4973afa83d093600dda0d925f5c7cf714 (patch)
tree9d53ec339456fa417d1bd4776152bdb75b109522 /test/reduce
parent41ebb1b11041bf43f0e8b7ebacbed132511fcc55 (diff)
downloadbinaryen-ad9152e4973afa83d093600dda0d925f5c7cf714.tar.gz
binaryen-ad9152e4973afa83d093600dda0d925f5c7cf714.tar.bz2
binaryen-ad9152e4973afa83d093600dda0d925f5c7cf714.zip
More #1678 fixes (#1685)
While debugging to fix the waterfall regressions I noticed that wasm-reduce regressed. We need to be more careful with visitFunction which now may visit an imported function - I found a few not-well-tested passes that also regressed that way.
Diffstat (limited to 'test/reduce')
-rw-r--r--test/reduce/imports.wast17
-rw-r--r--test/reduce/imports.wast.txt6
2 files changed, 23 insertions, 0 deletions
diff --git a/test/reduce/imports.wast b/test/reduce/imports.wast
new file mode 100644
index 000000000..2eb37a066
--- /dev/null
+++ b/test/reduce/imports.wast
@@ -0,0 +1,17 @@
+(module
+ (import "env" "func" (func $import))
+ (export "x" (func $x))
+ (func $x (result i32)
+ (nop)
+ (nop)
+ (nop)
+ (call $import)
+ (drop (i32.const 1234))
+ (i32.const 5678) ;; easily reducible
+ )
+ (func $not-exported
+ (nop)
+ (unreachable)
+ )
+)
+
diff --git a/test/reduce/imports.wast.txt b/test/reduce/imports.wast.txt
new file mode 100644
index 000000000..220bf3b7e
--- /dev/null
+++ b/test/reduce/imports.wast.txt
@@ -0,0 +1,6 @@
+(module
+ (type $0 (func))
+ (type $1 (func (result i32)))
+ (import "env" "func" (func $fimport$0))
+)
+