Index: test/unittests/wasm/module-decoder-unittest.cc |
diff --git a/test/unittests/wasm/module-decoder-unittest.cc b/test/unittests/wasm/module-decoder-unittest.cc |
index 42798ca81b1f55aa71a20ee682e8a184a9cc773a..72ae3816155eb1d85f2d3ff074183201dae60d1d 100644 |
--- a/test/unittests/wasm/module-decoder-unittest.cc |
+++ b/test/unittests/wasm/module-decoder-unittest.cc |
@@ -47,8 +47,7 @@ namespace wasm { |
#define EMPTY_SIGNATURES_SECTION SECTION(Type, 1), 0 |
#define EMPTY_FUNCTION_SIGNATURES_SECTION SECTION(Function, 1), 0 |
#define EMPTY_FUNCTION_BODIES_SECTION SECTION(Code, 1), 0 |
-#define SECTION_NAMES(size) \ |
- kUnknownSectionCode, U32V_1(size + 5), 4, 'n', 'a', 'm', 'e' |
+#define SECTION_NAMES(size) SECTION(Unknown, size + 5), 4, 'n', 'a', 'm', 'e' |
#define EMPTY_NAMES_SECTION SECTION_NAMES(1), 0 |
#define X1(...) __VA_ARGS__ |
@@ -1288,6 +1287,15 @@ TEST_F(WasmModuleVerifyTest, InitExpr_global) { |
EXPECT_EQ(37, expr.val.global_index); |
} |
+TEST_F(WasmModuleVerifyTest, Multiple_Named_Sections) { |
+ static const byte data[] = { |
+ SECTION(Unknown, 4), 1, 'X', 17, 18, // -- |
+ SECTION(Unknown, 9), 3, 'f', 'o', 'o', 5, 6, 7, 8, 9, // -- |
+ SECTION(Unknown, 8), 5, 'o', 't', 'h', 'e', 'r', 7, 8, // -- |
+ }; |
+ EXPECT_VERIFIES(data); |
+} |
+ |
} // namespace wasm |
} // namespace internal |
} // namespace v8 |