From 11d9a0828781bab9a3e776afd9a169cb6fed51d7 Mon Sep 17 00:00:00 2001 From: David Neto Date: Thu, 16 Dec 2021 21:50:51 +0000 Subject: [PATCH] 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 Reviewed-by: James Price Kokoro: David Neto Commit-Queue: David Neto --- .../spirv/parser_impl_convert_type_test.cc | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/src/reader/spirv/parser_impl_convert_type_test.cc b/src/reader/spirv/parser_impl_convert_type_test.cc index 8ad4177467..b580b67e6d 100644 --- a/src/reader/spirv/parser_impl_convert_type_test.cc +++ b/src/reader/spirv/parser_impl_convert_type_test.cc @@ -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(); - 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()); - auto* arr_type = type->UnwrapAll()->As(); - 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