mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-05 22:23:29 +00:00
[spirv-reader] Update test to show error caught
This is the case where a block can't be a "continue block" for more than one header. It can only be a continue block for the innermost loop it's inside of. Bug: tint:3 Change-Id: Ic19ca544ab8a30cb1ff16d2c828abb260facba90 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22601 Reviewed-by: dan sinclair <dsinclair@google.com>
This commit is contained in:
parent
90d6b2d94f
commit
3bbc45ded3
@ -6714,10 +6714,10 @@ TEST_F(SpvParserTest, DISABLED_Codegen_IfBreak_FromElse_ForwardWithinElse) {
|
|||||||
)";
|
)";
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SpvParserTest, DISABLED_BlockIsContinueForMoreThanOneHeader) {
|
TEST_F(SpvParserTest, BlockIsContinueForMoreThanOneHeader) {
|
||||||
// This is valid SPIR-V for Vulkan, but breaks my assumption that a block
|
// This is disallowed by the rule:
|
||||||
// could only be a continue target for at most one header. Block 50
|
// "a continue block is valid only for the innermost loop it is nested
|
||||||
// is a single block loop but also the continue target for the outer loop.
|
// inside of"
|
||||||
auto assembly = CommonTypes() + R"(
|
auto assembly = CommonTypes() + R"(
|
||||||
%100 = OpFunction %void None %voidfn
|
%100 = OpFunction %void None %voidfn
|
||||||
|
|
||||||
@ -6739,6 +6739,15 @@ TEST_F(SpvParserTest, DISABLED_BlockIsContinueForMoreThanOneHeader) {
|
|||||||
OpReturn
|
OpReturn
|
||||||
OpFunctionEnd
|
OpFunctionEnd
|
||||||
)";
|
)";
|
||||||
|
auto* p = parser(test::Assemble(assembly));
|
||||||
|
ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error();
|
||||||
|
FunctionEmitter fe(p, *spirv_function(100));
|
||||||
|
fe.RegisterBasicBlocks();
|
||||||
|
fe.ComputeBlockOrderAndPositions();
|
||||||
|
EXPECT_TRUE(fe.VerifyHeaderContinueMergeOrder());
|
||||||
|
EXPECT_FALSE(fe.RegisterMerges());
|
||||||
|
EXPECT_THAT(p->error(), Eq("Block 50 declared as continue target for more "
|
||||||
|
"than one header: 20, 50"));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SpvParserTest, EmitBody_If_Empty) {
|
TEST_F(SpvParserTest, EmitBody_If_Empty) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user