Index: test/unittests/wasm/function-body-decoder-unittest.cc |
diff --git a/test/unittests/wasm/function-body-decoder-unittest.cc b/test/unittests/wasm/function-body-decoder-unittest.cc |
index 196e2357c5e18ce48a0360d414ea7bd4ae5ba40b..14a74f7b22721a41d8f8a58fb7755505cefee68a 100644 |
--- a/test/unittests/wasm/function-body-decoder-unittest.cc |
+++ b/test/unittests/wasm/function-body-decoder-unittest.cc |
@@ -2133,6 +2133,12 @@ TEST_F(FunctionBodyDecoderTest, BrTable_invalid_br2) { |
} |
} |
+TEST_F(FunctionBodyDecoderTest, BrUnreachable) { |
+ static byte code[] = {WASM_GET_LOCAL(0), kExprBrTable, 0, |
+ BR_TARGET(0), kExprSetLocal, 0}; |
+ EXPECT_VERIFIES_C(v_i, code); |
+} |
+ |
TEST_F(FunctionBodyDecoderTest, Brv1) { |
EXPECT_VERIFIES(i_i, WASM_BLOCK_I(WASM_BRV(0, WASM_ZERO))); |
EXPECT_VERIFIES(i_i, WASM_BLOCK_I(WASM_LOOP(WASM_BRV(2, WASM_ZERO)))); |
@@ -2225,6 +2231,12 @@ TEST_F(FunctionBodyDecoderTest, Throw) { |
EXPECT_FAILURE(l_l, WASM_GET_LOCAL(0), kExprThrow, WASM_I64V(0)); |
} |
+TEST_F(FunctionBodyDecoderTest, ThrowUnreachable) { |
+ // TODO(titzer): unreachable code after throw should validate. |
+ // FLAG_wasm_eh_prototype = true; |
+ // EXPECT_VERIFIES(v_i, WASM_GET_LOCAL(0), kExprThrow, kExprSetLocal, 0); |
+} |
+ |
#define WASM_TRY_OP kExprTry, kLocalVoid |
#define WASM_CATCH(local) kExprCatch, static_cast<byte>(local) |