summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/min.fromasm31
-rw-r--r--test/min.fromasm.imprecise31
-rw-r--r--test/min.fromasm.imprecise.no-opts31
-rw-r--r--test/min.fromasm.no-opts31
-rw-r--r--test/unit.asm.js9
-rw-r--r--test/unit.fromasm44
-rw-r--r--test/unit.fromasm.imprecise44
-rw-r--r--test/unit.fromasm.imprecise.no-opts46
-rw-r--r--test/unit.fromasm.no-opts46
9 files changed, 288 insertions, 25 deletions
diff --git a/test/min.fromasm b/test/min.fromasm
index 76d071ef6..4287f6259 100644
--- a/test/min.fromasm
+++ b/test/min.fromasm
@@ -5,10 +5,10 @@
(import "env" "tableBase" (global $tableBase i32))
(data (get_global $memoryBase) "min.asm.js")
(global $M (mut i32) (i32.const 0))
- (export "floats" (func $floats))
+ (export "floats" (func $legalstub$floats))
(export "getTempRet0" (func $ub))
- (export "neg" (func $neg))
- (export "bitcasts" (func $bitcasts))
+ (export "neg" (func $legalstub$neg))
+ (export "bitcasts" (func $legalstub$bitcasts))
(export "ctzzzz" (func $ctzzzz))
(func $floats (param $0 f32) (result f32)
(local $1 f32)
@@ -40,4 +40,29 @@
)
(get_global $M)
)
+ (func $legalstub$floats (param $0 f64) (result f64)
+ (f64.promote/f32
+ (call $floats
+ (f32.demote/f64
+ (get_local $0)
+ )
+ )
+ )
+ )
+ (func $legalstub$neg (param $0 i32) (param $1 i32) (result f64)
+ (f64.promote/f32
+ (call $neg
+ (get_local $0)
+ (get_local $1)
+ )
+ )
+ )
+ (func $legalstub$bitcasts (param $0 i32) (param $1 f64)
+ (call $bitcasts
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ )
+ )
)
diff --git a/test/min.fromasm.imprecise b/test/min.fromasm.imprecise
index 9b63300b5..302f64c53 100644
--- a/test/min.fromasm.imprecise
+++ b/test/min.fromasm.imprecise
@@ -4,10 +4,10 @@
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
(global $M (mut i32) (i32.const 0))
- (export "floats" (func $floats))
+ (export "floats" (func $legalstub$floats))
(export "getTempRet0" (func $ub))
- (export "neg" (func $neg))
- (export "bitcasts" (func $bitcasts))
+ (export "neg" (func $legalstub$neg))
+ (export "bitcasts" (func $legalstub$bitcasts))
(export "ctzzzz" (func $ctzzzz))
(func $floats (param $0 f32) (result f32)
(local $1 f32)
@@ -39,4 +39,29 @@
)
(get_global $M)
)
+ (func $legalstub$floats (param $0 f64) (result f64)
+ (f64.promote/f32
+ (call $floats
+ (f32.demote/f64
+ (get_local $0)
+ )
+ )
+ )
+ )
+ (func $legalstub$neg (param $0 i32) (param $1 i32) (result f64)
+ (f64.promote/f32
+ (call $neg
+ (get_local $0)
+ (get_local $1)
+ )
+ )
+ )
+ (func $legalstub$bitcasts (param $0 i32) (param $1 f64)
+ (call $bitcasts
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ )
+ )
)
diff --git a/test/min.fromasm.imprecise.no-opts b/test/min.fromasm.imprecise.no-opts
index 4bbdeff65..6e8a1c9ea 100644
--- a/test/min.fromasm.imprecise.no-opts
+++ b/test/min.fromasm.imprecise.no-opts
@@ -6,10 +6,10 @@
(import "env" "tableBase" (global $tableBase i32))
(global $tDP (mut i32) (get_global $tDP$asm2wasm$import))
(global $M (mut i32) (i32.const 0))
- (export "floats" (func $floats))
+ (export "floats" (func $legalstub$floats))
(export "getTempRet0" (func $ub))
- (export "neg" (func $neg))
- (export "bitcasts" (func $bitcasts))
+ (export "neg" (func $legalstub$neg))
+ (export "bitcasts" (func $legalstub$bitcasts))
(export "ctzzzz" (func $ctzzzz))
(func $floats (param $f f32) (result f32)
(local $t f32)
@@ -73,4 +73,29 @@
(get_global $M)
)
)
+ (func $legalstub$floats (param $0 f64) (result f64)
+ (f64.promote/f32
+ (call $floats
+ (f32.demote/f64
+ (get_local $0)
+ )
+ )
+ )
+ )
+ (func $legalstub$neg (param $0 i32) (param $1 i32) (result f64)
+ (f64.promote/f32
+ (call $neg
+ (get_local $0)
+ (get_local $1)
+ )
+ )
+ )
+ (func $legalstub$bitcasts (param $0 i32) (param $1 f64)
+ (call $bitcasts
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ )
+ )
)
diff --git a/test/min.fromasm.no-opts b/test/min.fromasm.no-opts
index 4bbdeff65..6e8a1c9ea 100644
--- a/test/min.fromasm.no-opts
+++ b/test/min.fromasm.no-opts
@@ -6,10 +6,10 @@
(import "env" "tableBase" (global $tableBase i32))
(global $tDP (mut i32) (get_global $tDP$asm2wasm$import))
(global $M (mut i32) (i32.const 0))
- (export "floats" (func $floats))
+ (export "floats" (func $legalstub$floats))
(export "getTempRet0" (func $ub))
- (export "neg" (func $neg))
- (export "bitcasts" (func $bitcasts))
+ (export "neg" (func $legalstub$neg))
+ (export "bitcasts" (func $legalstub$bitcasts))
(export "ctzzzz" (func $ctzzzz))
(func $floats (param $f f32) (result f32)
(local $t f32)
@@ -73,4 +73,29 @@
(get_global $M)
)
)
+ (func $legalstub$floats (param $0 f64) (result f64)
+ (f64.promote/f32
+ (call $floats
+ (f32.demote/f64
+ (get_local $0)
+ )
+ )
+ )
+ )
+ (func $legalstub$neg (param $0 i32) (param $1 i32) (result f64)
+ (f64.promote/f32
+ (call $neg
+ (get_local $0)
+ (get_local $1)
+ )
+ )
+ )
+ (func $legalstub$bitcasts (param $0 i32) (param $1 f64)
+ (call $bitcasts
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ )
+ )
)
diff --git a/test/unit.asm.js b/test/unit.asm.js
index 4ab43b737..385db859c 100644
--- a/test/unit.asm.js
+++ b/test/unit.asm.js
@@ -658,6 +658,13 @@ function asm(global, env, buffer) {
return ftCall_idi(30, 1.5, 200) | 0; // with args
}
+ function exported_f32_user(x, y, z) {
+ x = x | 0;
+ y = Math_fround(y);
+ z = +z;
+ return Math_fround(y);
+ }
+
function v() {
}
function vi(x) {
@@ -669,6 +676,6 @@ function asm(global, env, buffer) {
var FUNCTION_TABLE_c = [ z, cneg, z, z, z, z, z, z ];
var FUNCTION_TABLE_vi = [ vi, vi, vi, vi, vi, vi, vi, vi ];
- 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, relooperJumpThreading_irreducible: relooperJumpThreading_irreducible, store_fround: store_fround, exportedNumber: 42, relocatableAndModules: relocatableAndModules };
+ 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, relooperJumpThreading_irreducible: relooperJumpThreading_irreducible, store_fround: store_fround, exportedNumber: 42, relocatableAndModules: relocatableAndModules, exported_f32_user: exported_f32_user };
}
diff --git a/test/unit.fromasm b/test/unit.fromasm
index d887aedac..e18bfd16a 100644
--- a/test/unit.fromasm
+++ b/test/unit.fromasm
@@ -36,16 +36,16 @@
(export "switcher" (func $switcher))
(export "frem" (func $frem))
(export "big_uint_div_u" (func $big_uint_div_u))
- (export "fr" (func $fr))
+ (export "fr" (func $legalstub$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 "ceiling_32_64" (func $legalstub$ceiling_32_64))
(export "aborts" (func $aborts))
(export "continues" (func $continues))
- (export "bitcasts" (func $bitcasts))
+ (export "bitcasts" (func $legalstub$bitcasts))
(export "recursiveBlockMerging" (func $recursiveBlockMerging))
(export "lb" (func $lb))
(export "zeroInit" (func $zeroInit))
@@ -73,6 +73,7 @@
(export "store_fround" (func $store_fround))
(export "exportedNumber" (global $exportedNumber))
(export "relocatableAndModules" (func $relocatableAndModules))
+ (export "exported_f32_user" (func $legalstub$exported_f32_user))
(func $big_negative
(nop)
)
@@ -1146,7 +1147,44 @@
(i32.const 30)
)
)
+ (func $exported_f32_user (param $0 i32) (param $1 f32) (param $2 f64) (result f32)
+ (get_local $1)
+ )
(func $vi (param $0 i32)
(nop)
)
+ (func $legalstub$fr (param $0 f64)
+ (call $fr
+ (f32.demote/f64
+ (get_local $0)
+ )
+ )
+ )
+ (func $legalstub$ceiling_32_64 (param $0 f64) (param $1 f64)
+ (call $ceiling_32_64
+ (f32.demote/f64
+ (get_local $0)
+ )
+ (get_local $1)
+ )
+ )
+ (func $legalstub$bitcasts (param $0 i32) (param $1 f64)
+ (call $bitcasts
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ )
+ )
+ (func $legalstub$exported_f32_user (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
+ (f64.promote/f32
+ (call $exported_f32_user
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ (get_local $2)
+ )
+ )
+ )
)
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index 10ea5a01f..2ec8b82ff 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -31,16 +31,16 @@
(export "switcher" (func $switcher))
(export "frem" (func $frem))
(export "big_uint_div_u" (func $big_uint_div_u))
- (export "fr" (func $fr))
+ (export "fr" (func $legalstub$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 "ceiling_32_64" (func $legalstub$ceiling_32_64))
(export "aborts" (func $aborts))
(export "continues" (func $continues))
- (export "bitcasts" (func $bitcasts))
+ (export "bitcasts" (func $legalstub$bitcasts))
(export "recursiveBlockMerging" (func $recursiveBlockMerging))
(export "lb" (func $lb))
(export "zeroInit" (func $zeroInit))
@@ -68,6 +68,7 @@
(export "store_fround" (func $store_fround))
(export "exportedNumber" (global $exportedNumber))
(export "relocatableAndModules" (func $relocatableAndModules))
+ (export "exported_f32_user" (func $legalstub$exported_f32_user))
(func $big_negative
(nop)
)
@@ -1122,7 +1123,44 @@
(i32.const 30)
)
)
+ (func $exported_f32_user (param $0 i32) (param $1 f32) (param $2 f64) (result f32)
+ (get_local $1)
+ )
(func $vi (param $0 i32)
(nop)
)
+ (func $legalstub$fr (param $0 f64)
+ (call $fr
+ (f32.demote/f64
+ (get_local $0)
+ )
+ )
+ )
+ (func $legalstub$ceiling_32_64 (param $0 f64) (param $1 f64)
+ (call $ceiling_32_64
+ (f32.demote/f64
+ (get_local $0)
+ )
+ (get_local $1)
+ )
+ )
+ (func $legalstub$bitcasts (param $0 i32) (param $1 f64)
+ (call $bitcasts
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ )
+ )
+ (func $legalstub$exported_f32_user (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
+ (f64.promote/f32
+ (call $exported_f32_user
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ (get_local $2)
+ )
+ )
+ )
)
diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts
index 7831656f7..b79ff2389 100644
--- a/test/unit.fromasm.imprecise.no-opts
+++ b/test/unit.fromasm.imprecise.no-opts
@@ -39,16 +39,16 @@
(export "switcher" (func $switcher))
(export "frem" (func $frem))
(export "big_uint_div_u" (func $big_uint_div_u))
- (export "fr" (func $fr))
+ (export "fr" (func $legalstub$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 "ceiling_32_64" (func $legalstub$ceiling_32_64))
(export "aborts" (func $aborts))
(export "continues" (func $continues))
- (export "bitcasts" (func $bitcasts))
+ (export "bitcasts" (func $legalstub$bitcasts))
(export "recursiveBlockMerging" (func $recursiveBlockMerging))
(export "lb" (func $lb))
(export "zeroInit" (func $zeroInit))
@@ -76,6 +76,7 @@
(export "store_fround" (func $store_fround))
(export "exportedNumber" (global $exportedNumber))
(export "relocatableAndModules" (func $relocatableAndModules))
+ (export "exported_f32_user" (func $legalstub$exported_f32_user))
(func $big_negative
(local $temp f64)
(set_local $temp
@@ -1818,10 +1819,49 @@
)
)
)
+ (func $exported_f32_user (param $x i32) (param $y f32) (param $z f64) (result f32)
+ (return
+ (get_local $y)
+ )
+ )
(func $v
(nop)
)
(func $vi (param $x i32)
(nop)
)
+ (func $legalstub$fr (param $0 f64)
+ (call $fr
+ (f32.demote/f64
+ (get_local $0)
+ )
+ )
+ )
+ (func $legalstub$ceiling_32_64 (param $0 f64) (param $1 f64)
+ (call $ceiling_32_64
+ (f32.demote/f64
+ (get_local $0)
+ )
+ (get_local $1)
+ )
+ )
+ (func $legalstub$bitcasts (param $0 i32) (param $1 f64)
+ (call $bitcasts
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ )
+ )
+ (func $legalstub$exported_f32_user (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
+ (f64.promote/f32
+ (call $exported_f32_user
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ (get_local $2)
+ )
+ )
+ )
)
diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts
index dfcf18538..717b6a4c4 100644
--- a/test/unit.fromasm.no-opts
+++ b/test/unit.fromasm.no-opts
@@ -43,16 +43,16 @@
(export "switcher" (func $switcher))
(export "frem" (func $frem))
(export "big_uint_div_u" (func $big_uint_div_u))
- (export "fr" (func $fr))
+ (export "fr" (func $legalstub$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 "ceiling_32_64" (func $legalstub$ceiling_32_64))
(export "aborts" (func $aborts))
(export "continues" (func $continues))
- (export "bitcasts" (func $bitcasts))
+ (export "bitcasts" (func $legalstub$bitcasts))
(export "recursiveBlockMerging" (func $recursiveBlockMerging))
(export "lb" (func $lb))
(export "zeroInit" (func $zeroInit))
@@ -80,6 +80,7 @@
(export "store_fround" (func $store_fround))
(export "exportedNumber" (global $exportedNumber))
(export "relocatableAndModules" (func $relocatableAndModules))
+ (export "exported_f32_user" (func $legalstub$exported_f32_user))
(func $big_negative
(local $temp f64)
(set_local $temp
@@ -1824,10 +1825,49 @@
)
)
)
+ (func $exported_f32_user (param $x i32) (param $y f32) (param $z f64) (result f32)
+ (return
+ (get_local $y)
+ )
+ )
(func $v
(nop)
)
(func $vi (param $x i32)
(nop)
)
+ (func $legalstub$fr (param $0 f64)
+ (call $fr
+ (f32.demote/f64
+ (get_local $0)
+ )
+ )
+ )
+ (func $legalstub$ceiling_32_64 (param $0 f64) (param $1 f64)
+ (call $ceiling_32_64
+ (f32.demote/f64
+ (get_local $0)
+ )
+ (get_local $1)
+ )
+ )
+ (func $legalstub$bitcasts (param $0 i32) (param $1 f64)
+ (call $bitcasts
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ )
+ )
+ (func $legalstub$exported_f32_user (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
+ (f64.promote/f32
+ (call $exported_f32_user
+ (get_local $0)
+ (f32.demote/f64
+ (get_local $1)
+ )
+ (get_local $2)
+ )
+ )
+ )
)