summaryrefslogtreecommitdiff
path: root/test/passes/remove-unused-module-elements_all-features.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes/remove-unused-module-elements_all-features.wast')
-rw-r--r--test/passes/remove-unused-module-elements_all-features.wast21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/passes/remove-unused-module-elements_all-features.wast b/test/passes/remove-unused-module-elements_all-features.wast
index c70dc1495..8837f91a9 100644
--- a/test/passes/remove-unused-module-elements_all-features.wast
+++ b/test/passes/remove-unused-module-elements_all-features.wast
@@ -73,10 +73,31 @@
(import "env" "memory" (memory $0 256))
(import "env" "table" (table 0 funcref))
)
+(module ;; remove all tables and the memory
+ (import "env" "memory" (memory $0 256))
+ (import "env" "table" (table 0 funcref))
+ (import "env" "table2" (table $1 1 2 funcref))
+ (elem (table $1) (offset (i32.const 0)) func)
+ (elem (table $1) (offset (i32.const 1)) func)
+)
+(module ;; remove the first table and memory, but not the second one
+ (import "env" "memory" (memory $0 256))
+ (import "env" "table" (table 0 funcref))
+ (import "env" "table2" (table $1 1 1 funcref))
+ (elem (table $1) (offset (i32.const 0)) func)
+ (elem (table $1) (offset (i32.const 0)) func $f)
+ (func $f)
+)
(module ;; also when not imported
(memory 256)
(table 1 funcref)
)
+(module ;; also with multiple tables
+ (memory 256)
+ (table $0 1 funcref)
+ (table $1 1 funcref)
+ (elem (table $1) (i32.const 0) func)
+)
(module ;; but not when exported
(import "env" "memory" (memory $0 256))
(import "env" "table" (table 1 funcref))