summaryrefslogtreecommitdiff
path: root/test/binaryen.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/binaryen.js')
-rw-r--r--test/binaryen.js/call_import_error.js.txt4
-rw-r--r--test/binaryen.js/emit_asmjs.js.txt22
-rw-r--r--test/binaryen.js/hello-world.js.txt4
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt80
4 files changed, 57 insertions, 53 deletions
diff --git a/test/binaryen.js/call_import_error.js.txt b/test/binaryen.js/call_import_error.js.txt
index d60d889d2..498f603e1 100644
--- a/test/binaryen.js/call_import_error.js.txt
+++ b/test/binaryen.js/call_import_error.js.txt
@@ -3,7 +3,7 @@
(import "env" "fn" (func $fn))
(memory $0 0)
(export "main" (func $main))
- (func $main (type $v)
+ (func $main (; 1 ;) (type $v)
(call $fn)
)
)
@@ -16,7 +16,7 @@
(import "env" "fn" (func $fn))
(memory $0 0)
(export "main" (func $main))
- (func $main (type $v)
+ (func $main (; 1 ;) (type $v)
(call $fn)
)
)
diff --git a/test/binaryen.js/emit_asmjs.js.txt b/test/binaryen.js/emit_asmjs.js.txt
index 870017763..807936d93 100644
--- a/test/binaryen.js/emit_asmjs.js.txt
+++ b/test/binaryen.js/emit_asmjs.js.txt
@@ -14,45 +14,49 @@ function asmFunc(global, env, buffer) {
var Math_clz32 = global.Math.clz32;
function main($$0) {
$$0 = $$0 | 0;
+ var $$1 = 0, wasm2asm_i32$0 = 0;
return $$0 | 0;
+ return wasm2asm_i32$0 | 0;
}
function __wasm_ctz_i32(x) {
x = x | 0;
- var wasm2asm_i32$0 = 0;
- if ((x | 0) == (0 | 0)) wasm2asm_i32$0 = 32; else wasm2asm_i32$0 = 31 - Math_clz32(x ^ (x - 1 | 0) | 0) | 0;
- return wasm2asm_i32$0 | 0;
+ var $$1 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$6 = 0, $$7 = 0, $$8 = 0, $$9 = 0, $$10 = 0;
+ if ((x | 0) == (0 | 0)) $$9 = 32; else $$9 = 31 - Math_clz32(x ^ (x - 1 | 0) | 0) | 0;
+ return $$9 | 0;
}
function __wasm_popcnt_i32(x) {
x = x | 0;
- var count = 0, wasm2asm_i32$0 = 0;
+ var count = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$6 = 0, $$7 = 0, $$8 = 0, $$9 = 0, $$10 = 0, $$11 = 0, $$12 = 0, $$13 = 0, $$14 = 0, $$15 = 0;
count = 0;
b : {
l : do {
- if ((x | 0) == (0 | 0)) {
- wasm2asm_i32$0 = count;
- break b;
- }
+ $$5 = count;
+ if ((x | 0) == (0 | 0)) break b;
x = x & (x - 1 | 0) | 0;
count = count + 1 | 0;
continue l;
break l;
} while (1);
};
- return wasm2asm_i32$0 | 0;
+ return $$5 | 0;
}
function __wasm_rotl_i32(x, k) {
x = x | 0;
k = k | 0;
+ var $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$6 = 0, $$7 = 0, $$8 = 0, $$9 = 0, $$10 = 0, $$11 = 0, $$12 = 0, $$13 = 0, $$14 = 0, $$15 = 0, $$16 = 0, $$17 = 0, $$18 = 0, $$19 = 0, $$20 = 0, wasm2asm_i32$0 = 0;
return ((4294967295 >>> (k & 31 | 0) | 0) & x | 0) << (k & 31 | 0) | 0 | (((4294967295 << (32 - (k & 31 | 0) | 0) | 0) & x | 0) >>> (32 - (k & 31 | 0) | 0) | 0) | 0 | 0;
+ return wasm2asm_i32$0 | 0;
}
function __wasm_rotr_i32(x, k) {
x = x | 0;
k = k | 0;
+ var $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$6 = 0, $$7 = 0, $$8 = 0, $$9 = 0, $$10 = 0, $$11 = 0, $$12 = 0, $$13 = 0, $$14 = 0, $$15 = 0, $$16 = 0, $$17 = 0, $$18 = 0, $$19 = 0, $$20 = 0, wasm2asm_i32$0 = 0;
return ((4294967295 << (k & 31 | 0) | 0) & x | 0) >>> (k & 31 | 0) | 0 | (((4294967295 >>> (32 - (k & 31 | 0) | 0) | 0) & x | 0) << (32 - (k & 31 | 0) | 0) | 0) | 0 | 0;
+ return wasm2asm_i32$0 | 0;
}
return {
diff --git a/test/binaryen.js/hello-world.js.txt b/test/binaryen.js/hello-world.js.txt
index bcc1a88a0..48a4e0a60 100644
--- a/test/binaryen.js/hello-world.js.txt
+++ b/test/binaryen.js/hello-world.js.txt
@@ -2,7 +2,7 @@
(type $iii (func (param i32 i32) (result i32)))
(memory $0 0)
(export "adder" (func $adder))
- (func $adder (type $iii) (param $0 i32) (param $1 i32) (result i32)
+ (func $adder (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(return
(i32.add
(get_local $0)
@@ -18,7 +18,7 @@ optimized:
(type $iii (func (param i32 i32) (result i32)))
(memory $0 0)
(export "adder" (func $adder))
- (func $adder (type $iii) (param $0 i32) (param $1 i32) (result i32)
+ (func $adder (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
(get_local $1)
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index 07cdcd128..1a4e6c417 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -20,7 +20,7 @@ BinaryenFloat64: 4
(export "kitchen_sinker" (func "$kitchen()sinker"))
(export "mem" (memory $0))
(start $starter)
- (func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
+ (func "$kitchen()sinker" (; 1 ;) (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
(local $4 i32)
(block $the-body (result i32)
(block $the-nothing
@@ -533,7 +533,7 @@ BinaryenFloat64: 4
(i32.const 42)
)
)
- (func $starter (type $v)
+ (func $starter (; 2 ;) (type $v)
(nop)
)
)
@@ -545,13 +545,13 @@ raw:
(type $i (func (result i32)))
(import "module" "check" (func $check (param i32)))
(memory $0 0)
- (func $just-one-block (type $v)
+ (func $just-one-block (; 1 ;) (type $v)
(local $0 i32)
(call $check
(i32.const 1337)
)
)
- (func $two-blocks (type $v)
+ (func $two-blocks (; 2 ;) (type $v)
(local $0 i32)
(block $block$2$break
(call $check
@@ -567,7 +567,7 @@ raw:
)
)
)
- (func $two-blocks-plus-code (type $v)
+ (func $two-blocks-plus-code (; 3 ;) (type $v)
(local $0 i32)
(block $block$2$break
(call $check
@@ -586,7 +586,7 @@ raw:
)
)
)
- (func $loop (type $v)
+ (func $loop (; 4 ;) (type $v)
(local $0 i32)
(loop $shape$0$continue
(block $block$2$break
@@ -607,7 +607,7 @@ raw:
)
)
)
- (func $loop-plus-code (type $v)
+ (func $loop-plus-code (; 5 ;) (type $v)
(local $0 i32)
(loop $shape$0$continue
(block $block$2$break
@@ -634,7 +634,7 @@ raw:
)
)
)
- (func $split (type $v)
+ (func $split (; 6 ;) (type $v)
(local $0 i32)
(call $check
(i32.const 0)
@@ -653,7 +653,7 @@ raw:
)
)
)
- (func $split-plus-code (type $v)
+ (func $split-plus-code (; 7 ;) (type $v)
(local $0 i32)
(call $check
(i32.const 0)
@@ -682,7 +682,7 @@ raw:
)
)
)
- (func $if (type $v)
+ (func $if (; 8 ;) (type $v)
(local $0 i32)
(block $block$3$break
(call $check
@@ -707,7 +707,7 @@ raw:
)
)
)
- (func $if-plus-code (type $v)
+ (func $if-plus-code (; 9 ;) (type $v)
(local $0 i32)
(block $block$3$break
(call $check
@@ -745,7 +745,7 @@ raw:
)
)
)
- (func $if-else (type $v)
+ (func $if-else (; 10 ;) (type $v)
(local $0 i32)
(block $block$4$break
(call $check
@@ -777,7 +777,7 @@ raw:
)
)
)
- (func $loop-tail (type $v)
+ (func $loop-tail (; 11 ;) (type $v)
(local $0 i32)
(block $block$3$break
(loop $shape$0$continue
@@ -807,7 +807,7 @@ raw:
)
)
)
- (func $nontrivial-loop-plus-phi-to-head (type $v)
+ (func $nontrivial-loop-plus-phi-to-head (; 12 ;) (type $v)
(local $0 i32)
(block $block$2$break
(call $check
@@ -894,7 +894,7 @@ raw:
)
)
)
- (func $switch (type $v)
+ (func $switch (; 13 ;) (type $v)
(local $0 i32)
(call $check
(i32.const 0)
@@ -938,7 +938,7 @@ raw:
(br $switch$1$leave)
)
)
- (func $duffs-device (type $v)
+ (func $duffs-device (; 14 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i64)
@@ -1013,7 +1013,7 @@ raw:
)
)
)
- (func $return (type $i) (result i32)
+ (func $return (; 15 ;) (type $i) (result i32)
(local $0 i32)
(block $the-list
(call $check
@@ -1035,7 +1035,7 @@ module loaded from binary form:
(module
(type $0 (func (param i32 i32) (result i32)))
(memory $0 0)
- (func $adder (type $0) (param $var$0 i32) (param $var$1 i32) (result i32)
+ (func $adder (; 0 ;) (type $0) (param $var$0 i32) (param $var$1 i32) (result i32)
(i32.add
(get_local $var$0)
(get_local $var$1)
@@ -1049,7 +1049,7 @@ module loaded from binary form:
(import "spectest" "print" (func $print-i32 (param i32)))
(memory $0 0)
(start $starter)
- (func $starter (type $v)
+ (func $starter (; 1 ;) (type $v)
(call $print-i32
(i32.const 1234)
)
@@ -1060,7 +1060,7 @@ module loaded from binary form:
(module
(type $v (func))
(memory $0 0)
- (func $func (type $v)
+ (func $func (; 0 ;) (type $v)
(local $0 i32)
(set_local $0
(i64.const 1234)
@@ -1075,7 +1075,7 @@ module loaded from binary form:
(module
(type $v (func))
(memory $0 0)
- (func $func (type $v)
+ (func $func (; 0 ;) (type $v)
(local $0 i32)
(set_local $0
(i64.const 1234)
@@ -1435,7 +1435,7 @@ int main() {
(export "kitchen_sinker" (func "$kitchen()sinker"))
(export "mem" (memory $0))
(start $starter)
- (func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
+ (func "$kitchen()sinker" (; 1 ;) (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
(local $4 i32)
(block $the-body (result i32)
(block $the-nothing
@@ -1948,7 +1948,7 @@ int main() {
(i32.const 42)
)
)
- (func $starter (type $v)
+ (func $starter (; 2 ;) (type $v)
(nop)
)
)
@@ -2420,13 +2420,13 @@ raw:
(type $i (func (result i32)))
(import "module" "check" (func $check (param i32)))
(memory $0 0)
- (func $just-one-block (type $v)
+ (func $just-one-block (; 1 ;) (type $v)
(local $0 i32)
(call $check
(i32.const 1337)
)
)
- (func $two-blocks (type $v)
+ (func $two-blocks (; 2 ;) (type $v)
(local $0 i32)
(block $block$2$break
(call $check
@@ -2442,7 +2442,7 @@ raw:
)
)
)
- (func $two-blocks-plus-code (type $v)
+ (func $two-blocks-plus-code (; 3 ;) (type $v)
(local $0 i32)
(block $block$2$break
(call $check
@@ -2461,7 +2461,7 @@ raw:
)
)
)
- (func $loop (type $v)
+ (func $loop (; 4 ;) (type $v)
(local $0 i32)
(loop $shape$0$continue
(block $block$2$break
@@ -2482,7 +2482,7 @@ raw:
)
)
)
- (func $loop-plus-code (type $v)
+ (func $loop-plus-code (; 5 ;) (type $v)
(local $0 i32)
(loop $shape$0$continue
(block $block$2$break
@@ -2509,7 +2509,7 @@ raw:
)
)
)
- (func $split (type $v)
+ (func $split (; 6 ;) (type $v)
(local $0 i32)
(call $check
(i32.const 0)
@@ -2528,7 +2528,7 @@ raw:
)
)
)
- (func $split-plus-code (type $v)
+ (func $split-plus-code (; 7 ;) (type $v)
(local $0 i32)
(call $check
(i32.const 0)
@@ -2557,7 +2557,7 @@ raw:
)
)
)
- (func $if (type $v)
+ (func $if (; 8 ;) (type $v)
(local $0 i32)
(block $block$3$break
(call $check
@@ -2582,7 +2582,7 @@ raw:
)
)
)
- (func $if-plus-code (type $v)
+ (func $if-plus-code (; 9 ;) (type $v)
(local $0 i32)
(block $block$3$break
(call $check
@@ -2620,7 +2620,7 @@ raw:
)
)
)
- (func $if-else (type $v)
+ (func $if-else (; 10 ;) (type $v)
(local $0 i32)
(block $block$4$break
(call $check
@@ -2652,7 +2652,7 @@ raw:
)
)
)
- (func $loop-tail (type $v)
+ (func $loop-tail (; 11 ;) (type $v)
(local $0 i32)
(block $block$3$break
(loop $shape$0$continue
@@ -2682,7 +2682,7 @@ raw:
)
)
)
- (func $nontrivial-loop-plus-phi-to-head (type $v)
+ (func $nontrivial-loop-plus-phi-to-head (; 12 ;) (type $v)
(local $0 i32)
(block $block$2$break
(call $check
@@ -2769,7 +2769,7 @@ raw:
)
)
)
- (func $switch (type $v)
+ (func $switch (; 13 ;) (type $v)
(local $0 i32)
(call $check
(i32.const 0)
@@ -2813,7 +2813,7 @@ raw:
(br $switch$1$leave)
)
)
- (func $duffs-device (type $v)
+ (func $duffs-device (; 14 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i64)
@@ -2888,7 +2888,7 @@ raw:
)
)
)
- (func $return (type $i) (result i32)
+ (func $return (; 15 ;) (type $i) (result i32)
(local $0 i32)
(block $the-list
(call $check
@@ -2926,7 +2926,7 @@ test_parsing text:
(module
(type $iii (func (param i32 i32) (result i32)))
(memory $0 0)
- (func $adder (type $iii) (param $0 i32) (param $1 i32) (result i32)
+ (func $adder (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
(get_local $1)
@@ -2938,7 +2938,7 @@ module loaded from text form:
(module
(type $iii (func (param i32 i32) (result i32)))
(memory $0 0)
- (func $ADD_ER (type $iii) (param $0 i32) (param $1 i32) (result i32)
+ (func $ADD_ER (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
(get_local $1)