summaryrefslogtreecommitdiff
path: root/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-05-31 20:02:37 -0700
committerGitHub <noreply@github.com>2019-05-31 20:02:37 -0700
commitfe99e3458f11d1a01fa3ad5b68883dbcba3903af (patch)
tree6f5eda61c7c7cba9c3b16be5e361cdc148d8b315 /test/passes/remove-unused-nonfunction-module-elements_all-features.txt
parent7306f60a4474ca1fa948bddee5c068e7c2f635f6 (diff)
downloadbinaryen-fe99e3458f11d1a01fa3ad5b68883dbcba3903af.tar.gz
binaryen-fe99e3458f11d1a01fa3ad5b68883dbcba3903af.tar.bz2
binaryen-fe99e3458f11d1a01fa3ad5b68883dbcba3903af.zip
Add event section (#2151)
This adds support for the event and the event section, as specified in https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md#changes-to-the-binary-model. Wasm events are features that suspend the current execution and transfer the control flow to a corresponding handler. Currently the only supported event kind is exceptions. For events, this includes support for - Binary file reading/writing - Wast file reading/writing - Binaryen.js API - Fuzzer - Validation - Metadce - Passes: metrics, minify-imports-and-exports, remove-unused-module-elements
Diffstat (limited to 'test/passes/remove-unused-nonfunction-module-elements_all-features.txt')
-rw-r--r--test/passes/remove-unused-nonfunction-module-elements_all-features.txt340
1 files changed, 340 insertions, 0 deletions
diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
new file mode 100644
index 000000000..e08bf1eb2
--- /dev/null
+++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
@@ -0,0 +1,340 @@
+(module
+ (type $0 (func))
+ (type $1 (func (param i32)))
+ (type $2 (func (param i32) (result i32)))
+ (memory $0 0)
+ (table $0 1 1 funcref)
+ (elem (i32.const 0) $called_indirect)
+ (export "memory" (memory $0))
+ (export "exported" (func $exported))
+ (export "other1" (func $other1))
+ (export "other2" (func $other2))
+ (start $start)
+ (func $start (; 0 ;) (type $0)
+ (call $called0)
+ )
+ (func $called0 (; 1 ;) (type $0)
+ (call $called1)
+ )
+ (func $called1 (; 2 ;) (type $0)
+ (nop)
+ )
+ (func $called_indirect (; 3 ;) (type $0)
+ (nop)
+ )
+ (func $exported (; 4 ;) (type $0)
+ (call $called2)
+ )
+ (func $called2 (; 5 ;) (type $0)
+ (call $called2)
+ (call $called3)
+ )
+ (func $called3 (; 6 ;) (type $0)
+ (call $called4)
+ )
+ (func $called4 (; 7 ;) (type $0)
+ (call $called3)
+ )
+ (func $remove0 (; 8 ;) (type $0)
+ (call $remove1)
+ )
+ (func $remove1 (; 9 ;) (type $0)
+ (nop)
+ )
+ (func $remove2 (; 10 ;) (type $0)
+ (call $remove2)
+ )
+ (func $remove3 (; 11 ;) (type $0)
+ (call $remove4)
+ )
+ (func $remove4 (; 12 ;) (type $0)
+ (call $remove3)
+ )
+ (func $other1 (; 13 ;) (type $1) (param $0 i32)
+ (call_indirect (type $0)
+ (i32.const 0)
+ )
+ (call_indirect (type $0)
+ (i32.const 0)
+ )
+ (call_indirect (type $0)
+ (i32.const 0)
+ )
+ (call_indirect (type $0)
+ (i32.const 0)
+ )
+ (call_indirect (type $1)
+ (i32.const 0)
+ (i32.const 0)
+ )
+ (call_indirect (type $1)
+ (i32.const 0)
+ (i32.const 0)
+ )
+ (drop
+ (call_indirect (type $2)
+ (i32.const 0)
+ (i32.const 0)
+ )
+ )
+ (drop
+ (call_indirect (type $2)
+ (i32.const 0)
+ (i32.const 0)
+ )
+ )
+ (drop
+ (call_indirect (type $2)
+ (i32.const 0)
+ (i32.const 0)
+ )
+ )
+ )
+ (func $other2 (; 14 ;) (type $1) (param $0 i32)
+ (unreachable)
+ )
+)
+(module
+)
+(module
+)
+(module
+ (import "env" "memory" (memory $0 256))
+ (import "env" "table" (table $0 1 funcref))
+ (export "mem" (memory $0))
+ (export "tab" (table $0))
+)
+(module
+ (type $FUNCSIG$v (func))
+ (import "env" "memory" (memory $0 256))
+ (data (i32.const 1) "hello, world!")
+ (import "env" "table" (table $0 1 funcref))
+ (elem (i32.const 0) $waka)
+ (func $waka (; 0 ;) (type $FUNCSIG$v)
+ (nop)
+ )
+)
+(module
+ (type $0 (func))
+ (import "env" "memory" (memory $0 256))
+ (import "env" "table" (table $0 0 funcref))
+ (export "user" (func $user))
+ (func $user (; 0 ;) (type $0)
+ (drop
+ (i32.load
+ (i32.const 0)
+ )
+ )
+ (call_indirect (type $0)
+ (i32.const 0)
+ )
+ )
+)
+(module
+ (type $FUNCSIG$v (func))
+ (memory $0 (shared 23 256))
+ (export "user" (func $user))
+ (func $user (; 0 ;) (type $FUNCSIG$v)
+ (i32.store
+ (i32.const 0)
+ (i32.const 0)
+ )
+ )
+)
+(module
+ (type $FUNCSIG$i (func (result i32)))
+ (memory $0 (shared 23 256))
+ (export "user" (func $user))
+ (func $user (; 0 ;) (type $FUNCSIG$i) (result i32)
+ (i32.atomic.rmw.add
+ (i32.const 0)
+ (i32.const 0)
+ )
+ )
+)
+(module
+ (type $FUNCSIG$i (func (result i32)))
+ (memory $0 (shared 23 256))
+ (export "user" (func $user))
+ (func $user (; 0 ;) (type $FUNCSIG$i) (result i32)
+ (i32.atomic.rmw8.cmpxchg_u
+ (i32.const 0)
+ (i32.const 0)
+ (i32.const 0)
+ )
+ )
+)
+(module
+ (type $FUNCSIG$v (func))
+ (memory $0 (shared 23 256))
+ (export "user" (func $user))
+ (func $user (; 0 ;) (type $FUNCSIG$v)
+ (local $0 i32)
+ (local $1 i64)
+ (drop
+ (i32.atomic.wait
+ (local.get $0)
+ (local.get $0)
+ (local.get $1)
+ )
+ )
+ )
+)
+(module
+ (type $FUNCSIG$i (func (result i32)))
+ (memory $0 (shared 23 256))
+ (export "user" (func $user))
+ (func $user (; 0 ;) (type $FUNCSIG$i) (result i32)
+ (atomic.notify
+ (i32.const 0)
+ (i32.const 0)
+ )
+ )
+)
+(module
+ (type $FUNCSIG$i (func (result i32)))
+ (memory $0 23 256)
+ (export "user" (func $user))
+ (func $user (; 0 ;) (type $FUNCSIG$i) (result i32)
+ (memory.grow
+ (i32.const 0)
+ )
+ )
+)
+(module
+ (type $FUNCSIG$i (func (result i32)))
+ (import "env" "memory" (memory $0 256))
+ (export "user" (func $user))
+ (func $user (; 0 ;) (type $FUNCSIG$i) (result i32)
+ (memory.grow
+ (i32.const 0)
+ )
+ )
+)
+(module
+ (type $FUNCSIG$i (func (result i32)))
+ (memory $0 23 256)
+ (export "user" (func $user))
+ (func $user (; 0 ;) (type $FUNCSIG$i) (result i32)
+ (memory.size)
+ )
+)
+(module
+ (type $FUNCSIG$v (func))
+ (import "env" "memory" (memory $0 256))
+ (data (global.get $memoryBase) "hello, world!")
+ (import "env" "table" (table $0 0 funcref))
+ (elem (global.get $tableBase) $waka)
+ (import "env" "memoryBase" (global $memoryBase i32))
+ (import "env" "tableBase" (global $tableBase i32))
+ (func $waka (; 0 ;) (type $FUNCSIG$v)
+ (nop)
+ )
+)
+(module
+ (type $FUNCSIG$ii (func (param i32) (result i32)))
+ (type $FUNCSIG$i (func (result i32)))
+ (type $FUNCSIG$v (func))
+ (import "env" "imported" (global $imported i32))
+ (import "env" "_puts" (func $_puts (param i32) (result i32)))
+ (global $int (mut i32) (global.get $imported))
+ (global $set (mut i32) (i32.const 100))
+ (global $exp_glob i32 (i32.const 600))
+ (export "one" (func $one))
+ (export "three" (func $three))
+ (export "exp_glob" (global $exp_glob))
+ (func $one (; 1 ;) (type $FUNCSIG$i) (result i32)
+ (call $two)
+ )
+ (func $two (; 2 ;) (type $FUNCSIG$i) (result i32)
+ (global.get $int)
+ )
+ (func $three (; 3 ;) (type $FUNCSIG$v)
+ (call $four)
+ )
+ (func $four (; 4 ;) (type $FUNCSIG$v)
+ (global.set $set
+ (i32.const 200)
+ )
+ (drop
+ (call $_puts
+ (i32.const 300)
+ )
+ )
+ )
+ (func $forget_implemented (; 5 ;) (type $FUNCSIG$v)
+ (nop)
+ )
+ (func $starter (; 6 ;) (type $FUNCSIG$v)
+ (nop)
+ )
+)
+(module
+ (type $FUNCSIG$v (func))
+ (func $starter (; 0 ;) (type $FUNCSIG$v)
+ (nop)
+ )
+)
+(module
+ (type $FUNCSIG$v (func))
+ (start $starter)
+ (func $starter (; 0 ;) (type $FUNCSIG$v)
+ (drop
+ (i32.const 0)
+ )
+ )
+)
+(module
+ (type $0 (func (param f64) (result f64)))
+ (func $0 (; 0 ;) (type $0) (param $var$0 f64) (result f64)
+ (if (result f64)
+ (f64.eq
+ (f64.const 1)
+ (f64.const 1)
+ )
+ (f64.const 1)
+ (f64.const 0)
+ )
+ )
+)
+(module
+ (type $0 (func (param f64) (result f64)))
+ (table $0 6 6 funcref)
+ (func $0 (; 0 ;) (type $0) (param $var$0 f64) (result f64)
+ (if (result f64)
+ (f64.eq
+ (f64.const 1)
+ (f64.const 1)
+ )
+ (call_indirect (type $0)
+ (f64.const 1)
+ (i32.const 0)
+ )
+ (f64.const 0)
+ )
+ )
+)
+(module
+ (type $0 (func (param f64) (result f64)))
+ (import "env" "table" (table $0 6 6 funcref))
+ (elem (i32.const 0) $0)
+ (func $0 (; 0 ;) (type $0) (param $var$0 f64) (result f64)
+ (if (result f64)
+ (f64.eq
+ (f64.const 1)
+ (f64.const 1)
+ )
+ (f64.const 1)
+ (f64.const 0)
+ )
+ )
+)
+(module
+ (type $0 (func (param i32)))
+ (type $FUNCSIG$vj (func (param i64)))
+ (event $e1 (attr 0) (param i64))
+ (export "e1" (event $e1))
+ (func $f (; 0 ;) (type $0) (param $0 i32)
+ (nop)
+ )
+)