diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-04-17 13:26:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-17 13:26:33 -0700 |
commit | 2e210c1fca804a4ec86bef8855f819747d8bd7ca (patch) | |
tree | 9a90eaee299773f1a0dc1412a5c636c3bc31cf4e /test/merge/basics.wast.toMerge | |
parent | ec66e273e350c3d48df0ccaaf73c53b14485848f (diff) | |
download | binaryen-2e210c1fca804a4ec86bef8855f819747d8bd7ca.tar.gz binaryen-2e210c1fca804a4ec86bef8855f819747d8bd7ca.tar.bz2 binaryen-2e210c1fca804a4ec86bef8855f819747d8bd7ca.zip |
wasm-merge tool (#919)
wasm-merge tool: combines two wasm files into a larger one, handling collisions, and aware of the dynamic linking conventions. it does not do full static linking, but may eventually.
Diffstat (limited to 'test/merge/basics.wast.toMerge')
-rw-r--r-- | test/merge/basics.wast.toMerge | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/test/merge/basics.wast.toMerge b/test/merge/basics.wast.toMerge new file mode 100644 index 000000000..5122afe31 --- /dev/null +++ b/test/merge/basics.wast.toMerge @@ -0,0 +1,63 @@ +(module + (type $ii (func (param i32 i32))) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) + (import "env" "memory" (memory $0 256)) + (import "env" "table" (table 0 anyfunc)) + (import "env" "some-func-b" (func $some-func-b)) + (import "env" "some-collide" (func $some-collide)) + (data (get_global $memoryBase) "hello, B!\n") + (global $global-collide i32 (i32.const 0)) + (global $global-collide-mut (mut i32) (i32.const 0)) + (global $global-b i32 (i32.const 1)) + (elem (get_global $tableBase) $only-b $willCollide $some-func-b $some-collide) + (export "exp-b" (func $only-b)) + (export "exp-collide" (func $only-b)) + (export "exp-collide2" (func $willCollide)) + (export "exp-b-nameCollided" (func $willCollide)) + (func $only-b + (drop (i32.const 111)) + (call $only-b) + (call $some-func-b) + (call_import $some-collide) + (call_indirect $ii + (i32.const 12) + (i32.const 34) + (i32.const 56) + ) + (drop (get_global $global-collide)) + (drop (get_global $global-b)) + (drop (get_global $memoryBase)) + (drop (get_global $tableBase)) + (drop + (i32.add + (get_global $memoryBase) + (i32.const 1000) + ) + ) + (drop + (i32.add + (get_global $tableBase) + (i32.const 1000) + ) + ) + (drop + (i32.add + (get_global $tableBase) + (unreachable) ;; bad! + ) + ) + (drop + (i32.sub ;; bad! + (get_global $tableBase) + (i32.const 1000) + ) + ) + (set_global $global-collide-mut (i32.const 5678)) + ) + (func $willCollide + (drop (i32.const 222)) + (call $willCollide) + ) +) + |