spirv-reader: named type tests are deliberately invalid SPIR-V
Bug: tint:765 Change-Id: I1a1a6fb6eef3fe7d0d7fbe5e6ce819ae89978f3f Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/50022 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: David Neto <dneto@google.com> Reviewed-by: Alan Baker <alanbaker@google.com>
This commit is contained in:
parent
92ba7ee75c
commit
24fdbf9ec8
|
@ -30,6 +30,8 @@ TEST_F(SpvParserTest, NamedTypes_AnonStruct) {
|
||||||
)"));
|
)"));
|
||||||
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
||||||
EXPECT_THAT(p->program().to_str(), HasSubstr("Struct S"));
|
EXPECT_THAT(p->program().to_str(), HasSubstr("Struct S"));
|
||||||
|
|
||||||
|
p->DeliberatelyInvalidSpirv();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SpvParserTest, NamedTypes_NamedStruct) {
|
TEST_F(SpvParserTest, NamedTypes_NamedStruct) {
|
||||||
|
@ -40,6 +42,8 @@ TEST_F(SpvParserTest, NamedTypes_NamedStruct) {
|
||||||
)"));
|
)"));
|
||||||
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
||||||
EXPECT_THAT(p->program().to_str(), HasSubstr("Struct mystruct"));
|
EXPECT_THAT(p->program().to_str(), HasSubstr("Struct mystruct"));
|
||||||
|
|
||||||
|
p->DeliberatelyInvalidSpirv();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SpvParserTest, NamedTypes_Dup_EmitBoth) {
|
TEST_F(SpvParserTest, NamedTypes_Dup_EmitBoth) {
|
||||||
|
@ -57,6 +61,8 @@ TEST_F(SpvParserTest, NamedTypes_Dup_EmitBoth) {
|
||||||
StructMember{field0: __u32}
|
StructMember{field0: __u32}
|
||||||
StructMember{field1: __u32}
|
StructMember{field1: __u32}
|
||||||
})"));
|
})"));
|
||||||
|
|
||||||
|
p->DeliberatelyInvalidSpirv();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(dneto): Should we make an alias for an un-decoratrd array with
|
// TODO(dneto): Should we make an alias for an un-decoratrd array with
|
||||||
|
@ -72,6 +78,8 @@ TEST_F(SpvParserTest, NamedTypes_AnonRTArrayWithDecoration) {
|
||||||
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
||||||
EXPECT_THAT(p->program().to_str(),
|
EXPECT_THAT(p->program().to_str(),
|
||||||
HasSubstr("RTArr -> __array__u32_stride_8\n"));
|
HasSubstr("RTArr -> __array__u32_stride_8\n"));
|
||||||
|
|
||||||
|
p->DeliberatelyInvalidSpirv();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SpvParserTest, NamedTypes_AnonRTArray_Dup_EmitBoth) {
|
TEST_F(SpvParserTest, NamedTypes_AnonRTArray_Dup_EmitBoth) {
|
||||||
|
@ -86,6 +94,8 @@ TEST_F(SpvParserTest, NamedTypes_AnonRTArray_Dup_EmitBoth) {
|
||||||
EXPECT_THAT(p->program().to_str(),
|
EXPECT_THAT(p->program().to_str(),
|
||||||
HasSubstr("RTArr -> __array__u32_stride_8\n RTArr_1 -> "
|
HasSubstr("RTArr -> __array__u32_stride_8\n RTArr_1 -> "
|
||||||
"__array__u32_stride_8\n"));
|
"__array__u32_stride_8\n"));
|
||||||
|
|
||||||
|
p->DeliberatelyInvalidSpirv();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SpvParserTest, NamedTypes_NamedRTArray) {
|
TEST_F(SpvParserTest, NamedTypes_NamedRTArray) {
|
||||||
|
@ -98,6 +108,8 @@ TEST_F(SpvParserTest, NamedTypes_NamedRTArray) {
|
||||||
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
||||||
EXPECT_THAT(p->program().to_str(),
|
EXPECT_THAT(p->program().to_str(),
|
||||||
HasSubstr("myrtarr -> __array__u32_stride_8\n"));
|
HasSubstr("myrtarr -> __array__u32_stride_8\n"));
|
||||||
|
|
||||||
|
p->DeliberatelyInvalidSpirv();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SpvParserTest, NamedTypes_NamedArray) {
|
TEST_F(SpvParserTest, NamedTypes_NamedArray) {
|
||||||
|
@ -112,6 +124,8 @@ TEST_F(SpvParserTest, NamedTypes_NamedArray) {
|
||||||
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
||||||
EXPECT_THAT(p->program().to_str(),
|
EXPECT_THAT(p->program().to_str(),
|
||||||
HasSubstr("myarr -> __array__u32_5_stride_8"));
|
HasSubstr("myarr -> __array__u32_5_stride_8"));
|
||||||
|
|
||||||
|
p->DeliberatelyInvalidSpirv();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SpvParserTest, NamedTypes_AnonArray_Dup_EmitBoth) {
|
TEST_F(SpvParserTest, NamedTypes_AnonArray_Dup_EmitBoth) {
|
||||||
|
@ -127,6 +141,8 @@ TEST_F(SpvParserTest, NamedTypes_AnonArray_Dup_EmitBoth) {
|
||||||
EXPECT_THAT(p->program().to_str(),
|
EXPECT_THAT(p->program().to_str(),
|
||||||
HasSubstr("Arr -> __array__u32_5_stride_8\n Arr_1 -> "
|
HasSubstr("Arr -> __array__u32_5_stride_8\n Arr_1 -> "
|
||||||
"__array__u32_5_stride_8"));
|
"__array__u32_5_stride_8"));
|
||||||
|
|
||||||
|
p->DeliberatelyInvalidSpirv();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(dneto): Handle arrays sized by a spec constant.
|
// TODO(dneto): Handle arrays sized by a spec constant.
|
||||||
|
|
Loading…
Reference in New Issue