summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-07-19 16:24:37 -0700
committerGitHub <noreply@github.com>2019-07-19 16:24:37 -0700
commit72c52ea7d4eb61b95cf8a5164947cb760fe42e9c (patch)
tree137998155be428183fb09da95e9d0d0707efa4bc /test
parent88ef839433ac0cf58c2a29f369d0268a22b5ae0e (diff)
downloadbinaryen-72c52ea7d4eb61b95cf8a5164947cb760fe42e9c.tar.gz
binaryen-72c52ea7d4eb61b95cf8a5164947cb760fe42e9c.tar.bz2
binaryen-72c52ea7d4eb61b95cf8a5164947cb760fe42e9c.zip
Remove bulk memory instructions refering to active segments (#2235)
This prevents those instructions from becoming invalid due to memory packing optimizations and is also a code size win. Fixes #2227.
Diffstat (limited to 'test')
-rw-r--r--test/passes/memory-packing_all-features.txt (renamed from test/passes/memory-packing.txt)27
-rw-r--r--test/passes/memory-packing_all-features.wast (renamed from test/passes/memory-packing.wast)21
2 files changed, 47 insertions, 1 deletions
diff --git a/test/passes/memory-packing.txt b/test/passes/memory-packing_all-features.txt
index 9805375f1..bf04ae91b 100644
--- a/test/passes/memory-packing.txt
+++ b/test/passes/memory-packing_all-features.txt
@@ -18,3 +18,30 @@
(import "env" "memory" (memory $0 2048 2048))
(import "env" "memoryBase" (global $memoryBase i32))
)
+(module
+ (type $FUNCSIG$v (func))
+ (memory $0 1 1)
+ (func $foo (; 0 ;) (type $FUNCSIG$v)
+ (block
+ (drop
+ (i32.const 0)
+ )
+ (drop
+ (i32.const 0)
+ )
+ (drop
+ (i32.const 0)
+ )
+ (unreachable)
+ )
+ (unreachable)
+ )
+ (func $bar (; 1 ;) (type $FUNCSIG$v)
+ (drop
+ (loop $loop-in (result i32)
+ (unreachable)
+ (i32.const 42)
+ )
+ )
+ )
+)
diff --git a/test/passes/memory-packing.wast b/test/passes/memory-packing_all-features.wast
index 6cdd453d1..e43bd0314 100644
--- a/test/passes/memory-packing.wast
+++ b/test/passes/memory-packing_all-features.wast
@@ -17,4 +17,23 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (i32.const 4066) "") ;; empty
)
-
+(module
+ (memory $0 1 1)
+ (data (i32.const 0) "")
+ (func $foo
+ (memory.init 0
+ (i32.const 0)
+ (i32.const 0)
+ (i32.const 0)
+ )
+ (data.drop 0)
+ )
+ (func $bar
+ (drop
+ (loop (result i32)
+ (data.drop 0)
+ (i32.const 42)
+ )
+ )
+ )
+)