Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Unified Diff: test/unittests/wasm/ast-decoder-unittest.cc

Issue 2447683004: [wasm] fix simd opcode read and error case for bad simd opcodes (Closed)
Patch Set: [wasm] fix simd opcode read and error case for bad simd opcodes Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/wasm/ast-decoder-unittest.cc
diff --git a/test/unittests/wasm/ast-decoder-unittest.cc b/test/unittests/wasm/ast-decoder-unittest.cc
index 8606d4c6b46328e7c1c66cc8de92957300360ec0..14f9c40765a919724f79a09b5a79a567e1b59a29 100644
--- a/test/unittests/wasm/ast-decoder-unittest.cc
+++ b/test/unittests/wasm/ast-decoder-unittest.cc
@@ -2500,6 +2500,19 @@ TEST_F(WasmOpcodeLengthTest, SimpleExpressions) {
EXPECT_LENGTH(1, kExprI64ReinterpretF64);
}
+TEST_F(WasmOpcodeLengthTest, SimdExpressions) {
+#define TEST_SIMD(name, opcode, sig) \
+ EXPECT_LENGTH_N(2, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff));
+ FOREACH_SIMD_0_OPERAND_OPCODE(TEST_SIMD)
+#undef TEST_SIMD
+#define TEST_SIMD(name, opcode, sig) \
+ EXPECT_LENGTH_N(3, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff));
+ FOREACH_SIMD_1_OPERAND_OPCODE(TEST_SIMD)
+#undef TEST_SIMD
+ // test for bad simd opcode
+ EXPECT_LENGTH_N(2, kSimdPrefix, 0xff);
+}
+
typedef ZoneVector<LocalType> LocalTypeMap;
class LocalDeclDecoderTest : public TestWithZone {
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698