summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-11-26 02:36:38 -0800
committerGitHub <noreply@github.com>2019-11-26 02:36:38 -0800
commit6e23f8e5f4d28eb2056d0b3636b8317b9f299bfc (patch)
tree86072ef1f11098c4c721602c833f4fa4ebcacede /test
parent98ab07f9e471e713e7b00732a84e260aaaecc25f (diff)
downloadbinaryen-6e23f8e5f4d28eb2056d0b3636b8317b9f299bfc.tar.gz
binaryen-6e23f8e5f4d28eb2056d0b3636b8317b9f299bfc.tar.bz2
binaryen-6e23f8e5f4d28eb2056d0b3636b8317b9f299bfc.zip
Print only literal values when printing literals (#2469)
Current `<<` operator on `Literal` prints `[type].const` with it. But `[type].const` is rather an instruction than a literal itself, and printing it with the literals makes less sense when we later have literals whose type don't have `const` instructions (such as reference types). This patch - Makes `<<` operator on `Literal` print only its value - Makes wasm-shell's shell interface comply with the spec interpreter's printing format (`value : type`). - Prints wasm-shell's `[trap]` message to stderr These make all `fix_` routines for spec tests in check.py unnecessary.
Diffstat (limited to 'test')
-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
7 files changed, 33 insertions, 37 deletions
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