summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/exec/no-compare-refs.wast4
-rw-r--r--test/lit/help/wasm-opt.test4
-rw-r--r--test/lit/unicode-filenames.wast2
-rw-r--r--test/passes/emit-js-wrapper=a.js.txt84
-rw-r--r--test/passes/emit-js-wrapper=a.js.wast37
-rw-r--r--test/passes/emit-js-wrapper=a.js.wast.js79
-rw-r--r--test/passes/fuzz-exec_all-features.txt4
-rw-r--r--test/passes/simplify-globals_all-features_fuzz-exec.txt4
8 files changed, 7 insertions, 211 deletions
diff --git a/test/lit/exec/no-compare-refs.wast b/test/lit/exec/no-compare-refs.wast
index bfa317a53..646ec1550 100644
--- a/test/lit/exec/no-compare-refs.wast
+++ b/test/lit/exec/no-compare-refs.wast
@@ -12,11 +12,11 @@
;; The type of the reference this function returns will change as a result of
;; signature pruning. The fuzzer should not complain about this.
;; CHECK: [fuzz-exec] calling return-ref
- ;; CHECK-NEXT: [fuzz-exec] note result: return-ref => funcref
+ ;; CHECK-NEXT: [fuzz-exec] note result: return-ref => function
(func $return-ref (export "return-ref") (result funcref)
(ref.func $no-use-param)
)
)
;; CHECK: [fuzz-exec] calling return-ref
-;; CHECK-NEXT: [fuzz-exec] note result: return-ref => funcref
+;; CHECK-NEXT: [fuzz-exec] note result: return-ref => function
;; CHECK-NEXT: [fuzz-exec] comparing return-ref
diff --git a/test/lit/help/wasm-opt.test b/test/lit/help/wasm-opt.test
index be5924cf7..5e3a322ed 100644
--- a/test/lit/help/wasm-opt.test
+++ b/test/lit/help/wasm-opt.test
@@ -53,10 +53,6 @@
;; CHECK-NEXT: loads/stores/indirect calls when
;; CHECK-NEXT: fuzzing
;; CHECK-NEXT:
-;; CHECK-NEXT: --emit-js-wrapper,-ejw Emit a JavaScript wrapper file
-;; CHECK-NEXT: that can run the wasm with some
-;; CHECK-NEXT: test values, useful for fuzzing
-;; CHECK-NEXT:
;; CHECK-NEXT: --emit-spec-wrapper,-esw Emit a wasm spec interpreter
;; CHECK-NEXT: wrapper file that can run the
;; CHECK-NEXT: wasm with some test values,
diff --git a/test/lit/unicode-filenames.wast b/test/lit/unicode-filenames.wast
index f30ad9c09..a3fbabed0 100644
--- a/test/lit/unicode-filenames.wast
+++ b/test/lit/unicode-filenames.wast
@@ -1,6 +1,6 @@
;; RUN: wasm-as %s -o %t-❤.wasm --source-map %t-🗺️.map
;; RUN: cat %t-🗺️.map | filecheck %s --check-prefix SOURCEMAP
-;; RUN: wasm-opt %t-❤.wasm -o %t-🤬.wasm --emit-js-wrapper %t-❤.js --input-source-map %t-🗺️.map --output-source-map %t-🗺️.out.map
+;; RUN: wasm-opt %t-❤.wasm -o %t-🤬.wasm --emit-spec-wrapper %t-❤.js --input-source-map %t-🗺️.map --output-source-map %t-🗺️.out.map
;; RUN: cat %t-🗺️.out.map | filecheck %s --check-prefix SOURCEMAP
;; RUN: wasm-dis %t-🤬.wasm | filecheck %s --check-prefix MODULE
diff --git a/test/passes/emit-js-wrapper=a.js.txt b/test/passes/emit-js-wrapper=a.js.txt
deleted file mode 100644
index 4a72da8eb..000000000
--- a/test/passes/emit-js-wrapper=a.js.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-(module
- (type $0 (func (param i32 i32) (result i32)))
- (type $1 (func (param i32)))
- (type $2 (func (param i32 i64 f32 f64)))
- (type $3 (func (param i32 f32 f64)))
- (type $4 (func (param i32 f32 f64) (result i64)))
- (type $5 (func (param i32 i32 i32 f32 f64)))
- (type $6 (func (param i32 f32 f64) (result i32)))
- (import "env" "setTempRet0" (func $setTempRet0 (param i32)))
- (memory $0 256 256)
- (export "add" (func $add))
- (export "no_return" (func $no-return))
- (export "types" (func $legalstub$types))
- (export "types2" (func $types2))
- (export "types3" (func $legalstub$types3))
- (func $add (param $x i32) (param $y i32) (result i32)
- (i32.add
- (local.get $x)
- (local.get $y)
- )
- )
- (func $unexported (param $x i32) (param $y i32) (result i32)
- (i32.add
- (local.get $x)
- (local.get $y)
- )
- )
- (func $no-return (param $x i32)
- (drop
- (i32.add
- (local.get $x)
- (local.get $x)
- )
- )
- )
- (func $types (param $x i32) (param $y i64) (param $z f32) (param $w f64)
- (nop)
- )
- (func $types2 (param $x i32) (param $z f32) (param $w f64)
- (nop)
- )
- (func $types3 (param $x i32) (param $z f32) (param $w f64) (result i64)
- (i64.const 1)
- )
- (func $legalstub$types (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f32) (param $4 f64)
- (call $types
- (local.get $0)
- (i64.or
- (i64.extend_i32_u
- (local.get $1)
- )
- (i64.shl
- (i64.extend_i32_u
- (local.get $2)
- )
- (i64.const 32)
- )
- )
- (local.get $3)
- (local.get $4)
- )
- )
- (func $legalstub$types3 (param $0 i32) (param $1 f32) (param $2 f64) (result i32)
- (local $3 i64)
- (local.set $3
- (call $types3
- (local.get $0)
- (local.get $1)
- (local.get $2)
- )
- )
- (call $setTempRet0
- (i32.wrap_i64
- (i64.shr_u
- (local.get $3)
- (i64.const 32)
- )
- )
- )
- (i32.wrap_i64
- (local.get $3)
- )
- )
-)
diff --git a/test/passes/emit-js-wrapper=a.js.wast b/test/passes/emit-js-wrapper=a.js.wast
deleted file mode 100644
index 8ebd83b0b..000000000
--- a/test/passes/emit-js-wrapper=a.js.wast
+++ /dev/null
@@ -1,37 +0,0 @@
-(module
- (memory $0 256 256)
- (export "add" (func $add))
- (export "no_return" (func $no-return)) ;; note exported name is slightly different
- (export "types" (func $types))
- (export "types2" (func $types2))
- (export "types3" (func $types3))
- (func $add (param $x i32) (param $y i32) (result i32)
- (i32.add
- (local.get $x)
- (local.get $y)
- )
- )
- (func $unexported (param $x i32) (param $y i32) (result i32)
- (i32.add
- (local.get $x)
- (local.get $y)
- )
- )
- (func $no-return (param $x i32)
- (drop
- (i32.add
- (local.get $x)
- (local.get $x)
- )
- )
- )
- (func $types (param $x i32) (param $y i64) (param $z f32) (param $w f64)
- (nop)
- )
- (func $types2 (param $x i32) (param $z f32) (param $w f64)
- (nop)
- )
- (func $types3 (param $x i32) (param $z f32) (param $w f64) (result i64)
- (i64.const 1)
- )
-)
diff --git a/test/passes/emit-js-wrapper=a.js.wast.js b/test/passes/emit-js-wrapper=a.js.wast.js
deleted file mode 100644
index 916f029f5..000000000
--- a/test/passes/emit-js-wrapper=a.js.wast.js
+++ /dev/null
@@ -1,79 +0,0 @@
-if (typeof console === 'undefined') {
- console = { log: print };
-}
-var tempRet0;
-var binary;
-if (typeof process === 'object' && typeof require === 'function' /* node.js detection */) {
- var args = process.argv.slice(2);
- binary = require('fs').readFileSync(args[0]);
- if (!binary.buffer) binary = new Uint8Array(binary);
-} else {
- var args;
- if (typeof scriptArgs != 'undefined') {
- args = scriptArgs;
- } else if (typeof arguments != 'undefined') {
- args = arguments;
- }
- if (typeof readbuffer === 'function') {
- binary = new Uint8Array(readbuffer(args[0]));
- } else {
- binary = read(args[0], 'binary');
- }
-}
-function literal(x, type) {
- var ret = '';
- switch (type) {
- case 'i32': ret += (x | 0); break;
- case 'f32':
- case 'f64': {
- if (x == 0 && (1 / x) < 0) ret += '-';
- ret += Number(x).toString();
- break;
- }
- // For anything else, just print the type.
- default: ret += type; break;
- }
- return ret;
-}
-var instance = new WebAssembly.Instance(new WebAssembly.Module(binary), {
- 'fuzzing-support': {
- 'log-i32': function(x) { console.log('[LoggingExternalInterface logging ' + literal(x, 'i32') + ']') },
- 'log-i64': function(x, y) { console.log('[LoggingExternalInterface logging ' + literal(x, 'i32') + ' ' + literal(y, 'i32') + ']') },
- 'log-f32': function(x) { console.log('[LoggingExternalInterface logging ' + literal(x, 'f64') + ']') },
- 'log-f64': function(x) { console.log('[LoggingExternalInterface logging ' + literal(x, 'f64') + ']') },
- },
- 'env': {
- 'setTempRet0': function(x) { tempRet0 = x },
- 'getTempRet0': function() { return tempRet0 },
- },
-});
-try {
- console.log('[fuzz-exec] calling add');
- console.log('[fuzz-exec] note result: add => ' + literal(instance.exports.add(0, 0), 'i32'));
-} catch (e) {
- console.log('exception!' /* + e */);
-}
-try {
- console.log('[fuzz-exec] calling no_return');
- instance.exports.no_return(0);
-} catch (e) {
- console.log('exception!' /* + e */);
-}
-try {
- console.log('[fuzz-exec] calling types');
- instance.exports.types(0, 0, 0, 0, 0);
-} catch (e) {
- console.log('exception!' /* + e */);
-}
-try {
- console.log('[fuzz-exec] calling types2');
- instance.exports.types2(0, 0, 0);
-} catch (e) {
- console.log('exception!' /* + e */);
-}
-try {
- console.log('[fuzz-exec] calling types3');
- console.log('[fuzz-exec] note result: types3 => ' + literal(instance.exports.types3(0, 0, 0), 'i32'));
-} catch (e) {
- console.log('exception!' /* + e */);
-}
diff --git a/test/passes/fuzz-exec_all-features.txt b/test/passes/fuzz-exec_all-features.txt
index 22ea5f06a..fcb8e8a3c 100644
--- a/test/passes/fuzz-exec_all-features.txt
+++ b/test/passes/fuzz-exec_all-features.txt
@@ -212,7 +212,7 @@
[LoggingExternalInterface logging 214]
[fuzz-exec] comparing rmw-reads-modifies-and-writes-asymmetrical
[fuzz-exec] calling func
-[fuzz-exec] note result: func => funcref
+[fuzz-exec] note result: func => function
(module
(type $0 (func (result funcref)))
(elem declare func $func)
@@ -222,5 +222,5 @@
)
)
[fuzz-exec] calling func
-[fuzz-exec] note result: func => funcref
+[fuzz-exec] note result: func => function
[fuzz-exec] comparing func
diff --git a/test/passes/simplify-globals_all-features_fuzz-exec.txt b/test/passes/simplify-globals_all-features_fuzz-exec.txt
index fbbcc30c4..cb097d587 100644
--- a/test/passes/simplify-globals_all-features_fuzz-exec.txt
+++ b/test/passes/simplify-globals_all-features_fuzz-exec.txt
@@ -1,5 +1,5 @@
[fuzz-exec] calling export
-[fuzz-exec] note result: export => funcref
+[fuzz-exec] note result: export => function
(module
(type $0 (func (param f32 i31ref i64 f64 funcref)))
(type $1 (func (result funcref)))
@@ -17,5 +17,5 @@
)
)
[fuzz-exec] calling export
-[fuzz-exec] note result: export => funcref
+[fuzz-exec] note result: export => function
[fuzz-exec] comparing export