summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcheck.py18
-rw-r--r--src/passes/Print.cpp4
-rw-r--r--src/shell-interface.h4
-rw-r--r--src/wasm/literal.cpp2
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt2
-rw-r--r--test/example/c-api-kitchen-sink.txt2
-rw-r--r--test/passes/fuzz-exec_O.txt4
-rw-r--r--test/passes/fuzz-exec_enable-sign-ext.txt20
-rw-r--r--test/passes/ssa_fuzz-exec_enable-threads.txt4
-rw-r--r--test/spec/expected-output/imports.wast.log4
-rw-r--r--test/unit/input/asyncify-pure.txt34
11 files changed, 39 insertions, 59 deletions
diff --git a/check.py b/check.py
index 02d0f5a10..5973b8a3d 100755
--- a/check.py
+++ b/check.py
@@ -309,24 +309,6 @@ def run_spec_tests():
def check_expected(actual, expected):
if expected and os.path.exists(expected):
expected = open(expected).read()
-
- # fix it up, our pretty (i32.const 83) must become compared to a homely 83 : i32
- def fix_expected(x):
- x = x.strip()
- if not x:
- return x
- v, t = x.split(' : ')
- if v.endswith('.'):
- v = v[:-1] # remove trailing '.'
- return '(' + t + '.const ' + v + ')'
-
- def fix_actual(x):
- if '[trap ' in x:
- return ''
- return x
-
- expected = '\n'.join(map(fix_expected, expected.split('\n')))
- actual = '\n'.join(map(fix_actual, actual.split('\n')))
print(' (using expected output)')
actual = actual.strip()
expected = expected.strip()
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index fef4ac01d..e35d9b57e 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -447,7 +447,9 @@ struct PrintExpressionContents
prepareColor(o);
o << "memory.fill";
}
- void visitConst(Const* curr) { o << curr->value; }
+ void visitConst(Const* curr) {
+ o << curr->value.type << ".const " << curr->value;
+ }
void visitUnary(Unary* curr) {
prepareColor(o);
switch (curr->op) {
diff --git a/src/shell-interface.h b/src/shell-interface.h
index 72c7dc67b..71e09189d 100644
--- a/src/shell-interface.h
+++ b/src/shell-interface.h
@@ -135,7 +135,7 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface {
Literal callImport(Function* import, LiteralList& arguments) override {
if (import->module == SPECTEST && import->base == PRINT) {
for (auto argument : arguments) {
- std::cout << '(' << argument << ')' << '\n';
+ std::cout << argument << " : " << argument.type << '\n';
}
return Literal();
} else if (import->module == ENV && import->base == EXIT) {
@@ -211,7 +211,7 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface {
}
void trap(const char* why) override {
- std::cout << "[trap " << why << "]\n";
+ std::cerr << "[trap " << why << "]\n";
throw TrapException();
}
};
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp
index 41d8d2924..3b2930c67 100644
--- a/src/wasm/literal.cpp
+++ b/src/wasm/literal.cpp
@@ -252,7 +252,7 @@ void Literal::printVec128(std::ostream& o, const std::array<uint8_t, 16>& v) {
}
std::ostream& operator<<(std::ostream& o, Literal literal) {
- prepareMinorColor(o) << literal.type << ".const ";
+ prepareMinorColor(o);
switch (literal.type) {
case Type::none:
o << "?";
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index 1bf9eaea8..601f08b4c 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -3945,7 +3945,7 @@ module loaded from binary form:
)
)
-(i32.const 1234)
+1234 : i32
(module
(type $v (func))
(func $func (; 0 ;) (type $v)
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 7583a216b..44f40ac4c 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -2217,7 +2217,7 @@ module s-expr printed (in memory, caller-owned):
)
)
)
-(i32.const 1234)
+1234 : i32
(module
(type $v (func))
(func $func (; 0 ;) (type $v)
diff --git a/test/passes/fuzz-exec_O.txt b/test/passes/fuzz-exec_O.txt
index d25d81dc3..5d9a71601 100644
--- a/test/passes/fuzz-exec_O.txt
+++ b/test/passes/fuzz-exec_O.txt
@@ -1,7 +1,5 @@
[fuzz-exec] calling $func_0
-[trap final > memory: 18446744073709551615 > 65514]
[fuzz-exec] calling $func_1
-[trap final > memory: 18446744073709551615 > 65514]
(module
(type $FUNCSIG$j (func (result i64)))
(type $FUNCSIG$i (func (result i32)))
@@ -25,8 +23,6 @@
)
)
[fuzz-exec] calling $func_0
-[trap final > memory: 18446744073709551615 > 65514]
[fuzz-exec] calling $func_1
-[trap final > memory: 18446744073709551615 > 65514]
[fuzz-exec] comparing $func_0
[fuzz-exec] comparing $func_1
diff --git a/test/passes/fuzz-exec_enable-sign-ext.txt b/test/passes/fuzz-exec_enable-sign-ext.txt
index d499f208f..b94811acc 100644
--- a/test/passes/fuzz-exec_enable-sign-ext.txt
+++ b/test/passes/fuzz-exec_enable-sign-ext.txt
@@ -1,13 +1,13 @@
[fuzz-exec] calling $a
-[fuzz-exec] note result: $a => i32.const -69
+[fuzz-exec] note result: $a => -69
[fuzz-exec] calling $b
-[fuzz-exec] note result: $b => i32.const -31768
+[fuzz-exec] note result: $b => -31768
[fuzz-exec] calling $c
-[fuzz-exec] note result: $c => i64.const -69
+[fuzz-exec] note result: $c => -69
[fuzz-exec] calling $d
-[fuzz-exec] note result: $d => i64.const -31768
+[fuzz-exec] note result: $d => -31768
[fuzz-exec] calling $e
-[fuzz-exec] note result: $e => i64.const -2146649112
+[fuzz-exec] note result: $e => -2146649112
(module
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$j (func (result i64)))
@@ -43,15 +43,15 @@
)
)
[fuzz-exec] calling $a
-[fuzz-exec] note result: $a => i32.const -69
+[fuzz-exec] note result: $a => -69
[fuzz-exec] calling $b
-[fuzz-exec] note result: $b => i32.const -31768
+[fuzz-exec] note result: $b => -31768
[fuzz-exec] calling $c
-[fuzz-exec] note result: $c => i64.const -69
+[fuzz-exec] note result: $c => -69
[fuzz-exec] calling $d
-[fuzz-exec] note result: $d => i64.const -31768
+[fuzz-exec] note result: $d => -31768
[fuzz-exec] calling $e
-[fuzz-exec] note result: $e => i64.const -2146649112
+[fuzz-exec] note result: $e => -2146649112
[fuzz-exec] comparing $a
[fuzz-exec] comparing $b
[fuzz-exec] comparing $c
diff --git a/test/passes/ssa_fuzz-exec_enable-threads.txt b/test/passes/ssa_fuzz-exec_enable-threads.txt
index 35499266e..2546819e4 100644
--- a/test/passes/ssa_fuzz-exec_enable-threads.txt
+++ b/test/passes/ssa_fuzz-exec_enable-threads.txt
@@ -1,5 +1,5 @@
[fuzz-exec] calling $func_0
-[fuzz-exec] note result: $func_0 => i32.const 16384
+[fuzz-exec] note result: $func_0 => 16384
(module
(type $0 (func (result i32)))
(type $1 (func))
@@ -126,5 +126,5 @@
)
)
[fuzz-exec] calling $func_0
-[fuzz-exec] note result: $func_0 => i32.const 16384
+[fuzz-exec] note result: $func_0 => 16384
[fuzz-exec] comparing $func_0
diff --git a/test/spec/expected-output/imports.wast.log b/test/spec/expected-output/imports.wast.log
index cd34c2399..59c70fea9 100644
--- a/test/spec/expected-output/imports.wast.log
+++ b/test/spec/expected-output/imports.wast.log
@@ -1,10 +1,10 @@
13 : i32
14 : i32
-42. : f32
+42 : f32
13 : i32
13 : i32
24 : i64
25 : i64
-53. : f64
+53 : f64
24 : i64
24 : i64
diff --git a/test/unit/input/asyncify-pure.txt b/test/unit/input/asyncify-pure.txt
index 1f85db1f1..9032da174 100644
--- a/test/unit/input/asyncify-pure.txt
+++ b/test/unit/input/asyncify-pure.txt
@@ -1,17 +1,17 @@
-(i32.const 100)
-(i32.const 10)
-(i32.const 1)
-(i32.const 20)
-(i32.const 1000)
-(i32.const 2000)
-(i32.const 4000)
-(i32.const 200)
-(i32.const 300)
-(i32.const 400)
-(i32.const 1000)
-(i32.const 3000)
-(i32.const 4000)
-(i32.const 30)
-(i32.const 2)
-(i32.const 40)
-(i32.const 500)
+100 : i32
+10 : i32
+1 : i32
+20 : i32
+1000 : i32
+2000 : i32
+4000 : i32
+200 : i32
+300 : i32
+400 : i32
+1000 : i32
+3000 : i32
+4000 : i32
+30 : i32
+2 : i32
+40 : i32
+500 : i32