diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/wasm-only.asm.js | 8 | ||||
-rw-r--r-- | test/wasm-only.fromasm | 17 | ||||
-rw-r--r-- | test/wasm-only.fromasm.imprecise | 17 | ||||
-rw-r--r-- | test/wasm-only.fromasm.imprecise.no-opts | 24 | ||||
-rw-r--r-- | test/wasm-only.fromasm.no-opts | 24 |
5 files changed, 81 insertions, 9 deletions
diff --git a/test/wasm-only.asm.js b/test/wasm-only.asm.js index e4ec8b5f7..eb18fce03 100644 --- a/test/wasm-only.asm.js +++ b/test/wasm-only.asm.js @@ -21,6 +21,8 @@ function asm(global, env, buffer) { var illegalImport = env.illegalImport; var illegalImportResult = env.illegalImportResult; + var _fabsf = env._fabsf; + function loads() { var i = 0, f = fround(0), d = +0; i = load1(100); @@ -237,7 +239,11 @@ function asm(global, env, buffer) { switch64(i64(0)) | 0; } - var FUNCTION_TABLE_X = [illegalImport]; // must stay ok in the table, not legalized, as it will be called internally by the true type + function __emscripten_dceable_type_decls() { // dce-able, but this defines the type of fabsf which has no other use + fround(_fabsf(fround(0.0))); + } + + var FUNCTION_TABLE_X = [illegalImport, _fabsf]; // must stay ok in the table, not legalized, as it will be called internally by the true type return { test64: test64, illegalParam : illegalParam, illegalResult: illegalResult, keepAlive: keepAlive }; } diff --git a/test/wasm-only.fromasm b/test/wasm-only.fromasm index b36cc536c..30793df2c 100644 --- a/test/wasm-only.fromasm +++ b/test/wasm-only.fromasm @@ -1,17 +1,21 @@ (module (type $FUNCSIG$vdji (func (param f64 i64 i32))) (type $FUNCSIG$j (func (result i64))) + (type $FUNCSIG$ff (func (param f32) (result f32))) (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $legaltype$illegalImportResult (func (result i32))) + (type $legaltype$_fabsf (func (param f64) (result f64))) (import "env" "illegalImport" (func $illegalImport (param f64 i64 i32))) (import "env" "illegalImportResult" (func $illegalImportResult (result i64))) + (import "env" "_fabsf" (func $_fabsf (param f32) (result f32))) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) + (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "memory" (memory $0 256 256)) - (import "env" "table" (table 1 1 anyfunc)) + (import "env" "table" (table 2 2 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (elem (get_global $tableBase) $illegalImport) + (elem (get_global $tableBase) $illegalImport $_fabsf) (data (get_global $memoryBase) "wasm-only.asm.js") (global $tempRet0 (mut i32) (i32.const 0)) (export "test64" (func $test64)) @@ -439,4 +443,13 @@ ) ) ) + (func $legalfunc$_fabsf (param $0 f32) (result f32) + (f32.demote/f64 + (call $legalimport$_fabsf + (f64.promote/f32 + (get_local $0) + ) + ) + ) + ) ) diff --git a/test/wasm-only.fromasm.imprecise b/test/wasm-only.fromasm.imprecise index b7cc3a482..c65c70ada 100644 --- a/test/wasm-only.fromasm.imprecise +++ b/test/wasm-only.fromasm.imprecise @@ -1,17 +1,21 @@ (module (type $FUNCSIG$vdji (func (param f64 i64 i32))) (type $FUNCSIG$j (func (result i64))) + (type $FUNCSIG$ff (func (param f32) (result f32))) (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $legaltype$illegalImportResult (func (result i32))) + (type $legaltype$_fabsf (func (param f64) (result f64))) (import "env" "illegalImport" (func $illegalImport (param f64 i64 i32))) (import "env" "illegalImportResult" (func $illegalImportResult (result i64))) + (import "env" "_fabsf" (func $_fabsf (param f32) (result f32))) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) + (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "memory" (memory $0 256 256)) - (import "env" "table" (table 1 1 anyfunc)) + (import "env" "table" (table 2 2 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (elem (get_global $tableBase) $illegalImport) + (elem (get_global $tableBase) $illegalImport $_fabsf) (global $tempRet0 (mut i32) (i32.const 0)) (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) @@ -367,4 +371,13 @@ ) ) ) + (func $legalfunc$_fabsf (param $0 f32) (result f32) + (f32.demote/f64 + (call $legalimport$_fabsf + (f64.promote/f32 + (get_local $0) + ) + ) + ) + ) ) diff --git a/test/wasm-only.fromasm.imprecise.no-opts b/test/wasm-only.fromasm.imprecise.no-opts index 542b0cad2..9311971fb 100644 --- a/test/wasm-only.fromasm.imprecise.no-opts +++ b/test/wasm-only.fromasm.imprecise.no-opts @@ -1,17 +1,21 @@ (module (type $FUNCSIG$vdji (func (param f64 i64 i32))) (type $FUNCSIG$j (func (result i64))) + (type $FUNCSIG$ff (func (param f32) (result f32))) (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $legaltype$illegalImportResult (func (result i32))) + (type $legaltype$_fabsf (func (param f64) (result f64))) (import "env" "illegalImport" (func $illegalImport (param f64 i64 i32))) (import "env" "illegalImportResult" (func $illegalImportResult (result i64))) + (import "env" "_fabsf" (func $_fabsf (param f32) (result f32))) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) + (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "memory" (memory $0 256 256)) - (import "env" "table" (table 1 1 anyfunc)) + (import "env" "table" (table 2 2 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (elem (get_global $tableBase) $illegalImport) + (elem (get_global $tableBase) $illegalImport $_fabsf) (global $tempRet0 (mut i32) (i32.const 0)) (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) @@ -755,6 +759,13 @@ ) ) ) + (func $__emscripten_dceable_type_decls + (drop + (call $legalfunc$_fabsf + (f32.const 0) + ) + ) + ) (func $legalstub$illegalParam (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) (call $illegalParam (get_local $0) @@ -817,4 +828,13 @@ ) ) ) + (func $legalfunc$_fabsf (param $0 f32) (result f32) + (f32.demote/f64 + (call $legalimport$_fabsf + (f64.promote/f32 + (get_local $0) + ) + ) + ) + ) ) diff --git a/test/wasm-only.fromasm.no-opts b/test/wasm-only.fromasm.no-opts index 1f0760e6b..54d39cd0a 100644 --- a/test/wasm-only.fromasm.no-opts +++ b/test/wasm-only.fromasm.no-opts @@ -1,17 +1,21 @@ (module (type $FUNCSIG$vdji (func (param f64 i64 i32))) (type $FUNCSIG$j (func (result i64))) + (type $FUNCSIG$ff (func (param f32) (result f32))) (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $legaltype$illegalImportResult (func (result i32))) + (type $legaltype$_fabsf (func (param f64) (result f64))) (import "env" "illegalImport" (func $illegalImport (param f64 i64 i32))) (import "env" "illegalImportResult" (func $illegalImportResult (result i64))) + (import "env" "_fabsf" (func $_fabsf (param f32) (result f32))) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) + (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "memory" (memory $0 256 256)) - (import "env" "table" (table 1 1 anyfunc)) + (import "env" "table" (table 2 2 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (elem (get_global $tableBase) $illegalImport) + (elem (get_global $tableBase) $illegalImport $_fabsf) (global $tempRet0 (mut i32) (i32.const 0)) (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) @@ -803,6 +807,13 @@ ) ) ) + (func $__emscripten_dceable_type_decls + (drop + (call $legalfunc$_fabsf + (f32.const 0) + ) + ) + ) (func $legalstub$illegalParam (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) (call $illegalParam (get_local $0) @@ -865,4 +876,13 @@ ) ) ) + (func $legalfunc$_fabsf (param $0 f32) (result f32) + (f32.demote/f64 + (call $legalimport$_fabsf + (f64.promote/f32 + (get_local $0) + ) + ) + ) + ) ) |