summaryrefslogtreecommitdiff
path: root/test/merge/basics.wast
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-04-17 13:26:33 -0700
committerGitHub <noreply@github.com>2017-04-17 13:26:33 -0700
commit2e210c1fca804a4ec86bef8855f819747d8bd7ca (patch)
tree9a90eaee299773f1a0dc1412a5c636c3bc31cf4e /test/merge/basics.wast
parentec66e273e350c3d48df0ccaaf73c53b14485848f (diff)
downloadbinaryen-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')
-rw-r--r--test/merge/basics.wast38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/merge/basics.wast b/test/merge/basics.wast
new file mode 100644
index 000000000..7a234584b
--- /dev/null
+++ b/test/merge/basics.wast
@@ -0,0 +1,38 @@
+(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" (func $some-func))
+ (import "env" "some-collide" (func $some-collide))
+ (data (get_global $memoryBase) "hello, A!\n")
+ (global $global-collide i32 (i32.const 0))
+ (global $global-collide-mut (mut i32) (i32.const 0))
+ (global $global-a i32 (i32.const 1))
+ (elem (get_global $tableBase) $only-a $willCollide $some-func $some-collide $only-a)
+ (export "exp-a" (func $only-a))
+ (export "exp-collide" (func $only-a))
+ (export "exp-collide2" (func $willCollide))
+ (func $only-a
+ (drop (i32.const 100))
+ (call $only-a)
+ (call_import $some-func)
+ (call_import $some-collide)
+ (call_indirect $ii
+ (i32.const 123)
+ (i32.const 456)
+ (i32.const 789)
+ )
+ (drop (get_global $global-collide))
+ (drop (get_global $global-a))
+ (drop (get_global $memoryBase))
+ (drop (get_global $tableBase))
+ (set_global $global-collide-mut (i32.const 1234))
+ )
+ (func $willCollide
+ (drop (i32.const 200))
+ (call $willCollide)
+ )
+)
+