summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/interpreter.cc14
-rw-r--r--test/spec/conversions.txt2
-rw-r--r--test/spec/f32.txt2
-rw-r--r--test/spec/f32_bitwise.txt5
-rw-r--r--test/spec/f32_cmp.txt2
-rw-r--r--test/spec/f64.txt2
-rw-r--r--test/spec/f64_bitwise.txt5
-rw-r--r--test/spec/f64_cmp.txt2
-rw-r--r--test/spec/float_exprs.txt2
-rw-r--r--test/spec/float_misc.txt2
-rw-r--r--test/spec/i32.txt2
-rw-r--r--test/spec/i64.txt2
-rw-r--r--test/spec/int_exprs.txt2
-rw-r--r--test/spec/load-align-big.fail.txt10
-rw-r--r--test/spec/memory.txt2
-rw-r--r--test/spec/memory_redundancy.txt3
-rw-r--r--test/spec/memory_trap.txt2
-rw-r--r--test/spec/resizing.txt2
-rw-r--r--test/spec/store-align-big.fail.txt10
-rw-r--r--test/spec/traps.txt2
m---------third_party/testsuite0
21 files changed, 55 insertions, 20 deletions
diff --git a/src/interpreter.cc b/src/interpreter.cc
index 1e12d4a8..98e58b30 100644
--- a/src/interpreter.cc
+++ b/src/interpreter.cc
@@ -668,11 +668,15 @@ DEFINE_BITCAST(bitcast_u64_to_f64, uint64_t, double)
} \
} while (0)
-#define UNOP_FLOAT(type, func) \
- do { \
- FLOAT_TYPE_##type value = BITCAST_TO_##type(POP_##type()); \
- PUSH_##type(BITCAST_FROM_##type(func(value))); \
- break; \
+#define UNOP_FLOAT(type, func) \
+ do { \
+ FLOAT_TYPE_##type value = BITCAST_TO_##type(POP_##type()); \
+ VALUE_TYPE_##type result = BITCAST_FROM_##type(func(value)); \
+ if (WABT_UNLIKELY(IS_NAN_##type(result))) { \
+ result |= type##_QUIET_NAN_BIT; \
+ } \
+ PUSH_##type(result); \
+ break; \
} while (0)
#define BINOP_FLOAT(type, op) \
diff --git a/test/spec/conversions.txt b/test/spec/conversions.txt
index 6138d05f..000e1389 100644
--- a/test/spec/conversions.txt
+++ b/test/spec/conversions.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/conversions.wast
(;; STDOUT ;;;
-371/371 tests passed.
+401/401 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/f32.txt b/test/spec/f32.txt
index a0a6b57c..6ac5d22c 100644
--- a/test/spec/f32.txt
+++ b/test/spec/f32.txt
@@ -2,5 +2,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/f32.wast
(;; STDOUT ;;;
-2446/2446 tests passed.
+2500/2500 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/f32_bitwise.txt b/test/spec/f32_bitwise.txt
new file mode 100644
index 00000000..54ac23ba
--- /dev/null
+++ b/test/spec/f32_bitwise.txt
@@ -0,0 +1,5 @@
+;;; TOOL: run-interp-spec
+;;; STDIN_FILE: third_party/testsuite/f32_bitwise.wast
+(;; STDOUT ;;;
+360/360 tests passed.
+;;; STDOUT ;;)
diff --git a/test/spec/f32_cmp.txt b/test/spec/f32_cmp.txt
index 156f8bbf..6cce9eb0 100644
--- a/test/spec/f32_cmp.txt
+++ b/test/spec/f32_cmp.txt
@@ -2,5 +2,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/f32_cmp.wast
(;; STDOUT ;;;
-1944/1944 tests passed.
+2400/2400 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/f64.txt b/test/spec/f64.txt
index c3a5d9a2..badb6f7b 100644
--- a/test/spec/f64.txt
+++ b/test/spec/f64.txt
@@ -2,5 +2,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/f64.wast
(;; STDOUT ;;;
-2462/2462 tests passed.
+2500/2500 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/f64_bitwise.txt b/test/spec/f64_bitwise.txt
new file mode 100644
index 00000000..90450a5b
--- /dev/null
+++ b/test/spec/f64_bitwise.txt
@@ -0,0 +1,5 @@
+;;; TOOL: run-interp-spec
+;;; STDIN_FILE: third_party/testsuite/f64_bitwise.wast
+(;; STDOUT ;;;
+360/360 tests passed.
+;;; STDOUT ;;)
diff --git a/test/spec/f64_cmp.txt b/test/spec/f64_cmp.txt
index 94e6e9ba..a84131f0 100644
--- a/test/spec/f64_cmp.txt
+++ b/test/spec/f64_cmp.txt
@@ -2,5 +2,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/f64_cmp.wast
(;; STDOUT ;;;
-1944/1944 tests passed.
+2400/2400 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/float_exprs.txt b/test/spec/float_exprs.txt
index 04c8579b..609ea23f 100644
--- a/test/spec/float_exprs.txt
+++ b/test/spec/float_exprs.txt
@@ -11,5 +11,5 @@ init(i32:8, f64:15.200000) =>
init(i32:16, f64:15.300000) =>
init(i32:24, f64:15.400000) =>
run(i32:32, f64:3.000000) =>
-724/724 tests passed.
+800/800 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/float_misc.txt b/test/spec/float_misc.txt
index d63a2e96..b7255b2b 100644
--- a/test/spec/float_misc.txt
+++ b/test/spec/float_misc.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/float_misc.wast
(;; STDOUT ;;;
-417/417 tests passed.
+434/434 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/i32.txt b/test/spec/i32.txt
index 5622172d..a4740bfc 100644
--- a/test/spec/i32.txt
+++ b/test/spec/i32.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/i32.wast
(;; STDOUT ;;;
-342/342 tests passed.
+359/359 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/i64.txt b/test/spec/i64.txt
index b4df6971..1900df2c 100644
--- a/test/spec/i64.txt
+++ b/test/spec/i64.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/i64.wast
(;; STDOUT ;;;
-344/344 tests passed.
+359/359 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/int_exprs.txt b/test/spec/int_exprs.txt
index c2816c95..110b7210 100644
--- a/test/spec/int_exprs.txt
+++ b/test/spec/int_exprs.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/int_exprs.wast
(;; STDOUT ;;;
-79/79 tests passed.
+89/89 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/load-align-big.fail.txt b/test/spec/load-align-big.fail.txt
new file mode 100644
index 00000000..d7e87dae
--- /dev/null
+++ b/test/spec/load-align-big.fail.txt
@@ -0,0 +1,10 @@
+;;; ERROR: 1
+;;; TOOL: run-interp-spec
+;;; STDIN_FILE: third_party/testsuite/load-align-big.fail.wast
+(;; STDERR ;;;
+Error running "wast2wasm":
+out/third_party/testsuite/load-align-big.fail.wast:1:33: alignment must not be larger than natural alignment (8)
+(module (memory 0) (func (drop (i64.load align=16 (i32.const 0)))))
+ ^^^^^^^^^^^^^^^^^
+
+;;; STDERR ;;)
diff --git a/test/spec/memory.txt b/test/spec/memory.txt
index b64edb3b..18b6e3c1 100644
--- a/test/spec/memory.txt
+++ b/test/spec/memory.txt
@@ -106,5 +106,5 @@ out/third_party/testsuite/memory.wast:194: assert_invalid passed:
out/third_party/testsuite/memory.wast:198: assert_invalid passed:
error: alignment must not be larger than natural alignment (1)
error: @0x00000023: OnStoreExpr callback failed
-66/66 tests passed.
+86/86 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/memory_redundancy.txt b/test/spec/memory_redundancy.txt
index 527ba1dc..cf9a97d2 100644
--- a/test/spec/memory_redundancy.txt
+++ b/test/spec/memory_redundancy.txt
@@ -3,5 +3,6 @@
(;; STDOUT ;;;
zero_everything() =>
zero_everything() =>
-5/5 tests passed.
+zero_everything() =>
+7/7 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/memory_trap.txt b/test/spec/memory_trap.txt
index 3b3f0431..355ad8b9 100644
--- a/test/spec/memory_trap.txt
+++ b/test/spec/memory_trap.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/memory_trap.wast
(;; STDOUT ;;;
-39/39 tests passed.
+41/41 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/resizing.txt b/test/spec/resizing.txt
index ac21c4da..661b0c1a 100644
--- a/test/spec/resizing.txt
+++ b/test/spec/resizing.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/resizing.wast
(;; STDOUT ;;;
-32/32 tests passed.
+34/34 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/store-align-big.fail.txt b/test/spec/store-align-big.fail.txt
new file mode 100644
index 00000000..4d3222c9
--- /dev/null
+++ b/test/spec/store-align-big.fail.txt
@@ -0,0 +1,10 @@
+;;; ERROR: 1
+;;; TOOL: run-interp-spec
+;;; STDIN_FILE: third_party/testsuite/store-align-big.fail.wast
+(;; STDERR ;;;
+Error running "wast2wasm":
+out/third_party/testsuite/store-align-big.fail.wast:1:27: alignment must not be larger than natural alignment (8)
+(module (memory 0) (func (i64.store align=16 (i32.const 0) (i64.const 0))))
+ ^^^^^^^^^^^^^^^^^^
+
+;;; STDERR ;;)
diff --git a/test/spec/traps.txt b/test/spec/traps.txt
index 4aef5090..4a0ce4eb 100644
--- a/test/spec/traps.txt
+++ b/test/spec/traps.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/traps.wast
(;; STDOUT ;;;
-20/20 tests passed.
+30/30 tests passed.
;;; STDOUT ;;)
diff --git a/third_party/testsuite b/third_party/testsuite
-Subproject d008c314e4e369fa00107a6e010e1c6bf9bff70
+Subproject 07c2a3bd6da148164716d2b3999576dc1bf74af