summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/regress/brtable-conditionblock-folding.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/wasm/regress/brtable-conditionblock-folding.js')
-rw-r--r--js/src/jit-test/tests/wasm/regress/brtable-conditionblock-folding.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/regress/brtable-conditionblock-folding.js b/js/src/jit-test/tests/wasm/regress/brtable-conditionblock-folding.js
new file mode 100644
index 000000000..a2f9b4e37
--- /dev/null
+++ b/js/src/jit-test/tests/wasm/regress/brtable-conditionblock-folding.js
@@ -0,0 +1,19 @@
+load(libdir + "wasm.js");
+
+assertEq(wasmEvalText(`
+(module
+ (func $f (param $p i32)
+ block $out
+ i32.const 0
+ if
+ i32.const 1
+ tee_local $p
+ br_table $out $out
+ end
+ end
+ get_local $p
+ br_if 0
+ )
+ (export "f" $f)
+)
+`).exports.f(42), undefined);