diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-10-13 18:07:29 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-10-14 10:00:06 -0700 |
commit | 5881b541a4b276dcd5576aa065e4fb860531fc7b (patch) | |
tree | 84f0d20d21375d2f18987a193c7a9ce4489fb200 /test | |
parent | 0dee67086c9340380975d6e7469fe223a5c8b924 (diff) | |
download | binaryen-5881b541a4b276dcd5576aa065e4fb860531fc7b.tar.gz binaryen-5881b541a4b276dcd5576aa065e4fb860531fc7b.tar.bz2 binaryen-5881b541a4b276dcd5576aa065e4fb860531fc7b.zip |
run remove-unused-functions by default
Diffstat (limited to 'test')
25 files changed, 354 insertions, 1877 deletions
diff --git a/test/emcc_O2_hello_world.fromasm b/test/emcc_O2_hello_world.fromasm index e96071d64..b32251e72 100644 --- a/test/emcc_O2_hello_world.fromasm +++ b/test/emcc_O2_hello_world.fromasm @@ -9636,56 +9636,6 @@ ) (get_local $3) ) - (func $copyTempDouble (param $0 i32) - (i32.store8 - (get_global $tempDoublePtr) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $tempDoublePtr) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $tempDoublePtr) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $tempDoublePtr) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - (i32.store8 offset=4 - (get_global $tempDoublePtr) - (i32.load8_s offset=4 - (get_local $0) - ) - ) - (i32.store8 offset=5 - (get_global $tempDoublePtr) - (i32.load8_s offset=5 - (get_local $0) - ) - ) - (i32.store8 offset=6 - (get_global $tempDoublePtr) - (i32.load8_s offset=6 - (get_local $0) - ) - ) - (i32.store8 offset=7 - (get_global $tempDoublePtr) - (i32.load8_s offset=7 - (get_local $0) - ) - ) - ) (func $___stdio_close (param $0 i32) (result i32) (local $1 i32) (local $2 i32) @@ -9719,32 +9669,6 @@ ) (get_local $0) ) - (func $copyTempFloat (param $0 i32) - (i32.store8 - (get_global $tempDoublePtr) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $tempDoublePtr) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $tempDoublePtr) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $tempDoublePtr) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - ) (func $___syscall_ret (param $0 i32) (result i32) (if i32 (i32.gt_u diff --git a/test/emcc_O2_hello_world.fromasm.imprecise b/test/emcc_O2_hello_world.fromasm.imprecise index cac338f33..9a4785389 100644 --- a/test/emcc_O2_hello_world.fromasm.imprecise +++ b/test/emcc_O2_hello_world.fromasm.imprecise @@ -9634,56 +9634,6 @@ ) (get_local $3) ) - (func $copyTempDouble (param $0 i32) - (i32.store8 - (get_global $tempDoublePtr) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $tempDoublePtr) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $tempDoublePtr) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $tempDoublePtr) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - (i32.store8 offset=4 - (get_global $tempDoublePtr) - (i32.load8_s offset=4 - (get_local $0) - ) - ) - (i32.store8 offset=5 - (get_global $tempDoublePtr) - (i32.load8_s offset=5 - (get_local $0) - ) - ) - (i32.store8 offset=6 - (get_global $tempDoublePtr) - (i32.load8_s offset=6 - (get_local $0) - ) - ) - (i32.store8 offset=7 - (get_global $tempDoublePtr) - (i32.load8_s offset=7 - (get_local $0) - ) - ) - ) (func $___stdio_close (param $0 i32) (result i32) (local $1 i32) (local $2 i32) @@ -9717,32 +9667,6 @@ ) (get_local $0) ) - (func $copyTempFloat (param $0 i32) - (i32.store8 - (get_global $tempDoublePtr) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $tempDoublePtr) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $tempDoublePtr) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $tempDoublePtr) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - ) (func $___syscall_ret (param $0 i32) (result i32) (if i32 (i32.gt_u diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm index a8d86e1bf..ddcd0c5de 100644 --- a/test/emcc_hello_world.fromasm +++ b/test/emcc_hello_world.fromasm @@ -157,82 +157,6 @@ ) ) ) - (func $copyTempFloat (param $0 i32) - (i32.store8 - (get_global $tempDoublePtr) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $tempDoublePtr) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $tempDoublePtr) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $tempDoublePtr) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - ) - (func $copyTempDouble (param $0 i32) - (i32.store8 - (get_global $tempDoublePtr) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $tempDoublePtr) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $tempDoublePtr) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $tempDoublePtr) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - (i32.store8 offset=4 - (get_global $tempDoublePtr) - (i32.load8_s offset=4 - (get_local $0) - ) - ) - (i32.store8 offset=5 - (get_global $tempDoublePtr) - (i32.load8_s offset=5 - (get_local $0) - ) - ) - (i32.store8 offset=6 - (get_global $tempDoublePtr) - (i32.load8_s offset=6 - (get_local $0) - ) - ) - (i32.store8 offset=7 - (get_global $tempDoublePtr) - (i32.load8_s offset=7 - (get_local $0) - ) - ) - ) (func $setTempRet0 (param $0 i32) (set_global $tempRet0 (get_local $0) @@ -16072,491 +15996,6 @@ ) (get_local $3) ) - (func $_bitshift64Ashr (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (if - (i32.lt_s - (get_local $2) - (i32.const 32) - ) - (block - (set_global $tempRet0 - (i32.shr_s - (get_local $1) - (get_local $2) - ) - ) - (return - (i32.or - (i32.shr_u - (get_local $0) - (get_local $2) - ) - (i32.shl - (i32.and - (get_local $1) - (i32.sub - (i32.shl - (i32.const 1) - (get_local $2) - ) - (i32.const 1) - ) - ) - (i32.sub - (i32.const 32) - (get_local $2) - ) - ) - ) - ) - ) - ) - (set_global $tempRet0 - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - ) - (i32.shr_s - (get_local $1) - (i32.sub - (get_local $2) - (i32.const 32) - ) - ) - ) - (func $___muldsi3 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (set_local $2 - (i32.add - (i32.shr_u - (tee_local $4 - (i32.mul - (tee_local $2 - (i32.and - (get_local $1) - (i32.const 65535) - ) - ) - (tee_local $3 - (i32.and - (get_local $0) - (i32.const 65535) - ) - ) - ) - ) - (i32.const 16) - ) - (i32.mul - (get_local $2) - (tee_local $0 - (i32.shr_u - (get_local $0) - (i32.const 16) - ) - ) - ) - ) - ) - (set_local $3 - (i32.mul - (tee_local $1 - (i32.shr_u - (get_local $1) - (i32.const 16) - ) - ) - (get_local $3) - ) - ) - (set_global $tempRet0 - (i32.add - (i32.add - (i32.shr_u - (get_local $2) - (i32.const 16) - ) - (i32.mul - (get_local $1) - (get_local $0) - ) - ) - (i32.shr_u - (i32.add - (i32.and - (get_local $2) - (i32.const 65535) - ) - (get_local $3) - ) - (i32.const 16) - ) - ) - ) - (i32.or - (i32.const 0) - (i32.or - (i32.shl - (i32.add - (get_local $2) - (get_local $3) - ) - (i32.const 16) - ) - (i32.and - (get_local $4) - (i32.const 65535) - ) - ) - ) - ) - (func $___divdi3 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (set_local $6 - (call $_i64Subtract - (i32.xor - (tee_local $4 - (i32.or - (i32.shr_s - (get_local $1) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $0) - ) - (i32.xor - (tee_local $0 - (i32.or - (i32.shr_s - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $1) - ) - (get_local $4) - (get_local $0) - ) - ) - (set_local $5 - (i32.xor - (tee_local $1 - (i32.or - (i32.shr_s - (get_local $3) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $4) - ) - ) - (set_local $0 - (i32.xor - (tee_local $4 - (i32.or - (i32.shr_s - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $0) - ) - ) - (call $_i64Subtract - (i32.xor - (call $___udivmoddi4 - (get_local $6) - (get_global $tempRet0) - (call $_i64Subtract - (i32.xor - (get_local $1) - (get_local $2) - ) - (i32.xor - (get_local $4) - (get_local $3) - ) - (get_local $1) - (get_local $4) - ) - (get_global $tempRet0) - (i32.const 0) - ) - (get_local $5) - ) - (i32.xor - (get_global $tempRet0) - (get_local $0) - ) - (get_local $5) - (get_local $0) - ) - ) - (func $___remdi3 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (set_local $6 - (get_global $STACKTOP) - ) - (set_global $STACKTOP - (i32.add - (get_global $STACKTOP) - (i32.const 16) - ) - ) - (drop - (call $___udivmoddi4 - (call $_i64Subtract - (i32.xor - (tee_local $4 - (i32.or - (i32.shr_s - (get_local $1) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $0) - ) - (i32.xor - (tee_local $5 - (i32.or - (i32.shr_s - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $1) - ) - (get_local $4) - (get_local $5) - ) - (get_global $tempRet0) - (call $_i64Subtract - (i32.xor - (tee_local $0 - (i32.or - (i32.shr_s - (get_local $3) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $2) - ) - (i32.xor - (tee_local $1 - (i32.or - (i32.shr_s - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $3) - ) - (get_local $0) - (get_local $1) - ) - (get_global $tempRet0) - (tee_local $0 - (get_local $6) - ) - ) - ) - (set_local $0 - (call $_i64Subtract - (i32.xor - (i32.load - (get_local $0) - ) - (get_local $4) - ) - (i32.xor - (i32.load offset=4 - (get_local $0) - ) - (get_local $5) - ) - (get_local $4) - (get_local $5) - ) - ) - (set_global $STACKTOP - (get_local $6) - ) - (get_local $0) - ) - (func $___muldi3 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (set_local $4 - (call $___muldsi3 - (get_local $0) - (get_local $2) - ) - ) - (set_global $tempRet0 - (i32.or - (i32.add - (i32.add - (i32.mul - (get_local $3) - (get_local $0) - ) - (i32.mul - (get_local $1) - (get_local $2) - ) - ) - (tee_local $0 - (get_global $tempRet0) - ) - ) - (i32.and - (get_local $0) - (i32.const 0) - ) - ) - ) - (i32.or - (i32.const 0) - (i32.and - (get_local $4) - (i32.const -1) - ) - ) - ) (func $___udivdi3 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (call $___udivmoddi4 (get_local $0) diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise index 73176446f..931831ccc 100644 --- a/test/emcc_hello_world.fromasm.imprecise +++ b/test/emcc_hello_world.fromasm.imprecise @@ -150,82 +150,6 @@ ) ) ) - (func $copyTempFloat (param $0 i32) - (i32.store8 - (get_global $tempDoublePtr) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $tempDoublePtr) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $tempDoublePtr) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $tempDoublePtr) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - ) - (func $copyTempDouble (param $0 i32) - (i32.store8 - (get_global $tempDoublePtr) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $tempDoublePtr) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $tempDoublePtr) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $tempDoublePtr) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - (i32.store8 offset=4 - (get_global $tempDoublePtr) - (i32.load8_s offset=4 - (get_local $0) - ) - ) - (i32.store8 offset=5 - (get_global $tempDoublePtr) - (i32.load8_s offset=5 - (get_local $0) - ) - ) - (i32.store8 offset=6 - (get_global $tempDoublePtr) - (i32.load8_s offset=6 - (get_local $0) - ) - ) - (i32.store8 offset=7 - (get_global $tempDoublePtr) - (i32.load8_s offset=7 - (get_local $0) - ) - ) - ) (func $setTempRet0 (param $0 i32) (set_global $tempRet0 (get_local $0) @@ -16065,491 +15989,6 @@ ) (get_local $3) ) - (func $_bitshift64Ashr (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (if - (i32.lt_s - (get_local $2) - (i32.const 32) - ) - (block - (set_global $tempRet0 - (i32.shr_s - (get_local $1) - (get_local $2) - ) - ) - (return - (i32.or - (i32.shr_u - (get_local $0) - (get_local $2) - ) - (i32.shl - (i32.and - (get_local $1) - (i32.sub - (i32.shl - (i32.const 1) - (get_local $2) - ) - (i32.const 1) - ) - ) - (i32.sub - (i32.const 32) - (get_local $2) - ) - ) - ) - ) - ) - ) - (set_global $tempRet0 - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - ) - (i32.shr_s - (get_local $1) - (i32.sub - (get_local $2) - (i32.const 32) - ) - ) - ) - (func $___muldsi3 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (set_local $2 - (i32.add - (i32.shr_u - (tee_local $4 - (i32.mul - (tee_local $2 - (i32.and - (get_local $1) - (i32.const 65535) - ) - ) - (tee_local $3 - (i32.and - (get_local $0) - (i32.const 65535) - ) - ) - ) - ) - (i32.const 16) - ) - (i32.mul - (get_local $2) - (tee_local $0 - (i32.shr_u - (get_local $0) - (i32.const 16) - ) - ) - ) - ) - ) - (set_local $3 - (i32.mul - (tee_local $1 - (i32.shr_u - (get_local $1) - (i32.const 16) - ) - ) - (get_local $3) - ) - ) - (set_global $tempRet0 - (i32.add - (i32.add - (i32.shr_u - (get_local $2) - (i32.const 16) - ) - (i32.mul - (get_local $1) - (get_local $0) - ) - ) - (i32.shr_u - (i32.add - (i32.and - (get_local $2) - (i32.const 65535) - ) - (get_local $3) - ) - (i32.const 16) - ) - ) - ) - (i32.or - (i32.const 0) - (i32.or - (i32.shl - (i32.add - (get_local $2) - (get_local $3) - ) - (i32.const 16) - ) - (i32.and - (get_local $4) - (i32.const 65535) - ) - ) - ) - ) - (func $___divdi3 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (set_local $6 - (call $_i64Subtract - (i32.xor - (tee_local $4 - (i32.or - (i32.shr_s - (get_local $1) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $0) - ) - (i32.xor - (tee_local $0 - (i32.or - (i32.shr_s - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $1) - ) - (get_local $4) - (get_local $0) - ) - ) - (set_local $5 - (i32.xor - (tee_local $1 - (i32.or - (i32.shr_s - (get_local $3) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $4) - ) - ) - (set_local $0 - (i32.xor - (tee_local $4 - (i32.or - (i32.shr_s - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $0) - ) - ) - (call $_i64Subtract - (i32.xor - (call $___udivmoddi4 - (get_local $6) - (get_global $tempRet0) - (call $_i64Subtract - (i32.xor - (get_local $1) - (get_local $2) - ) - (i32.xor - (get_local $4) - (get_local $3) - ) - (get_local $1) - (get_local $4) - ) - (get_global $tempRet0) - (i32.const 0) - ) - (get_local $5) - ) - (i32.xor - (get_global $tempRet0) - (get_local $0) - ) - (get_local $5) - (get_local $0) - ) - ) - (func $___remdi3 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (set_local $6 - (get_global $STACKTOP) - ) - (set_global $STACKTOP - (i32.add - (get_global $STACKTOP) - (i32.const 16) - ) - ) - (drop - (call $___udivmoddi4 - (call $_i64Subtract - (i32.xor - (tee_local $4 - (i32.or - (i32.shr_s - (get_local $1) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $0) - ) - (i32.xor - (tee_local $5 - (i32.or - (i32.shr_s - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $1) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $1) - ) - (get_local $4) - (get_local $5) - ) - (get_global $tempRet0) - (call $_i64Subtract - (i32.xor - (tee_local $0 - (i32.or - (i32.shr_s - (get_local $3) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $2) - ) - (i32.xor - (tee_local $1 - (i32.or - (i32.shr_s - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 31) - ) - (i32.shl - (select - (i32.const -1) - (i32.const 0) - (i32.lt_s - (get_local $3) - (i32.const 0) - ) - ) - (i32.const 1) - ) - ) - ) - (get_local $3) - ) - (get_local $0) - (get_local $1) - ) - (get_global $tempRet0) - (tee_local $0 - (get_local $6) - ) - ) - ) - (set_local $0 - (call $_i64Subtract - (i32.xor - (i32.load - (get_local $0) - ) - (get_local $4) - ) - (i32.xor - (i32.load offset=4 - (get_local $0) - ) - (get_local $5) - ) - (get_local $4) - (get_local $5) - ) - ) - (set_global $STACKTOP - (get_local $6) - ) - (get_local $0) - ) - (func $___muldi3 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (set_local $4 - (call $___muldsi3 - (get_local $0) - (get_local $2) - ) - ) - (set_global $tempRet0 - (i32.or - (i32.add - (i32.add - (i32.mul - (get_local $3) - (get_local $0) - ) - (i32.mul - (get_local $1) - (get_local $2) - ) - ) - (tee_local $0 - (get_global $tempRet0) - ) - ) - (i32.and - (get_local $0) - (i32.const 0) - ) - ) - ) - (i32.or - (i32.const 0) - (i32.and - (get_local $4) - (i32.const -1) - ) - ) - ) (func $___udivdi3 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (call $___udivmoddi4 (get_local $0) diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index d16999b47..1de260b20 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -1030,155 +1030,6 @@ optimized: (type $i (func (result i32))) (import "module" "check" (func $check (param i32))) (memory $0 0) - (func $just-one-block (type $v) - (call $check - (i32.const 1337) - ) - ) - (func $two-blocks (type $v) - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - ) - (func $loop (type $v) - (loop $shape$0$continue - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (br $shape$0$continue) - ) - ) - (func $if (type $v) - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (call $check - (i32.const 2) - ) - ) - (func $if-else (type $v) - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (call $check - (i32.const 3) - ) - ) - (func $loop-tail (type $v) - (block $block$3$break - (loop $shape$0$continue - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (br $shape$0$continue) - ) - ) - (call $check - (i32.const 2) - ) - ) - (func $nontrivial-loop-plus-phi-to-head (type $v) - (call $check - (i32.const 0) - ) - (block $block$7$break - (block $block$4$break - (loop $shape$1$continue - (call $check - (i32.const 1) - ) - (call $check - (i32.const 2) - ) - (br $block$4$break) - ) - ) - (call $check - (i32.const 3) - ) - (call $check - (i32.const 4) - ) - (call $check - (i32.const 5) - ) - ) - (call $check - (i32.const 6) - ) - ) - (func $switch (type $v) - (call $check - (i32.const 0) - ) - (block $switch$1$leave - (call $check - (i32.const 3) - ) - ) - ) - (func $duffs-device (type $v) - (local $0 i32) - (call $check - (i32.const 0) - ) - (set_local $0 - (i32.const 2) - ) - (loop $shape$1$continue - (if - (i32.eq - (get_local $0) - (i32.const 2) - ) - (block - (call $check - (i32.const 1) - ) - (set_local $0 - (i32.const 3) - ) - (br $shape$1$continue) - ) - (if - (i32.eq - (get_local $0) - (i32.const 3) - ) - (block - (call $check - (i32.const 2) - ) - (set_local $0 - (i32.const 2) - ) - (br $shape$1$continue) - ) - ) - ) - ) - ) - (func $return (type $i) (result i32) - (call $check - (i32.const 42) - ) - (i32.const 1337) - ) ) module loaded from binary form: (module @@ -3037,155 +2888,6 @@ optimized: (type $i (func (result i32))) (import "module" "check" (func $check (param i32))) (memory $0 0) - (func $just-one-block (type $v) - (call $check - (i32.const 1337) - ) - ) - (func $two-blocks (type $v) - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - ) - (func $loop (type $v) - (loop $shape$0$continue - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (br $shape$0$continue) - ) - ) - (func $if (type $v) - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (call $check - (i32.const 2) - ) - ) - (func $if-else (type $v) - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (call $check - (i32.const 3) - ) - ) - (func $loop-tail (type $v) - (block $block$3$break - (loop $shape$0$continue - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (br $shape$0$continue) - ) - ) - (call $check - (i32.const 2) - ) - ) - (func $nontrivial-loop-plus-phi-to-head (type $v) - (call $check - (i32.const 0) - ) - (block $block$7$break - (block $block$4$break - (loop $shape$1$continue - (call $check - (i32.const 1) - ) - (call $check - (i32.const 2) - ) - (br $block$4$break) - ) - ) - (call $check - (i32.const 3) - ) - (call $check - (i32.const 4) - ) - (call $check - (i32.const 5) - ) - ) - (call $check - (i32.const 6) - ) - ) - (func $switch (type $v) - (call $check - (i32.const 0) - ) - (block $switch$1$leave - (call $check - (i32.const 3) - ) - ) - ) - (func $duffs-device (type $v) - (local $0 i32) - (call $check - (i32.const 0) - ) - (set_local $0 - (i32.const 2) - ) - (loop $shape$1$continue - (if - (i32.eq - (get_local $0) - (i32.const 2) - ) - (block - (call $check - (i32.const 1) - ) - (set_local $0 - (i32.const 3) - ) - (br $shape$1$continue) - ) - (if - (i32.eq - (get_local $0) - (i32.const 3) - ) - (block - (call $check - (i32.const 2) - ) - (set_local $0 - (i32.const 2) - ) - (br $shape$1$continue) - ) - ) - ) - ) - ) - (func $return (type $i) (result i32) - (call $check - (i32.const 42) - ) - (i32.const 1337) - ) ) BinaryenModuleDispose(the_module); functionTypes.clear(); diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt index 26a765b26..16e4941d3 100644 --- a/test/example/c-api-kitchen-sink.txt.txt +++ b/test/example/c-api-kitchen-sink.txt.txt @@ -1023,153 +1023,4 @@ (type $i (func (result i32))) (import "module" "check" (func $check (param i32))) (memory $0 0) - (func $just-one-block (type $v) - (call $check - (i32.const 1337) - ) - ) - (func $two-blocks (type $v) - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - ) - (func $loop (type $v) - (loop $shape$0$continue - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (br $shape$0$continue) - ) - ) - (func $if (type $v) - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (call $check - (i32.const 2) - ) - ) - (func $if-else (type $v) - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (call $check - (i32.const 3) - ) - ) - (func $loop-tail (type $v) - (block $block$3$break - (loop $shape$0$continue - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (br $shape$0$continue) - ) - ) - (call $check - (i32.const 2) - ) - ) - (func $nontrivial-loop-plus-phi-to-head (type $v) - (call $check - (i32.const 0) - ) - (block $block$7$break - (block $block$4$break - (loop $shape$1$continue - (call $check - (i32.const 1) - ) - (call $check - (i32.const 2) - ) - (br $block$4$break) - ) - ) - (call $check - (i32.const 3) - ) - (call $check - (i32.const 4) - ) - (call $check - (i32.const 5) - ) - ) - (call $check - (i32.const 6) - ) - ) - (func $switch (type $v) - (call $check - (i32.const 0) - ) - (block $switch$1$leave - (call $check - (i32.const 3) - ) - ) - ) - (func $duffs-device (type $v) - (local $0 i32) - (call $check - (i32.const 0) - ) - (set_local $0 - (i32.const 2) - ) - (loop $shape$1$continue - (if - (i32.eq - (get_local $0) - (i32.const 2) - ) - (block - (call $check - (i32.const 1) - ) - (set_local $0 - (i32.const 3) - ) - (br $shape$1$continue) - ) - (if - (i32.eq - (get_local $0) - (i32.const 3) - ) - (block - (call $check - (i32.const 2) - ) - (set_local $0 - (i32.const 2) - ) - (br $shape$1$continue) - ) - ) - ) - ) - ) - (func $return (type $i) (result i32) - (call $check - (i32.const 42) - ) - (i32.const 1337) - ) ) diff --git a/test/memorygrowth.fromasm b/test/memorygrowth.fromasm index 2ebb9f60f..47e0c732a 100644 --- a/test/memorygrowth.fromasm +++ b/test/memorygrowth.fromasm @@ -9684,56 +9684,6 @@ ) (get_local $3) ) - (func $Ka (param $0 i32) - (i32.store8 - (get_global $t) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $t) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $t) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $t) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - (i32.store8 offset=4 - (get_global $t) - (i32.load8_s offset=4 - (get_local $0) - ) - ) - (i32.store8 offset=5 - (get_global $t) - (i32.load8_s offset=5 - (get_local $0) - ) - ) - (i32.store8 offset=6 - (get_global $t) - (i32.load8_s offset=6 - (get_local $0) - ) - ) - (i32.store8 offset=7 - (get_global $t) - (i32.load8_s offset=7 - (get_local $0) - ) - ) - ) (func $Oa (param $0 i32) (result i32) (local $1 i32) (local $2 i32) @@ -9786,32 +9736,6 @@ (get_local $0) ) ) - (func $Ja (param $0 i32) - (i32.store8 - (get_global $t) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $t) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $t) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $t) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - ) (func $Qa (result i32) (if i32 (i32.load diff --git a/test/memorygrowth.fromasm.imprecise b/test/memorygrowth.fromasm.imprecise index 7e970f096..6e70dec95 100644 --- a/test/memorygrowth.fromasm.imprecise +++ b/test/memorygrowth.fromasm.imprecise @@ -9682,56 +9682,6 @@ ) (get_local $3) ) - (func $Ka (param $0 i32) - (i32.store8 - (get_global $t) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $t) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $t) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $t) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - (i32.store8 offset=4 - (get_global $t) - (i32.load8_s offset=4 - (get_local $0) - ) - ) - (i32.store8 offset=5 - (get_global $t) - (i32.load8_s offset=5 - (get_local $0) - ) - ) - (i32.store8 offset=6 - (get_global $t) - (i32.load8_s offset=6 - (get_local $0) - ) - ) - (i32.store8 offset=7 - (get_global $t) - (i32.load8_s offset=7 - (get_local $0) - ) - ) - ) (func $Oa (param $0 i32) (result i32) (local $1 i32) (local $2 i32) @@ -9784,32 +9734,6 @@ (get_local $0) ) ) - (func $Ja (param $0 i32) - (i32.store8 - (get_global $t) - (i32.load8_s - (get_local $0) - ) - ) - (i32.store8 offset=1 - (get_global $t) - (i32.load8_s offset=1 - (get_local $0) - ) - ) - (i32.store8 offset=2 - (get_global $t) - (i32.load8_s offset=2 - (get_local $0) - ) - ) - (i32.store8 offset=3 - (get_global $t) - (i32.load8_s offset=3 - (get_local $0) - ) - ) - ) (func $Qa (result i32) (if i32 (i32.load diff --git a/test/min.asm.js b/test/min.asm.js index bef48f4c2..335287988 100644 --- a/test/min.asm.js +++ b/test/min.asm.js @@ -47,6 +47,6 @@ function (global, env, buffer) { return M | 0; } - return { floats: floats, getTempRet0: ub }; + return { floats: floats, getTempRet0: ub, neg: neg, bitcasts: bitcasts, ctzzzz: ctzzzz }; } diff --git a/test/min.fromasm b/test/min.fromasm index 96a40e52b..c54c786a6 100644 --- a/test/min.fromasm +++ b/test/min.fromasm @@ -9,6 +9,9 @@ (global $M (mut i32) (i32.const 0)) (export "floats" (func $floats)) (export "getTempRet0" (func $ub)) + (export "neg" (func $neg)) + (export "bitcasts" (func $bitcasts)) + (export "ctzzzz" (func $ctzzzz)) (func $floats (param $0 f32) (result f32) (local $1 f32) (f32.add diff --git a/test/min.fromasm.imprecise b/test/min.fromasm.imprecise index 219c77609..d2a09dd4e 100644 --- a/test/min.fromasm.imprecise +++ b/test/min.fromasm.imprecise @@ -8,6 +8,9 @@ (global $M (mut i32) (i32.const 0)) (export "floats" (func $floats)) (export "getTempRet0" (func $ub)) + (export "neg" (func $neg)) + (export "bitcasts" (func $bitcasts)) + (export "ctzzzz" (func $ctzzzz)) (func $floats (param $0 f32) (result f32) (local $1 f32) (f32.add diff --git a/test/min.fromasm.imprecise.no-opts b/test/min.fromasm.imprecise.no-opts index b6c55dd2d..4bbdeff65 100644 --- a/test/min.fromasm.imprecise.no-opts +++ b/test/min.fromasm.imprecise.no-opts @@ -8,6 +8,9 @@ (global $M (mut i32) (i32.const 0)) (export "floats" (func $floats)) (export "getTempRet0" (func $ub)) + (export "neg" (func $neg)) + (export "bitcasts" (func $bitcasts)) + (export "ctzzzz" (func $ctzzzz)) (func $floats (param $f f32) (result f32) (local $t f32) (return diff --git a/test/min.fromasm.no-opts b/test/min.fromasm.no-opts index b6c55dd2d..4bbdeff65 100644 --- a/test/min.fromasm.no-opts +++ b/test/min.fromasm.no-opts @@ -8,6 +8,9 @@ (global $M (mut i32) (i32.const 0)) (export "floats" (func $floats)) (export "getTempRet0" (func $ub)) + (export "neg" (func $neg)) + (export "bitcasts" (func $bitcasts)) + (export "ctzzzz" (func $ctzzzz)) (func $floats (param $f f32) (result f32) (local $t f32) (return diff --git a/test/passes/O.txt b/test/passes/O.txt index 531712311..887feb6ae 100644 --- a/test/passes/O.txt +++ b/test/passes/O.txt @@ -1,6 +1,7 @@ (module (type $0 (func (result i32))) (memory $0 0) + (export "ret" (func $ret)) (func $ret (type $0) (result i32) (block $out i32 (drop diff --git a/test/passes/O.wast b/test/passes/O.wast index e93a5b8d9..8477c5306 100644 --- a/test/passes/O.wast +++ b/test/passes/O.wast @@ -1,5 +1,5 @@ (module - (func $ret (result i32) + (func $ret (export "ret") (result i32) (block $out i32 (drop (call $ret)) (if (call $ret) diff --git a/test/unit.asm.js b/test/unit.asm.js index c3adb2a3a..949d68dcb 100644 --- a/test/unit.asm.js +++ b/test/unit.asm.js @@ -605,6 +605,6 @@ function asm(global, env, buffer) { var FUNCTION_TABLE_b = [ w, w, importedDoubles, w ]; var FUNCTION_TABLE_c = [ z, cneg ]; - return { big_negative: big_negative, pick: forgetMe, pick: exportMe }; + return { big_negative: big_negative, pick: forgetMe, pick: exportMe, doubleCompares: doubleCompares, intOps: intOps, conversions: conversions, switcher: switcher, frem: frem, big_uint_div_u: big_uint_div_u, fr: fr, negZero: negZero, neg: neg, smallCompare: smallCompare, cneg_nosemicolon: cneg_nosemicolon, forLoop: forLoop, ceiling_32_64: ceiling_32_64, aborts: aborts, continues: continues, bitcasts: bitcasts, recursiveBlockMerging: recursiveBlockMerging, lb: lb, zeroInit: zeroInit, phi: phi, smallIf: smallIf, dropCall: dropCall, useSetGlobal: useSetGlobal, usesSetGlobal2: usesSetGlobal2, breakThroughMany: breakThroughMany, ifChainEmpty: ifChainEmpty, heap8NoShift: heap8NoShift, conditionalTypeFun: conditionalTypeFun, loadSigned: loadSigned, globalOpts: globalOpts, dropCallImport: dropCallImport, loophi: loophi, loophi2: loophi2, relooperJumpThreading: relooperJumpThreading, relooperJumpThreading__ZN4game14preloadweaponsEv: relooperJumpThreading__ZN4game14preloadweaponsEv, __Z12multi_varargiz: __Z12multi_varargiz, jumpThreadDrop: jumpThreadDrop, dropIgnoredImportInIf: dropIgnoredImportInIf, dropIgnoredImportsInIf: dropIgnoredImportsInIf }; } diff --git a/test/unit.fromasm b/test/unit.fromasm index 9388f0a96..28bd8f223 100644 --- a/test/unit.fromasm +++ b/test/unit.fromasm @@ -35,6 +35,45 @@ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) (export "big_negative" (func $big_negative)) (export "pick" (func $big_negative)) + (export "doubleCompares" (func $doubleCompares)) + (export "intOps" (func $intOps)) + (export "conversions" (func $conversions)) + (export "switcher" (func $switcher)) + (export "frem" (func $frem)) + (export "big_uint_div_u" (func $big_uint_div_u)) + (export "fr" (func $fr)) + (export "negZero" (func $negZero)) + (export "neg" (func $neg)) + (export "smallCompare" (func $smallCompare)) + (export "cneg_nosemicolon" (func $cneg_nosemicolon)) + (export "forLoop" (func $forLoop)) + (export "ceiling_32_64" (func $ceiling_32_64)) + (export "aborts" (func $aborts)) + (export "continues" (func $continues)) + (export "bitcasts" (func $bitcasts)) + (export "recursiveBlockMerging" (func $recursiveBlockMerging)) + (export "lb" (func $lb)) + (export "zeroInit" (func $zeroInit)) + (export "phi" (func $phi)) + (export "smallIf" (func $smallIf)) + (export "dropCall" (func $dropCall)) + (export "useSetGlobal" (func $useSetGlobal)) + (export "usesSetGlobal2" (func $usesSetGlobal2)) + (export "breakThroughMany" (func $breakThroughMany)) + (export "ifChainEmpty" (func $ifChainEmpty)) + (export "heap8NoShift" (func $heap8NoShift)) + (export "conditionalTypeFun" (func $conditionalTypeFun)) + (export "loadSigned" (func $loadSigned)) + (export "globalOpts" (func $globalOpts)) + (export "dropCallImport" (func $dropCallImport)) + (export "loophi" (func $loophi)) + (export "loophi2" (func $loophi2)) + (export "relooperJumpThreading" (func $relooperJumpThreading)) + (export "relooperJumpThreading__ZN4game14preloadweaponsEv" (func $relooperJumpThreading__ZN4game14preloadweaponsEv)) + (export "__Z12multi_varargiz" (func $__Z12multi_varargiz)) + (export "jumpThreadDrop" (func $jumpThreadDrop)) + (export "dropIgnoredImportInIf" (func $dropIgnoredImportInIf)) + (export "dropIgnoredImportsInIf" (func $dropIgnoredImportsInIf)) (func $big_negative (nop) ) diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise index ccf1d5ada..0760055bc 100644 --- a/test/unit.fromasm.imprecise +++ b/test/unit.fromasm.imprecise @@ -30,6 +30,45 @@ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) (export "big_negative" (func $big_negative)) (export "pick" (func $big_negative)) + (export "doubleCompares" (func $doubleCompares)) + (export "intOps" (func $intOps)) + (export "conversions" (func $conversions)) + (export "switcher" (func $switcher)) + (export "frem" (func $frem)) + (export "big_uint_div_u" (func $big_uint_div_u)) + (export "fr" (func $fr)) + (export "negZero" (func $negZero)) + (export "neg" (func $neg)) + (export "smallCompare" (func $smallCompare)) + (export "cneg_nosemicolon" (func $cneg_nosemicolon)) + (export "forLoop" (func $forLoop)) + (export "ceiling_32_64" (func $ceiling_32_64)) + (export "aborts" (func $aborts)) + (export "continues" (func $continues)) + (export "bitcasts" (func $bitcasts)) + (export "recursiveBlockMerging" (func $recursiveBlockMerging)) + (export "lb" (func $lb)) + (export "zeroInit" (func $zeroInit)) + (export "phi" (func $phi)) + (export "smallIf" (func $smallIf)) + (export "dropCall" (func $dropCall)) + (export "useSetGlobal" (func $useSetGlobal)) + (export "usesSetGlobal2" (func $usesSetGlobal2)) + (export "breakThroughMany" (func $breakThroughMany)) + (export "ifChainEmpty" (func $ifChainEmpty)) + (export "heap8NoShift" (func $heap8NoShift)) + (export "conditionalTypeFun" (func $conditionalTypeFun)) + (export "loadSigned" (func $loadSigned)) + (export "globalOpts" (func $globalOpts)) + (export "dropCallImport" (func $dropCallImport)) + (export "loophi" (func $loophi)) + (export "loophi2" (func $loophi2)) + (export "relooperJumpThreading" (func $relooperJumpThreading)) + (export "relooperJumpThreading__ZN4game14preloadweaponsEv" (func $relooperJumpThreading__ZN4game14preloadweaponsEv)) + (export "__Z12multi_varargiz" (func $__Z12multi_varargiz)) + (export "jumpThreadDrop" (func $jumpThreadDrop)) + (export "dropIgnoredImportInIf" (func $dropIgnoredImportInIf)) + (export "dropIgnoredImportsInIf" (func $dropIgnoredImportsInIf)) (func $big_negative (nop) ) diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts index f62c079ec..d57861df3 100644 --- a/test/unit.fromasm.imprecise.no-opts +++ b/test/unit.fromasm.imprecise.no-opts @@ -30,6 +30,45 @@ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) (export "big_negative" (func $big_negative)) (export "pick" (func $exportMe)) + (export "doubleCompares" (func $doubleCompares)) + (export "intOps" (func $intOps)) + (export "conversions" (func $conversions)) + (export "switcher" (func $switcher)) + (export "frem" (func $frem)) + (export "big_uint_div_u" (func $big_uint_div_u)) + (export "fr" (func $fr)) + (export "negZero" (func $negZero)) + (export "neg" (func $neg)) + (export "smallCompare" (func $smallCompare)) + (export "cneg_nosemicolon" (func $cneg_nosemicolon)) + (export "forLoop" (func $forLoop)) + (export "ceiling_32_64" (func $ceiling_32_64)) + (export "aborts" (func $aborts)) + (export "continues" (func $continues)) + (export "bitcasts" (func $bitcasts)) + (export "recursiveBlockMerging" (func $recursiveBlockMerging)) + (export "lb" (func $lb)) + (export "zeroInit" (func $zeroInit)) + (export "phi" (func $phi)) + (export "smallIf" (func $smallIf)) + (export "dropCall" (func $dropCall)) + (export "useSetGlobal" (func $useSetGlobal)) + (export "usesSetGlobal2" (func $usesSetGlobal2)) + (export "breakThroughMany" (func $breakThroughMany)) + (export "ifChainEmpty" (func $ifChainEmpty)) + (export "heap8NoShift" (func $heap8NoShift)) + (export "conditionalTypeFun" (func $conditionalTypeFun)) + (export "loadSigned" (func $loadSigned)) + (export "globalOpts" (func $globalOpts)) + (export "dropCallImport" (func $dropCallImport)) + (export "loophi" (func $loophi)) + (export "loophi2" (func $loophi2)) + (export "relooperJumpThreading" (func $relooperJumpThreading)) + (export "relooperJumpThreading__ZN4game14preloadweaponsEv" (func $relooperJumpThreading__ZN4game14preloadweaponsEv)) + (export "__Z12multi_varargiz" (func $__Z12multi_varargiz)) + (export "jumpThreadDrop" (func $jumpThreadDrop)) + (export "dropIgnoredImportInIf" (func $dropIgnoredImportInIf)) + (export "dropIgnoredImportsInIf" (func $dropIgnoredImportsInIf)) (func $big_negative (local $temp f64) (set_local $temp diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts index 6ae0f701a..ef985ce07 100644 --- a/test/unit.fromasm.no-opts +++ b/test/unit.fromasm.no-opts @@ -34,6 +34,45 @@ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) (export "big_negative" (func $big_negative)) (export "pick" (func $exportMe)) + (export "doubleCompares" (func $doubleCompares)) + (export "intOps" (func $intOps)) + (export "conversions" (func $conversions)) + (export "switcher" (func $switcher)) + (export "frem" (func $frem)) + (export "big_uint_div_u" (func $big_uint_div_u)) + (export "fr" (func $fr)) + (export "negZero" (func $negZero)) + (export "neg" (func $neg)) + (export "smallCompare" (func $smallCompare)) + (export "cneg_nosemicolon" (func $cneg_nosemicolon)) + (export "forLoop" (func $forLoop)) + (export "ceiling_32_64" (func $ceiling_32_64)) + (export "aborts" (func $aborts)) + (export "continues" (func $continues)) + (export "bitcasts" (func $bitcasts)) + (export "recursiveBlockMerging" (func $recursiveBlockMerging)) + (export "lb" (func $lb)) + (export "zeroInit" (func $zeroInit)) + (export "phi" (func $phi)) + (export "smallIf" (func $smallIf)) + (export "dropCall" (func $dropCall)) + (export "useSetGlobal" (func $useSetGlobal)) + (export "usesSetGlobal2" (func $usesSetGlobal2)) + (export "breakThroughMany" (func $breakThroughMany)) + (export "ifChainEmpty" (func $ifChainEmpty)) + (export "heap8NoShift" (func $heap8NoShift)) + (export "conditionalTypeFun" (func $conditionalTypeFun)) + (export "loadSigned" (func $loadSigned)) + (export "globalOpts" (func $globalOpts)) + (export "dropCallImport" (func $dropCallImport)) + (export "loophi" (func $loophi)) + (export "loophi2" (func $loophi2)) + (export "relooperJumpThreading" (func $relooperJumpThreading)) + (export "relooperJumpThreading__ZN4game14preloadweaponsEv" (func $relooperJumpThreading__ZN4game14preloadweaponsEv)) + (export "__Z12multi_varargiz" (func $__Z12multi_varargiz)) + (export "jumpThreadDrop" (func $jumpThreadDrop)) + (export "dropIgnoredImportInIf" (func $dropIgnoredImportInIf)) + (export "dropIgnoredImportsInIf" (func $dropIgnoredImportsInIf)) (func $big_negative (local $temp f64) (set_local $temp diff --git a/test/wasm-only.asm.js b/test/wasm-only.asm.js index 8dc208372..eab63ba2b 100644 --- a/test/wasm-only.asm.js +++ b/test/wasm-only.asm.js @@ -223,7 +223,20 @@ function asm(global, env, buffer) { } return $waka | 0; } + function keepAlive() { + loads(); + stores(); + test(); + i64(imports()); + arg(i64(0)); + i64(call1(i64(0))); + i64(call2(i64(0))); + i64(returnCastConst()); + i64(ifValue64(i64(0), i64(0))); + ifValue32(0, 0) | 0; + switch64(i64(0)) | 0; + } - return { test64: test64, illegalParam : illegalParam, illegalResult: illegalResult }; + return { test64: test64, illegalParam : illegalParam, illegalResult: illegalResult, keepAlive: keepAlive }; } diff --git a/test/wasm-only.fromasm b/test/wasm-only.fromasm index 64a30a03b..369d9dcfa 100644 --- a/test/wasm-only.fromasm +++ b/test/wasm-only.fromasm @@ -15,6 +15,7 @@ (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$result)) + (export "keepAlive" (func $keepAlive)) (func $loads (nop) ) @@ -339,6 +340,47 @@ (i32.const 1) ) ) + (func $keepAlive + (call $loads) + (call $stores) + (call $test) + (drop + (call $imports) + ) + (call $arg + (i64.const 0) + ) + (drop + (call $call1 + (i64.const 0) + ) + ) + (drop + (call $call2 + (i64.const 0) + ) + ) + (drop + (call $returnCastConst) + ) + (drop + (call $ifValue64 + (i64.const 0) + (i64.const 0) + ) + ) + (drop + (call $ifValue32 + (i32.const 0) + (i32.const 0) + ) + ) + (drop + (call $switch64 + (i64.const 0) + ) + ) + ) (func $legalstub$illegalParam (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) (call $illegalParam (get_local $0) diff --git a/test/wasm-only.fromasm.imprecise b/test/wasm-only.fromasm.imprecise index 77dc70050..0289372eb 100644 --- a/test/wasm-only.fromasm.imprecise +++ b/test/wasm-only.fromasm.imprecise @@ -14,6 +14,7 @@ (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$result)) + (export "keepAlive" (func $keepAlive)) (func $loads (nop) ) @@ -267,6 +268,47 @@ (i32.const 1) ) ) + (func $keepAlive + (call $loads) + (call $stores) + (call $test) + (drop + (call $imports) + ) + (call $arg + (i64.const 0) + ) + (drop + (call $call1 + (i64.const 0) + ) + ) + (drop + (call $call2 + (i64.const 0) + ) + ) + (drop + (call $returnCastConst) + ) + (drop + (call $ifValue64 + (i64.const 0) + (i64.const 0) + ) + ) + (drop + (call $ifValue32 + (i32.const 0) + (i32.const 0) + ) + ) + (drop + (call $switch64 + (i64.const 0) + ) + ) + ) (func $legalstub$illegalParam (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) (call $illegalParam (get_local $0) diff --git a/test/wasm-only.fromasm.imprecise.no-opts b/test/wasm-only.fromasm.imprecise.no-opts index 51b93cf67..1e818877c 100644 --- a/test/wasm-only.fromasm.imprecise.no-opts +++ b/test/wasm-only.fromasm.imprecise.no-opts @@ -14,6 +14,7 @@ (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$illegalResult)) + (export "keepAlive" (func $keepAlive)) (func $loads (local $i i32) (local $f f32) @@ -711,6 +712,47 @@ (get_local $$waka) ) ) + (func $keepAlive + (call $loads) + (call $stores) + (call $test) + (drop + (call $imports) + ) + (call $arg + (i64.const 0) + ) + (drop + (call $call1 + (i64.const 0) + ) + ) + (drop + (call $call2 + (i64.const 0) + ) + ) + (drop + (call $returnCastConst) + ) + (drop + (call $ifValue64 + (i64.const 0) + (i64.const 0) + ) + ) + (drop + (call $ifValue32 + (i32.const 0) + (i32.const 0) + ) + ) + (drop + (call $switch64 + (i64.const 0) + ) + ) + ) (func $legalstub$illegalParam (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) (call $illegalParam (get_local $0) diff --git a/test/wasm-only.fromasm.no-opts b/test/wasm-only.fromasm.no-opts index 4d52a2eab..1c3a0bf5c 100644 --- a/test/wasm-only.fromasm.no-opts +++ b/test/wasm-only.fromasm.no-opts @@ -14,6 +14,7 @@ (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$illegalResult)) + (export "keepAlive" (func $keepAlive)) (func $loads (local $i i32) (local $f f32) @@ -759,6 +760,47 @@ (get_local $$waka) ) ) + (func $keepAlive + (call $loads) + (call $stores) + (call $test) + (drop + (call $imports) + ) + (call $arg + (i64.const 0) + ) + (drop + (call $call1 + (i64.const 0) + ) + ) + (drop + (call $call2 + (i64.const 0) + ) + ) + (drop + (call $returnCastConst) + ) + (drop + (call $ifValue64 + (i64.const 0) + (i64.const 0) + ) + ) + (drop + (call $ifValue32 + (i32.const 0) + (i32.const 0) + ) + ) + (drop + (call $switch64 + (i64.const 0) + ) + ) + ) (func $legalstub$illegalParam (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) (call $illegalParam (get_local $0) |