summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/vacuum-tnh.wast13
-rw-r--r--test/wasm2js/br_table_to_loop.2asm.js.opt4
2 files changed, 11 insertions, 6 deletions
diff --git a/test/lit/passes/vacuum-tnh.wast b/test/lit/passes/vacuum-tnh.wast
index 6b0907989..e4ce9765d 100644
--- a/test/lit/passes/vacuum-tnh.wast
+++ b/test/lit/passes/vacuum-tnh.wast
@@ -186,7 +186,14 @@
)
;; YESTNH: (func $drop-loop (type $none_=>_none)
- ;; YESTNH-NEXT: (nop)
+ ;; YESTNH-NEXT: (drop
+ ;; YESTNH-NEXT: (loop $loop (result i32)
+ ;; YESTNH-NEXT: (br_if $loop
+ ;; YESTNH-NEXT: (i32.const 1)
+ ;; YESTNH-NEXT: )
+ ;; YESTNH-NEXT: (i32.const 10)
+ ;; YESTNH-NEXT: )
+ ;; YESTNH-NEXT: )
;; YESTNH-NEXT: )
;; NO_TNH: (func $drop-loop (type $none_=>_none)
;; NO_TNH-NEXT: (drop
@@ -199,8 +206,8 @@
;; NO_TNH-NEXT: )
;; NO_TNH-NEXT: )
(func $drop-loop
- ;; A loop has effects, since it might infinite loop (and hit a timeout trap
- ;; eventually), so we do not vacuum it out unless we are ignoring traps.
+ ;; A loop has the effect of potentially being infinite. Even in TNH mode we
+ ;; do not optimize out such loops.
(drop
(loop $loop (result i32)
(br_if $loop
diff --git a/test/wasm2js/br_table_to_loop.2asm.js.opt b/test/wasm2js/br_table_to_loop.2asm.js.opt
index 5c6fa5e7f..4c9f97311 100644
--- a/test/wasm2js/br_table_to_loop.2asm.js.opt
+++ b/test/wasm2js/br_table_to_loop.2asm.js.opt
@@ -1,6 +1,4 @@
-function wasm2js_trap() { throw new Error('abort'); }
-
function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
@@ -13,7 +11,7 @@ function asmFunc(imports) {
var Math_trunc = Math.trunc;
var Math_sqrt = Math.sqrt;
function $0() {
- wasm2js_trap();
+ while (1) continue;
}
function $1() {