spirv-reader: remove test with invalid SPIR-V

SPIR-V validation fails when an object has multiple ArrayStride
decorations. Remove the SPIR-V reader tests that did this.

Change-Id: Iaac0f0f0c9230ccbc7dde5414d6aaf6f0e972534
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/73240
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: David Neto <dneto@google.com>
Commit-Queue: David Neto <dneto@google.com>
This commit is contained in:
David Neto 2021-12-16 21:50:51 +00:00 committed by Tint LUCI CQ
parent 9360046a86
commit 11d9a08287
1 changed files with 0 additions and 41 deletions

View File

@ -419,25 +419,6 @@ TEST_F(SpvParserTest, ConvertType_RuntimeArray_ArrayStride_ZeroIsError) {
Eq("invalid array type ID 10: ArrayStride can't be 0"));
}
TEST_F(SpvParserTest,
ConvertType_RuntimeArray_ArrayStride_SpecifiedTwiceTakeTheFirstStride) {
// This is an inconsistent input module. Be resilient and
// take only the first stride.
auto p = parser(test::Assemble(Preamble() + R"(
OpDecorate %10 ArrayStride 64
OpDecorate %10 ArrayStride 32
%uint = OpTypeInt 32 0
%10 = OpTypeRuntimeArray %uint
)" + MainBody()));
EXPECT_TRUE(p->BuildInternalModule());
auto* type = p->ConvertType(10);
ASSERT_NE(type, nullptr);
auto* arr_type = type->UnwrapAll()->As<Array>();
ASSERT_NE(arr_type, nullptr);
EXPECT_EQ(arr_type->size, 0u);
EXPECT_EQ(arr_type->stride, 64u);
}
TEST_F(SpvParserTest, ConvertType_Array) {
auto p = parser(test::Assemble(Preamble() + R"(
%uint = OpTypeInt 32 0
@ -556,28 +537,6 @@ TEST_F(SpvParserTest, ConvertType_ArrayStride_ZeroIsError) {
Eq("invalid array type ID 10: ArrayStride can't be 0"));
}
TEST_F(SpvParserTest,
ConvertType_ArrayStride_SpecifiedTwiceTakeTheFirstStride) {
// This is an inconsistent input module. Be resilient and
// take only the first stride.
auto p = parser(test::Assemble(Preamble() + R"(
OpDecorate %10 ArrayStride 4
OpDecorate %10 ArrayStride 8
%uint = OpTypeInt 32 0
%uint_5 = OpConstant %uint 5
%10 = OpTypeArray %uint %uint_5
)" + MainBody()));
EXPECT_TRUE(p->BuildInternalModule());
auto* type = p->ConvertType(10);
ASSERT_NE(type, nullptr);
EXPECT_TRUE(type->UnwrapAll()->Is<Array>());
auto* arr_type = type->UnwrapAll()->As<Array>();
ASSERT_NE(arr_type, nullptr);
EXPECT_EQ(arr_type->stride, 4u);
EXPECT_TRUE(p->error().empty());
}
TEST_F(SpvParserTest, ConvertType_StructEmpty) {
auto p = parser(test::Assemble(Preamble() + R"(
%10 = OpTypeStruct