diff options
Diffstat (limited to 'test/example')
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 4 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 12 | ||||
-rw-r--r-- | test/example/module-splitting.txt | 108 |
3 files changed, 62 insertions, 62 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index cb6d760a6..01cc6a9c0 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -160,11 +160,11 @@ BinaryenExpressionRef makeMemoryInit(BinaryenModuleRef module) { BinaryenExpressionRef dest = makeInt32(module, 1024); BinaryenExpressionRef offset = makeInt32(module, 0); BinaryenExpressionRef size = makeInt32(module, 12); - return BinaryenMemoryInit(module, 0, dest, offset, size, "0"); + return BinaryenMemoryInit(module, "1", dest, offset, size, "0"); }; BinaryenExpressionRef makeDataDrop(BinaryenModuleRef module) { - return BinaryenDataDrop(module, 0); + return BinaryenDataDrop(module, "1"); }; BinaryenExpressionRef makeMemoryCopy(BinaryenModuleRef module) { diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index f35b947f4..dcfd6de8c 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -89,8 +89,8 @@ BinaryenFeatureAll: 126975 (global $i32Struct-global (mut (ref null ${mut:i32})) (struct.new_default ${mut:i32})) (global $string-global (mut stringref) (string.const "")) (memory $0 (shared 1 256)) - (data (i32.const 10) "hello, world") - (data "I am passive") + (data $0 (i32.const 10) "hello, world") + (data $1 "I am passive") (table $tab 0 100 funcref) (table $0 1 1 funcref) (elem $0 (table $0) (i32.const 0) func "$kitchen()sinker") @@ -1949,12 +1949,12 @@ BinaryenFeatureAll: 126975 (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) ) ) - (memory.init 0 + (memory.init $1 (i32.const 1024) (i32.const 0) (i32.const 12) ) - (data.drop 0) + (data.drop $1) (memory.copy (i32.const 2048) (i32.const 1024) @@ -3112,8 +3112,8 @@ validation: 0 (type $none_=>_none (func)) (global $a-global i32 (i32.const 125)) (memory $0 1 256) - (data (i32.const 10) "hello, world") - (data (global.get $a-global) "segment data 2") + (data $0 (i32.const 10) "hello, world") + (data $1 (global.get $a-global) "segment data 2") (table $0 1 1 funcref) (elem $0 (i32.const 0) $fn0 $fn1 $fn2) (export "export0" (func $fn0)) diff --git a/test/example/module-splitting.txt b/test/example/module-splitting.txt index 79221d664..9466f026e 100644 --- a/test/example/module-splitting.txt +++ b/test/example/module-splitting.txt @@ -153,7 +153,7 @@ Before: (module (type $i32_=>_i32 (func (param i32) (result i32))) (table $table 1 funcref) - (elem (i32.const 0) $foo) + (elem $0 (i32.const 0) $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -163,7 +163,7 @@ After: (module (type $i32_=>_i32 (func (param i32) (result i32))) (table $table 1 funcref) - (elem (i32.const 0) $foo) + (elem $0 (i32.const 0) $foo) (export "%table" (table $table)) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) @@ -179,7 +179,7 @@ Before: (module (type $i32_=>_i32 (func (param i32) (result i32))) (table $table 2 funcref) - (elem (i32.const 0) $foo $foo) + (elem $0 (i32.const 0) $foo $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -189,7 +189,7 @@ After: (module (type $i32_=>_i32 (func (param i32) (result i32))) (table $table 2 funcref) - (elem (i32.const 0) $foo $foo) + (elem $0 (i32.const 0) $foo $foo) (export "%table" (table $table)) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) @@ -206,7 +206,7 @@ Before: (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 1 funcref) - (elem (global.get $base) $foo) + (elem $0 (global.get $base) $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -217,7 +217,7 @@ After: (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 1 funcref) - (elem (global.get $base) $foo) + (elem $0 (global.get $base) $foo) (export "%table" (table $table)) (export "%global" (global $base)) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) @@ -236,7 +236,7 @@ Before: (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 2 funcref) - (elem (global.get $base) $foo $foo) + (elem $0 (global.get $base) $foo $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -247,7 +247,7 @@ After: (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 2 funcref) - (elem (global.get $base) $foo $foo) + (elem $0 (global.get $base) $foo $foo) (export "%table" (table $table)) (export "%global" (global $base)) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) @@ -282,7 +282,7 @@ Before: (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "foo" (func $foo (param i32) (result i32))) (table $table 1000 funcref) - (elem (i32.const 42) $foo) + (elem $0 (i32.const 42) $foo) (export "foo" (func $foo)) ) Keeping: foo @@ -291,7 +291,7 @@ After: (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "foo" (func $foo (param i32) (result i32))) (table $table 1000 funcref) - (elem (i32.const 42) $foo) + (elem $0 (i32.const 42) $foo) (export "foo" (func $foo)) (export "%table" (table $table)) ) @@ -307,7 +307,7 @@ Before: (import "env" "base" (global $base i32)) (import "env" "foo" (func $foo (param i32) (result i32))) (table $table 1000 funcref) - (elem (global.get $base) $foo) + (elem $0 (global.get $base) $foo) (export "foo" (func $foo)) ) Keeping: foo @@ -317,7 +317,7 @@ After: (import "env" "base" (global $base i32)) (import "env" "foo" (func $foo (param i32) (result i32))) (table $table 1000 funcref) - (elem (global.get $base) $foo) + (elem $0 (global.get $base) $foo) (export "foo" (func $foo)) (export "%table" (table $table)) (export "%global" (global $base)) @@ -363,7 +363,7 @@ After: (type $i32_=>_i32 (func (param i32) (result i32))) (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32))) (table $0 1 funcref) - (elem (i32.const 0) $placeholder_0) + (elem $0 (i32.const 0) $placeholder_0) (export "foo" (func $foo)) (export "%table" (table $0)) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) @@ -377,7 +377,7 @@ Secondary: (module (type $i32_=>_i32 (func (param i32) (result i32))) (import "primary" "%table" (table $0 1 funcref)) - (elem (i32.const 0) $foo) + (elem $0 (i32.const 0) $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -388,7 +388,7 @@ Before: (module (type $i32_=>_i32 (func (param i32) (result i32))) (table $table 1 funcref) - (elem (i32.const 0) $foo) + (elem $0 (i32.const 0) $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -399,14 +399,14 @@ After: (type $i32_=>_i32 (func (param i32) (result i32))) (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32))) (table $table 1 funcref) - (elem (i32.const 0) $placeholder_0) + (elem $0 (i32.const 0) $placeholder_0) (export "%table" (table $table)) ) Secondary: (module (type $i32_=>_i32 (func (param i32) (result i32))) (import "primary" "%table" (table $table 1 funcref)) - (elem (i32.const 0) $foo) + (elem $0 (i32.const 0) $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -417,7 +417,7 @@ Before: (module (type $i32_=>_i32 (func (param i32) (result i32))) (table $table 2 funcref) - (elem (i32.const 0) $foo $foo) + (elem $0 (i32.const 0) $foo $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -429,14 +429,14 @@ After: (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32))) (import "placeholder" "1" (func $placeholder_1 (param i32) (result i32))) (table $table 2 funcref) - (elem (i32.const 0) $placeholder_0 $placeholder_1) + (elem $0 (i32.const 0) $placeholder_0 $placeholder_1) (export "%table" (table $table)) ) Secondary: (module (type $i32_=>_i32 (func (param i32) (result i32))) (import "primary" "%table" (table $table 2 funcref)) - (elem (i32.const 0) $foo $foo) + (elem $0 (i32.const 0) $foo $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -447,7 +447,7 @@ Before: (module (type $i32_=>_i32 (func (param i32) (result i32))) (table $table 1000 funcref) - (elem (i32.const 42) $foo) + (elem $0 (i32.const 42) $foo) (export "foo" (func $foo)) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) @@ -459,7 +459,7 @@ After: (type $i32_=>_i32 (func (param i32) (result i32))) (import "placeholder" "42" (func $placeholder_42 (param i32) (result i32))) (table $table 1000 funcref) - (elem (i32.const 42) $placeholder_42) + (elem $0 (i32.const 42) $placeholder_42) (export "foo" (func $foo)) (export "%table" (table $table)) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) @@ -473,7 +473,7 @@ Secondary: (module (type $i32_=>_i32 (func (param i32) (result i32))) (import "primary" "%table" (table $table 1000 funcref)) - (elem (i32.const 42) $foo) + (elem $0 (i32.const 42) $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -485,7 +485,7 @@ Before: (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 1000 funcref) - (elem (global.get $base) $foo) + (elem $0 (global.get $base) $foo) (export "foo" (func $foo)) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) @@ -498,7 +498,7 @@ After: (import "env" "base" (global $base i32)) (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32))) (table $table 1000 funcref) - (elem (global.get $base) $placeholder_0) + (elem $0 (global.get $base) $placeholder_0) (export "foo" (func $foo)) (export "%table" (table $table)) (export "%global" (global $base)) @@ -514,7 +514,7 @@ Secondary: (type $i32_=>_i32 (func (param i32) (result i32))) (import "primary" "%table" (table $table 1000 funcref)) (import "primary" "%global" (global $base i32)) - (elem (global.get $base) $foo) + (elem $0 (global.get $base) $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -526,7 +526,7 @@ Before: (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 1000 funcref) - (elem (global.get $base) $foo $foo) + (elem $0 (global.get $base) $foo $foo) (export "foo" (func $foo)) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) @@ -540,7 +540,7 @@ After: (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32))) (import "placeholder" "1" (func $placeholder_1 (param i32) (result i32))) (table $table 1000 funcref) - (elem (global.get $base) $placeholder_0 $placeholder_1) + (elem $0 (global.get $base) $placeholder_0 $placeholder_1) (export "foo" (func $foo)) (export "%table" (table $table)) (export "%global" (global $base)) @@ -556,7 +556,7 @@ Secondary: (type $i32_=>_i32 (func (param i32) (result i32))) (import "primary" "%table" (table $table 1000 funcref)) (import "primary" "%global" (global $base i32)) - (elem (global.get $base) $foo $foo) + (elem $0 (global.get $base) $foo $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -569,7 +569,7 @@ Before: (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 1000 funcref) - (elem (global.get $base) $null $foo) + (elem $0 (global.get $base) $null $foo) (export "foo" (func $foo)) (func $null (type $none_=>_none) (nop) @@ -586,7 +586,7 @@ After: (import "env" "base" (global $base i32)) (import "placeholder" "1" (func $placeholder_1 (param i32) (result i32))) (table $table 1000 funcref) - (elem (global.get $base) $null $placeholder_1) + (elem $0 (global.get $base) $null $placeholder_1) (export "foo" (func $foo)) (export "%null" (func $null)) (export "%table" (table $table)) @@ -611,7 +611,7 @@ Secondary: (import "primary" "%table" (table $table 1000 funcref)) (import "primary" "%global" (global $base i32)) (import "primary" "%null" (func $null)) - (elem (global.get $base) $null $foo) + (elem $0 (global.get $base) $null $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (local.get $0) ) @@ -689,7 +689,7 @@ After: (type $none_=>_none (func)) (import "placeholder" "0" (func $placeholder_0)) (table $0 1 funcref) - (elem (i32.const 0) $placeholder_0) + (elem $0 (i32.const 0) $placeholder_0) (export "%table" (table $0)) (func $foo (type $none_=>_none) (call_indirect $0 (type $none_=>_none) @@ -701,7 +701,7 @@ Secondary: (module (type $none_=>_none (func)) (import "primary" "%table" (table $0 1 funcref)) - (elem (i32.const 0) $bar) + (elem $0 (i32.const 0) $bar) (func $bar (type $none_=>_none) (nop) ) @@ -751,7 +751,7 @@ After: (type $none_=>_none (func)) (import "placeholder" "0" (func $placeholder_0)) (table $0 1 funcref) - (elem (i32.const 0) $placeholder_0) + (elem $0 (i32.const 0) $placeholder_0) (export "%foo" (func $bar)) (export "%foo_0" (func $foo)) (export "%table" (table $0)) @@ -769,7 +769,7 @@ Secondary: (type $none_=>_none (func)) (import "primary" "%table" (table $0 1 funcref)) (import "primary" "%foo_0" (func $foo)) - (elem (i32.const 0) $bar) + (elem $0 (i32.const 0) $bar) (func $bar (type $none_=>_none) (call $foo) ) @@ -780,7 +780,7 @@ Before: (module (type $none_=>_none (func)) (table $table 4 funcref) - (elem (i32.const 0) $foo $bar $baz $quux) + (elem $0 (i32.const 0) $foo $bar $baz $quux) (func $foo (type $none_=>_none) (nop) ) @@ -801,7 +801,7 @@ After: (import "placeholder" "0" (func $placeholder_0)) (import "placeholder" "2" (func $placeholder_2)) (table $table 4 funcref) - (elem (i32.const 0) $placeholder_0 $bar $placeholder_2 $quux) + (elem $0 (i32.const 0) $placeholder_0 $bar $placeholder_2 $quux) (export "%table" (table $table)) (func $bar (type $none_=>_none) (nop) @@ -830,7 +830,7 @@ Before: (type $none_=>_none (func)) (import "env" "base" (global $base i32)) (table $table 4 funcref) - (elem (global.get $base) $foo $bar $baz $quux) + (elem $0 (global.get $base) $foo $bar $baz $quux) (func $foo (type $none_=>_none) (nop) ) @@ -852,7 +852,7 @@ After: (import "placeholder" "0" (func $placeholder_0)) (import "placeholder" "2" (func $placeholder_2)) (table $table 4 funcref) - (elem (global.get $base) $placeholder_0 $bar $placeholder_2 $quux) + (elem $0 (global.get $base) $placeholder_0 $bar $placeholder_2 $quux) (export "%bar" (func $bar)) (export "%table" (table $table)) (export "%global" (global $base)) @@ -869,7 +869,7 @@ Secondary: (import "primary" "%table" (table $table 4 funcref)) (import "primary" "%global" (global $base i32)) (import "primary" "%bar" (func $bar)) - (elem (global.get $base) $foo $bar $baz) + (elem $0 (global.get $base) $foo $bar $baz) (func $baz (type $none_=>_none) (nop) ) @@ -883,7 +883,7 @@ Before: (module (type $none_=>_none (func)) (table $table 4 funcref) - (elem (i32.const 0) $foo $bar $baz $quux) + (elem $0 (i32.const 0) $foo $bar $baz $quux) (func $foo (type $none_=>_none) (nop) ) @@ -905,7 +905,7 @@ After: (import "placeholder" "1" (func $placeholder_1)) (import "placeholder" "3" (func $placeholder_3)) (table $table 4 funcref) - (elem (i32.const 0) $placeholder_0 $placeholder_1 $baz $placeholder_3) + (elem $0 (i32.const 0) $placeholder_0 $placeholder_1 $baz $placeholder_3) (export "%table" (table $table)) (func $baz (type $none_=>_none) (nop) @@ -934,7 +934,7 @@ Before: (type $none_=>_none (func)) (import "env" "base" (global $base i32)) (table $table 4 funcref) - (elem (global.get $base) $foo $bar $baz $quux) + (elem $0 (global.get $base) $foo $bar $baz $quux) (func $foo (type $none_=>_none) (nop) ) @@ -957,7 +957,7 @@ After: (import "placeholder" "1" (func $placeholder_1)) (import "placeholder" "3" (func $placeholder_3)) (table $table 4 funcref) - (elem (global.get $base) $placeholder_0 $placeholder_1 $baz $placeholder_3) + (elem $0 (global.get $base) $placeholder_0 $placeholder_1 $baz $placeholder_3) (export "%baz" (func $baz)) (export "%table" (table $table)) (export "%global" (global $base)) @@ -971,7 +971,7 @@ Secondary: (import "primary" "%table" (table $table 4 funcref)) (import "primary" "%global" (global $base i32)) (import "primary" "%baz" (func $baz)) - (elem (global.get $base) $foo $bar $baz $quux) + (elem $0 (global.get $base) $foo $bar $baz $quux) (func $bar (type $none_=>_none) (nop) ) @@ -989,7 +989,7 @@ Before: (type $none_=>_none (func)) (import "env" "base" (global $base i32)) (table $table 2 funcref) - (elem (global.get $base) $foo $bar) + (elem $0 (global.get $base) $foo $bar) (func $foo (type $none_=>_none) (nop) ) @@ -1004,7 +1004,7 @@ After: (import "env" "base" (global $base i32)) (import "placeholder" "1" (func $placeholder_1)) (table $table 2 funcref) - (elem (global.get $base) $foo $placeholder_1) + (elem $0 (global.get $base) $foo $placeholder_1) (export "%foo" (func $foo)) (export "%table" (table $table)) (export "%global" (global $base)) @@ -1018,7 +1018,7 @@ Secondary: (import "primary" "%table" (table $table 2 funcref)) (import "primary" "%global" (global $base i32)) (import "primary" "%foo" (func $foo)) - (elem (global.get $base) $foo $bar) + (elem $0 (global.get $base) $foo $bar) (func $bar (type $none_=>_none) (call $foo) ) @@ -1029,7 +1029,7 @@ Before: (module (type $i32_=>_i32 (func (param i32) (result i32))) (table $table 1 1 funcref) - (elem (i32.const 0) $foo) + (elem $0 (i32.const 0) $foo) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) (call $bar (i32.const 0) @@ -1047,7 +1047,7 @@ After: (type $i32_=>_i32 (func (param i32) (result i32))) (import "placeholder" "1" (func $placeholder_1 (param i32) (result i32))) (table $table 2 2 funcref) - (elem (i32.const 0) $foo $placeholder_1) + (elem $0 (i32.const 0) $foo $placeholder_1) (export "%foo" (func $foo)) (export "%table" (table $table)) (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) @@ -1062,7 +1062,7 @@ Secondary: (type $i32_=>_i32 (func (param i32) (result i32))) (import "primary" "%table" (table $table 2 2 funcref)) (import "primary" "%foo" (func $foo (param i32) (result i32))) - (elem (i32.const 1) $bar) + (elem $0 (i32.const 1) $bar) (func $bar (type $i32_=>_i32) (param $0 i32) (result i32) (call $foo (i32.const 1) @@ -1086,7 +1086,7 @@ After: (type $none_=>_none (func)) (import "placeholder" "0" (func $placeholder_0)) (table $0 1 funcref) - (elem (i32.const 0) $placeholder_0) + (elem $0 (i32.const 0) $placeholder_0) (export "foo1" (func $foo)) (export "foo2" (func $foo)) (export "%table" (table $0)) @@ -1100,7 +1100,7 @@ Secondary: (module (type $none_=>_none (func)) (import "primary" "%table" (table $0 1 funcref)) - (elem (i32.const 0) $foo) + (elem $0 (i32.const 0) $foo) (func $foo (type $none_=>_none) (nop) ) |