summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit.asm.js8
-rw-r--r--test/unit.fromasm16
-rw-r--r--test/unit.fromasm.imprecise16
-rw-r--r--test/unit.fromasm.imprecise.no-opts18
-rw-r--r--test/unit.fromasm.no-opts18
5 files changed, 75 insertions, 1 deletions
diff --git a/test/unit.asm.js b/test/unit.asm.js
index 51c2fc22a..4ab43b737 100644
--- a/test/unit.asm.js
+++ b/test/unit.asm.js
@@ -652,6 +652,12 @@ function asm(global, env, buffer) {
HEAPF64[10] = Math_fround(x|0);
}
+ function relocatableAndModules() {
+ ftCall_v(10); // function table call
+ mftCall_v(20); // possible inter-module function table call
+ return ftCall_idi(30, 1.5, 200) | 0; // with args
+ }
+
function v() {
}
function vi(x) {
@@ -663,6 +669,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 };
+ 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 };
}
diff --git a/test/unit.fromasm b/test/unit.fromasm
index 15ff3b517..d887aedac 100644
--- a/test/unit.fromasm
+++ b/test/unit.fromasm
@@ -4,6 +4,8 @@
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$vf (func (param f32)))
(type $FUNCSIG$vi (func (param i32)))
+ (type $FUNCSIG$v (func))
+ (type $FUNCSIG$idi (func (param f64 i32) (result i32)))
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$dd (func (param f64) (result f64)))
(type $FUNCSIG$i (func (result i32)))
@@ -70,6 +72,7 @@
(export "relooperJumpThreading_irreducible" (func $relooperJumpThreading_irreducible))
(export "store_fround" (func $store_fround))
(export "exportedNumber" (global $exportedNumber))
+ (export "relocatableAndModules" (func $relocatableAndModules))
(func $big_negative
(nop)
)
@@ -1130,6 +1133,19 @@
)
)
)
+ (func $relocatableAndModules (result i32)
+ (call_indirect $FUNCSIG$v
+ (i32.const 10)
+ )
+ (call_indirect $FUNCSIG$v
+ (i32.const 20)
+ )
+ (call_indirect $FUNCSIG$idi
+ (f64.const 1.5)
+ (i32.const 200)
+ (i32.const 30)
+ )
+ )
(func $vi (param $0 i32)
(nop)
)
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index d466f8c27..10ea5a01f 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -2,6 +2,8 @@
(type $FUNCSIG$ddd (func (param f64 f64) (result f64)))
(type $FUNCSIG$vf (func (param f32)))
(type $FUNCSIG$vi (func (param i32)))
+ (type $FUNCSIG$v (func))
+ (type $FUNCSIG$idi (func (param f64 i32) (result i32)))
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$dd (func (param f64) (result f64)))
(type $FUNCSIG$i (func (result i32)))
@@ -65,6 +67,7 @@
(export "relooperJumpThreading_irreducible" (func $relooperJumpThreading_irreducible))
(export "store_fround" (func $store_fround))
(export "exportedNumber" (global $exportedNumber))
+ (export "relocatableAndModules" (func $relocatableAndModules))
(func $big_negative
(nop)
)
@@ -1106,6 +1109,19 @@
)
)
)
+ (func $relocatableAndModules (result i32)
+ (call_indirect $FUNCSIG$v
+ (i32.const 10)
+ )
+ (call_indirect $FUNCSIG$v
+ (i32.const 20)
+ )
+ (call_indirect $FUNCSIG$idi
+ (f64.const 1.5)
+ (i32.const 200)
+ (i32.const 30)
+ )
+ )
(func $vi (param $0 i32)
(nop)
)
diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts
index e16dd92f8..7831656f7 100644
--- a/test/unit.fromasm.imprecise.no-opts
+++ b/test/unit.fromasm.imprecise.no-opts
@@ -2,6 +2,8 @@
(type $FUNCSIG$ddd (func (param f64 f64) (result f64)))
(type $FUNCSIG$vf (func (param f32)))
(type $FUNCSIG$vi (func (param i32)))
+ (type $FUNCSIG$v (func))
+ (type $FUNCSIG$idi (func (param f64 i32) (result i32)))
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$dd (func (param f64) (result f64)))
(type $FUNCSIG$i (func (result i32)))
@@ -73,6 +75,7 @@
(export "relooperJumpThreading_irreducible" (func $relooperJumpThreading_irreducible))
(export "store_fround" (func $store_fround))
(export "exportedNumber" (global $exportedNumber))
+ (export "relocatableAndModules" (func $relocatableAndModules))
(func $big_negative
(local $temp f64)
(set_local $temp
@@ -1800,6 +1803,21 @@
)
)
)
+ (func $relocatableAndModules (result i32)
+ (call_indirect $FUNCSIG$v
+ (i32.const 10)
+ )
+ (call_indirect $FUNCSIG$v
+ (i32.const 20)
+ )
+ (return
+ (call_indirect $FUNCSIG$idi
+ (f64.const 1.5)
+ (i32.const 200)
+ (i32.const 30)
+ )
+ )
+ )
(func $v
(nop)
)
diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts
index 2fef4cae6..dfcf18538 100644
--- a/test/unit.fromasm.no-opts
+++ b/test/unit.fromasm.no-opts
@@ -4,6 +4,8 @@
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$vf (func (param f32)))
(type $FUNCSIG$vi (func (param i32)))
+ (type $FUNCSIG$v (func))
+ (type $FUNCSIG$idi (func (param f64 i32) (result i32)))
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$dd (func (param f64) (result f64)))
(type $FUNCSIG$i (func (result i32)))
@@ -77,6 +79,7 @@
(export "relooperJumpThreading_irreducible" (func $relooperJumpThreading_irreducible))
(export "store_fround" (func $store_fround))
(export "exportedNumber" (global $exportedNumber))
+ (export "relocatableAndModules" (func $relocatableAndModules))
(func $big_negative
(local $temp f64)
(set_local $temp
@@ -1806,6 +1809,21 @@
)
)
)
+ (func $relocatableAndModules (result i32)
+ (call_indirect $FUNCSIG$v
+ (i32.const 10)
+ )
+ (call_indirect $FUNCSIG$v
+ (i32.const 20)
+ )
+ (return
+ (call_indirect $FUNCSIG$idi
+ (f64.const 1.5)
+ (i32.const 200)
+ (i32.const 30)
+ )
+ )
+ )
(func $v
(nop)
)