Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShahbaz Youssefi <syoussefi@google.com>2022-09-29 11:03:49 +0300
committerGitHub <noreply@github.com>2022-09-29 11:03:49 +0300
commit3ec6b3698e4158d8301d2a1a033346c5313f2df4 (patch)
treebbf8480b480124d09eefed8f4174656fda73e9e9 /test
parente1a8b5d60dbf44aa76913d86dae203b7e2dbc884 (diff)
spirv-val: Consistently quote ids in messages (#4950)
Half the messages used to output 'id[%name]' and half id[%name]. With this change, all messages consistently output 'id[%name]'. Some typos are also fixed in the process.
Diffstat (limited to 'test')
-rw-r--r--test/cpp_interface_test.cpp2
-rw-r--r--test/val/val_adjacency_test.cpp2
-rw-r--r--test/val/val_arithmetics_test.cpp5
-rw-r--r--test/val/val_atomics_test.cpp9
-rw-r--r--test/val/val_barriers_test.cpp2
-rw-r--r--test/val/val_cfg_test.cpp232
-rw-r--r--test/val/val_composites_test.cpp9
-rw-r--r--test/val/val_conversion_test.cpp12
-rw-r--r--test/val/val_data_test.cpp8
-rw-r--r--test/val/val_decoration_test.cpp26
-rw-r--r--test/val/val_derivatives_test.cpp2
-rw-r--r--test/val/val_ext_inst_test.cpp24
-rw-r--r--test/val/val_function_test.cpp49
-rw-r--r--test/val/val_id_test.cpp104
-rw-r--r--test/val/val_image_test.cpp5
-rw-r--r--test/val/val_interfaces_test.cpp2
-rw-r--r--test/val/val_memory_test.cpp15
-rw-r--r--test/val/val_non_semantic_test.cpp2
-rw-r--r--test/val/val_ray_query_test.cpp2
-rw-r--r--test/val/val_ssa_test.cpp34
20 files changed, 291 insertions, 255 deletions
diff --git a/test/cpp_interface_test.cpp b/test/cpp_interface_test.cpp
index 538d40fd4..4cab4dfd8 100644
--- a/test/cpp_interface_test.cpp
+++ b/test/cpp_interface_test.cpp
@@ -58,7 +58,7 @@ TEST(CppInterface, SuccessfulRoundTrip) {
EXPECT_EQ(0u, position.line);
EXPECT_EQ(0u, position.column);
EXPECT_EQ(1u, position.index);
- EXPECT_STREQ("ID 1[%1] has not been defined\n %2 = OpSizeOf %1 %3\n",
+ EXPECT_STREQ("ID '1[%1]' has not been defined\n %2 = OpSizeOf %1 %3\n",
message);
});
EXPECT_FALSE(t.Validate(binary));
diff --git a/test/val/val_adjacency_test.cpp b/test/val/val_adjacency_test.cpp
index 295985358..4649948fe 100644
--- a/test/val/val_adjacency_test.cpp
+++ b/test/val/val_adjacency_test.cpp
@@ -54,7 +54,7 @@ OpFunctionEnd
CompileSuccessfully(module);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("ID 1[%bool] has not been defined"));
+ HasSubstr("ID '1[%bool]' has not been defined"));
}
TEST_F(ValidateAdjacency, OpLoopMergeEndsModuleFail) {
diff --git a/test/val/val_arithmetics_test.cpp b/test/val/val_arithmetics_test.cpp
index 4c093e9fd..631375efb 100644
--- a/test/val/val_arithmetics_test.cpp
+++ b/test/val/val_arithmetics_test.cpp
@@ -606,8 +606,9 @@ TEST_F(ValidateArithmetics, DotNotVectorTypeOperand1) {
CompileSuccessfully(GenerateCode(body).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 6[%float] cannot be a "
- "type"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Operand '6[%float]' cannot be a "
+ "type"));
}
TEST_F(ValidateArithmetics, DotNotVectorTypeOperand2) {
diff --git a/test/val/val_atomics_test.cpp b/test/val/val_atomics_test.cpp
index a7e4055af..b266ad666 100644
--- a/test/val/val_atomics_test.cpp
+++ b/test/val/val_atomics_test.cpp
@@ -1000,8 +1000,9 @@ TEST_F(ValidateAtomics, AtomicLoadWrongPointerType) {
CompileSuccessfully(GenerateKernelCode(body));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 27[%_ptr_Workgroup_float] cannot be a type"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Operand '27[%_ptr_Workgroup_float]' cannot be a type"));
}
TEST_F(ValidateAtomics, AtomicLoadWrongPointerDataType) {
@@ -1273,7 +1274,7 @@ TEST_F(ValidateAtomics, AtomicExchangeWrongPointerType) {
CompileSuccessfully(GenerateKernelCode(body));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 33[%_ptr_Workgroup_v4float] cannot be a "
+ HasSubstr("Operand '33[%_ptr_Workgroup_v4float]' cannot be a "
"type"));
}
@@ -1400,7 +1401,7 @@ TEST_F(ValidateAtomics, AtomicCompareExchangeWrongPointerType) {
CompileSuccessfully(GenerateKernelCode(body));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 33[%_ptr_Workgroup_v4float] cannot be a "
+ HasSubstr("Operand '33[%_ptr_Workgroup_v4float]' cannot be a "
"type"));
}
diff --git a/test/val/val_barriers_test.cpp b/test/val/val_barriers_test.cpp
index 073a0f697..c86cdc138 100644
--- a/test/val/val_barriers_test.cpp
+++ b/test/val/val_barriers_test.cpp
@@ -971,7 +971,7 @@ OpMemoryBarrier %u32 %u32_0
CompileSuccessfully(GenerateKernelCode(body), SPV_ENV_UNIVERSAL_1_1);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1));
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 5[%uint] cannot be a "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand '5[%uint]' cannot be a "
"type"));
}
diff --git a/test/val/val_cfg_test.cpp b/test/val/val_cfg_test.cpp
index ede51a9e8..a4d144419 100644
--- a/test/val/val_cfg_test.cpp
+++ b/test/val/val_cfg_test.cpp
@@ -386,8 +386,8 @@ TEST_P(ValidateCFG, BlockAppearsBeforeDominatorBad) {
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- MatchesRegex("Block .\\[%cont\\] appears in the binary "
- "before its dominator .\\[%branch\\]\n"
+ MatchesRegex("Block '.\\[%cont\\]' appears in the binary "
+ "before its dominator '.\\[%branch\\]'\n"
" %branch = OpLabel\n"));
}
@@ -419,7 +419,7 @@ TEST_P(ValidateCFG, MergeBlockTargetedByMultipleHeaderBlocksBad) {
if (is_shader) {
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- MatchesRegex("Block .\\[%merge\\] is already a merge block "
+ MatchesRegex("Block '.\\[%merge\\]' is already a merge block "
"for another header\n"
" %Main = OpFunction %void None %9\n"));
} else {
@@ -455,7 +455,7 @@ TEST_P(ValidateCFG, MergeBlockTargetedByMultipleHeaderBlocksSelectionBad) {
if (is_shader) {
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- MatchesRegex("Block .\\[%merge\\] is already a merge block "
+ MatchesRegex("Block '.\\[%merge\\]' is already a merge block "
"for another header\n"
" %Main = OpFunction %void None %9\n"));
} else {
@@ -480,8 +480,8 @@ TEST_P(ValidateCFG, BranchTargetFirstBlockBadSinceEntryBlock) {
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- MatchesRegex("First block .\\[%entry\\] of function "
- ".\\[%Main\\] is targeted by block .\\[%bad\\]\n"
+ MatchesRegex("First block '.\\[%entry\\]' of function "
+ "'.\\[%Main\\]' is targeted by block '.\\[%bad\\]'\n"
" %Main = OpFunction %void None %10\n"));
}
@@ -529,10 +529,11 @@ TEST_P(ValidateCFG, BranchConditionalTrueTargetFirstBlockBad) {
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- MatchesRegex("First block .\\[%entry\\] of function .\\[%Main\\] "
- "is targeted by block .\\[%bad\\]\n"
- " %Main = OpFunction %void None %10\n"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ MatchesRegex("First block '.\\[%entry\\]' of function '.\\[%Main\\]' "
+ "is targeted by block '.\\[%bad\\]'\n"
+ " %Main = OpFunction %void None %10\n"));
}
TEST_P(ValidateCFG, BranchConditionalFalseTargetFirstBlockBad) {
@@ -558,10 +559,11 @@ TEST_P(ValidateCFG, BranchConditionalFalseTargetFirstBlockBad) {
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- MatchesRegex("First block .\\[%entry\\] of function .\\[%Main\\] "
- "is targeted by block .\\[%bad\\]\n"
- " %Main = OpFunction %void None %10\n"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ MatchesRegex("First block '.\\[%entry\\]' of function '.\\[%Main\\]' "
+ "is targeted by block '.\\[%bad\\]'\n"
+ " %Main = OpFunction %void None %10\n"));
}
TEST_P(ValidateCFG, SwitchTargetFirstBlockBad) {
@@ -594,10 +596,11 @@ TEST_P(ValidateCFG, SwitchTargetFirstBlockBad) {
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- MatchesRegex("First block .\\[%entry\\] of function .\\[%Main\\] "
- "is targeted by block .\\[%bad\\]\n"
- " %Main = OpFunction %void None %10\n"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ MatchesRegex("First block '.\\[%entry\\]' of function '.\\[%Main\\]' "
+ "is targeted by block '.\\[%bad\\]'\n"
+ " %Main = OpFunction %void None %10\n"));
}
TEST_P(ValidateCFG, BranchToBlockInOtherFunctionBad) {
@@ -630,11 +633,11 @@ TEST_P(ValidateCFG, BranchToBlockInOtherFunctionBad) {
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
- EXPECT_THAT(
- getDiagnosticString(),
- MatchesRegex("Block\\(s\\) \\{.\\[%middle2\\]\\} are referenced but not "
- "defined in function .\\[%Main\\]\n"
- " %Main = OpFunction %void None %9\n"));
+ EXPECT_THAT(getDiagnosticString(),
+ MatchesRegex(
+ "Block\\(s\\) \\{'.\\[%middle2\\]'\\} are referenced but not "
+ "defined in function '.\\[%Main\\]'\n"
+ " %Main = OpFunction %void None %9\n"));
}
TEST_P(ValidateCFG, HeaderDoesntStrictlyDominateMergeBad) {
@@ -662,10 +665,11 @@ TEST_P(ValidateCFG, HeaderDoesntStrictlyDominateMergeBad) {
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- MatchesRegex("The selection construct with the selection header "
- ".\\[%head\\] does not strictly structurally dominate the "
- "merge block "
- ".\\[%head\\]\n %head = OpLabel\n"));
+ MatchesRegex(
+ "The selection construct with the selection header "
+ "'.\\[%head\\]' does not strictly structurally dominate the "
+ "merge block "
+ "'.\\[%head\\]'\n %head = OpLabel\n"));
} else {
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions()) << str;
}
@@ -1350,8 +1354,8 @@ TEST_P(ValidateCFG, BackEdgeBlockDoesntPostDominateContinueTargetBad) {
getDiagnosticString(),
MatchesRegex(
"The continue construct with the continue target "
- ".\\[%loop1_cont\\] is not structurally post dominated by the "
- "back-edge block .\\[%be_block\\]\n"
+ "'.\\[%loop1_cont\\]' is not structurally post dominated by the "
+ "back-edge block '.\\[%be_block\\]'\n"
" %be_block = OpLabel\n"));
} else {
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
@@ -1385,7 +1389,7 @@ TEST_P(ValidateCFG, BranchingToNonLoopHeaderBlockBad) {
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- MatchesRegex("Back-edges \\(.\\[%f\\] -> .\\[%split\\]\\) can only "
+ MatchesRegex("Back-edges \\('.\\[%f\\]' -> '.\\[%split\\]'\\) can only "
"be formed between a block and a loop header.\n"
" %f = OpLabel\n"));
} else {
@@ -1417,7 +1421,7 @@ TEST_P(ValidateCFG, BranchingToSameNonLoopHeaderBlockBad) {
EXPECT_THAT(
getDiagnosticString(),
MatchesRegex(
- "Back-edges \\(.\\[%split\\] -> .\\[%split\\]\\) can only be "
+ "Back-edges \\('.\\[%split\\]' -> '.\\[%split\\]'\\) can only be "
"formed between a block and a loop header.\n %split = OpLabel\n"));
} else {
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
@@ -1452,7 +1456,7 @@ TEST_P(ValidateCFG, MultipleBackEdgeBlocksToLoopHeaderBad) {
EXPECT_THAT(
getDiagnosticString(),
MatchesRegex(
- "Loop header .\\[%loop\\] is targeted by 2 back-edge blocks but "
+ "Loop header '.\\[%loop\\]' is targeted by 2 back-edge blocks but "
"the standard requires exactly one\n %loop = OpLabel\n"))
<< str;
} else {
@@ -1487,12 +1491,13 @@ TEST_P(ValidateCFG, ContinueTargetMustBePostDominatedByBackEdge) {
CompileSuccessfully(str);
if (is_shader) {
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- MatchesRegex(
- "The continue construct with the continue target "
- ".\\[%cheader\\] is not structurally post dominated by the "
- "back-edge block .\\[%be_block\\]\n"
- " %be_block = OpLabel\n"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ MatchesRegex(
+ "The continue construct with the continue target "
+ "'.\\[%cheader\\]' is not structurally post dominated by the "
+ "back-edge block '.\\[%be_block\\]'\n"
+ " %be_block = OpLabel\n"));
} else {
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1524,8 +1529,8 @@ TEST_P(ValidateCFG, BranchOutOfConstructToMergeBad) {
EXPECT_THAT(
getDiagnosticString(),
MatchesRegex("The continue construct with the continue target "
- ".\\[%loop\\] is not structurally post dominated by the "
- "back-edge block .\\[%cont\\]\n"
+ "'.\\[%loop\\]' is not structurally post dominated by the "
+ "back-edge block '.\\[%cont\\]'\n"
" %cont = OpLabel\n"))
<< str;
} else {
@@ -1561,8 +1566,8 @@ TEST_P(ValidateCFG, BranchOutOfConstructBad) {
EXPECT_THAT(
getDiagnosticString(),
MatchesRegex("The continue construct with the continue target "
- ".\\[%loop\\] is not structurally post dominated by the "
- "back-edge block .\\[%cont\\]\n"
+ "'.\\[%loop\\]' is not structurally post dominated by the "
+ "back-edge block '.\\[%cont\\]'\n"
" %cont = OpLabel\n"));
} else {
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
@@ -1636,7 +1641,7 @@ TEST_F(ValidateCFG, LoopWithZeroBackEdgesBad) {
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- MatchesRegex("Loop header .\\[%loop\\] is targeted by "
+ MatchesRegex("Loop header '.\\[%loop\\]' is targeted by "
"0 back-edge blocks but the standard requires exactly "
"one\n %loop = OpLabel\n"));
}
@@ -1748,9 +1753,10 @@ TEST_P(ValidateCFG, ContinueTargetCanBeMergeBlockForNestedStructure) {
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Header block 3[%if_head] is contained in the loop construct "
- "headed "
- "by 2[%loop], but its merge block 5[%if_merge] is not"));
+ HasSubstr(
+ "Header block '3[%if_head]' is contained in the loop construct "
+ "headed "
+ "by '2[%loop]', but its merge block '5[%if_merge]' is not"));
} else {
EXPECT_THAT(SPV_SUCCESS, ValidateInstructions());
}
@@ -1955,8 +1961,9 @@ OpFunctionEnd
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
- "Case construct that targets 10[%10] has branches to multiple other "
- "case construct targets 12[%12] and 11[%11]\n %10 = OpLabel"));
+ "Case construct that targets '10[%10]' has branches to multiple "
+ "other "
+ "case construct targets '12[%12]' and '11[%11]'\n %10 = OpLabel"));
}
TEST_F(ValidateCFG, MultipleFallThroughToDefault) {
@@ -1990,7 +1997,7 @@ OpFunctionEnd
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Multiple case constructs have branches to the case construct "
- "that targets 10[%10]\n %10 = OpLabel"));
+ "that targets '10[%10]'\n %10 = OpLabel"));
}
TEST_F(ValidateCFG, MultipleFallThroughToNonDefault) {
@@ -2024,7 +2031,7 @@ OpFunctionEnd
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Multiple case constructs have branches to the case construct "
- "that targets 12[%12]\n %12 = OpLabel"));
+ "that targets '12[%12]'\n %12 = OpLabel"));
}
TEST_F(ValidateCFG, DuplicateTargetWithFallThrough) {
@@ -2085,10 +2092,11 @@ OpFunctionEnd
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Case construct that targets 12[%12] has branches to the case "
- "construct that targets 11[%11], but does not immediately "
- "precede it in the OpSwitch's target list\n"
- " OpSwitch %uint_0 %10 0 %11 1 %12"));
+ HasSubstr(
+ "Case construct that targets '12[%12]' has branches to the case "
+ "construct that targets '11[%11]', but does not immediately "
+ "precede it in the OpSwitch's target list\n"
+ " OpSwitch %uint_0 %10 0 %11 1 %12"));
}
TEST_F(ValidateCFG, WrongOperandListThroughDefault) {
@@ -2121,10 +2129,11 @@ OpFunctionEnd
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Case construct that targets 12[%12] has branches to the case "
- "construct that targets 11[%11], but does not immediately "
- "precede it in the OpSwitch's target list\n"
- " OpSwitch %uint_0 %10 0 %11 1 %12"));
+ HasSubstr(
+ "Case construct that targets '12[%12]' has branches to the case "
+ "construct that targets '11[%11]', but does not immediately "
+ "precede it in the OpSwitch's target list\n"
+ " OpSwitch %uint_0 %10 0 %11 1 %12"));
}
TEST_F(ValidateCFG, WrongOperandListNotLast) {
@@ -2159,10 +2168,11 @@ OpFunctionEnd
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Case construct that targets 12[%12] has branches to the case "
- "construct that targets 11[%11], but does not immediately "
- "precede it in the OpSwitch's target list\n"
- " OpSwitch %uint_0 %10 0 %11 1 %12 2 %13"));
+ HasSubstr(
+ "Case construct that targets '12[%12]' has branches to the case "
+ "construct that targets '11[%11]', but does not immediately "
+ "precede it in the OpSwitch's target list\n"
+ " OpSwitch %uint_0 %10 0 %11 1 %12 2 %13"));
}
TEST_F(ValidateCFG, GoodUnreachableSwitch) {
@@ -2226,11 +2236,12 @@ OpFunctionEnd
CompileSuccessfully(text);
ASSERT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Case construct that targets 8[%8] has invalid branch "
- "to block 10[%10] (not another case construct, "
- "corresponding merge, outer loop merge or outer loop "
- "continue)"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Case construct that targets '8[%8]' has invalid branch "
+ "to block '10[%10]' (not another case construct, "
+ "corresponding merge, outer loop merge or outer loop "
+ "continue)"));
}
TEST_F(ValidateCFG, GoodCaseExitsToOuterConstructs) {
@@ -2297,8 +2308,8 @@ OpFunctionEnd
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Case construct that targets 1[%default] has branches to the "
- "case construct that targets 2[%other], but does not "
+ HasSubstr("Case construct that targets '1[%default]' has branches to the "
+ "case construct that targets '2[%other]', but does not "
"immediately precede it in the OpSwitch's target list"));
}
@@ -2330,8 +2341,8 @@ OpFunctionEnd
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Case construct that targets 2[%other] has branches to the "
- "case construct that targets 1[%default], but does not "
+ HasSubstr("Case construct that targets '2[%other]' has branches to the "
+ "case construct that targets '1[%default]', but does not "
"immediately precede it in the OpSwitch's target list"));
}
@@ -2800,7 +2811,7 @@ OpFunctionEnd
CompileSuccessfully(text);
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Back-edges (10[%10] -> 9[%9]) can only be formed "
+ HasSubstr("Back-edges ('10[%10]' -> '9[%9]') can only be formed "
"between a block and a loop header"));
}
@@ -2826,7 +2837,7 @@ OpFunctionEnd
CompileSuccessfully(text);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Merge Block 1[%undef] must be an OpLabel"));
+ HasSubstr("Merge Block '1[%undef]' must be an OpLabel"));
}
TEST_F(ValidateCFG, LoopMergeContinueTargetNotLabel) {
@@ -2851,7 +2862,7 @@ OpFunctionEnd
CompileSuccessfully(text);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Continue Target 1[%undef] must be an OpLabel"));
+ HasSubstr("Continue Target '1[%undef]' must be an OpLabel"));
}
TEST_F(ValidateCFG, LoopMergeMergeBlockContinueTargetSameLabel) {
@@ -3095,9 +3106,10 @@ OpFunctionEnd
CompileSuccessfully(text);
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("block <ID> 10[%10] exits the selection headed by <ID> "
- "8[%8], but not via a structured exit"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("block <ID> '10[%10]' exits the selection headed by <ID> "
+ "'8[%8]', but not via a structured exit"));
}
TEST_F(ValidateCFG, InvalidLoopExit) {
@@ -3131,8 +3143,8 @@ OpFunctionEnd
CompileSuccessfully(text);
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("block <ID> 11[%11] exits the loop headed by <ID> "
- "8[%8], but not via a structured exit"));
+ HasSubstr("block <ID> '11[%11]' exits the loop headed by <ID> "
+ "'8[%8]', but not via a structured exit"));
}
TEST_F(ValidateCFG, InvalidContinueExit) {
@@ -3165,9 +3177,10 @@ OpFunctionEnd
CompileSuccessfully(text);
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("block <ID> 11[%11] exits the continue headed by <ID> "
- "10[%10], but not via a structured exit"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("block <ID> '11[%11]' exits the continue headed by <ID> "
+ "'10[%10]', but not via a structured exit"));
}
TEST_F(ValidateCFG, InvalidSelectionExitBackedge) {
@@ -3205,8 +3218,9 @@ OpFunctionEnd
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("The continue construct with the continue target 9[%9] is not "
- "structurally post dominated by the back-edge block 13[%13]"));
+ HasSubstr(
+ "The continue construct with the continue target '9[%9]' is not "
+ "structurally post dominated by the back-edge block '13[%13]'"));
}
TEST_F(ValidateCFG, BreakFromSwitch) {
@@ -3269,9 +3283,10 @@ OpFunctionEnd
CompileSuccessfully(text);
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("block <ID> 12[%12] exits the selection headed by <ID> "
- "10[%10], but not via a structured exit"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("block <ID> '12[%12]' exits the selection headed by <ID> "
+ "'10[%10]', but not via a structured exit"));
}
TEST_F(ValidateCFG, BreakToOuterSwitch) {
@@ -3308,9 +3323,10 @@ OpFunctionEnd
CompileSuccessfully(text);
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("block <ID> 14[%14] exits the selection headed by <ID> "
- "10[%10], but not via a structured exit"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("block <ID> '14[%14]' exits the selection headed by <ID> "
+ "'10[%10]', but not via a structured exit"));
}
TEST_F(ValidateCFG, BreakToOuterLoop) {
@@ -3352,8 +3368,8 @@ OpFunctionEnd
CompileSuccessfully(text);
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("block <ID> 15[%15] exits the loop headed by <ID> "
- "10[%10], but not via a structured exit"));
+ HasSubstr("block <ID> '15[%15]' exits the loop headed by <ID> "
+ "'10[%10]', but not via a structured exit"));
}
TEST_F(ValidateCFG, ContinueFromNestedSelection) {
@@ -3800,9 +3816,9 @@ OpFunctionEnd
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr(
- "Header block 3[%body] is contained in the loop construct headed by "
- "1[%loop], but its merge block 2[%continue] is not"));
+ HasSubstr("Header block '3[%body]' is contained in the loop construct "
+ "headed by "
+ "'1[%loop]', but its merge block '2[%continue]' is not"));
}
TEST_F(ValidateCFG, ContinueCannotBeLoopMergeTarget) {
@@ -3837,9 +3853,9 @@ OpFunctionEnd
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr(
- "Header block 3[%inner] is contained in the loop construct headed by "
- "1[%loop], but its merge block 2[%continue] is not"));
+ HasSubstr("Header block '3[%inner]' is contained in the loop construct "
+ "headed by "
+ "'1[%loop]', but its merge block '2[%continue]' is not"));
}
TEST_F(ValidateCFG, ExitFromConstructWhoseHeaderIsAMerge) {
@@ -4214,11 +4230,10 @@ TEST_F(ValidateCFG, StructuredSelections_RegisterBothTrueAndFalse) {
CompileSuccessfully(text);
EXPECT_NE(SPV_SUCCESS, ValidateInstructions());
- EXPECT_THAT(
- getDiagnosticString(),
- HasSubstr(
- "The selection construct with the selection header "
- "8[%8] does not structurally dominate the merge block 10[%10]\n"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The selection construct with the selection header "
+ "'8[%8]' does not structurally dominate the merge "
+ "block '10[%10]'\n"));
}
TEST_F(ValidateCFG, UnreachableIsStaticallyReachable) {
@@ -4386,9 +4401,10 @@ OpFunctionEnd
CompileSuccessfully(text);
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("block <ID> 1[%BAD] exits the continue headed by <ID> "
- "1[%BAD], but not via a structured exit"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("block <ID> '1[%BAD]' exits the continue headed by <ID> "
+ "'1[%BAD]', but not via a structured exit"));
}
TEST_F(ValidateCFG, SwitchSelectorNotAnInt) {
@@ -4581,8 +4597,8 @@ OpFunctionEnd
EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("The continue construct with the continue target 7[%7] "
- "does not structurally dominate the back-edge block 8[%8]"));
+ HasSubstr("The continue construct with the continue target '7[%7]' "
+ "does not structurally dominate the back-edge block '8[%8]'"));
}
} // namespace
diff --git a/test/val/val_composites_test.cpp b/test/val/val_composites_test.cpp
index 507ee8894..0fd1ed652 100644
--- a/test/val/val_composites_test.cpp
+++ b/test/val/val_composites_test.cpp
@@ -322,8 +322,9 @@ TEST_F(ValidateComposites, CompositeConstructVectorWrongConsituent1) {
CompileSuccessfully(GenerateShaderCode(body).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 5[%float] cannot be a "
- "type"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Operand '5[%float]' cannot be a "
+ "type"));
}
TEST_F(ValidateComposites, CompositeConstructVectorWrongConsituent2) {
@@ -540,7 +541,7 @@ TEST_F(ValidateComposites, CopyObjectResultTypeNotType) {
CompileSuccessfully(GenerateShaderCode(body).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("ID 19[%float_0] is not a type id"));
+ HasSubstr("ID '19[%float_0]' is not a type id"));
}
TEST_F(ValidateComposites, CopyObjectWrongOperandType) {
@@ -660,7 +661,7 @@ TEST_F(ValidateComposites, CompositeExtractNotObject) {
CompileSuccessfully(GenerateShaderCode(body));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 11[%v4float] cannot "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand '11[%v4float]' cannot "
"be a type"));
}
diff --git a/test/val/val_conversion_test.cpp b/test/val/val_conversion_test.cpp
index f6f37b3fc..1f8c4265b 100644
--- a/test/val/val_conversion_test.cpp
+++ b/test/val/val_conversion_test.cpp
@@ -813,8 +813,9 @@ TEST_F(ValidateConversion, PtrCastToGenericWrongInputType) {
CompileSuccessfully(GenerateKernelCode(body).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 4[%float] cannot be a "
- "type"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Operand '4[%float]' cannot be a "
+ "type"));
}
TEST_F(ValidateConversion, PtrCastToGenericWrongInputStorageClass) {
@@ -1258,8 +1259,9 @@ TEST_F(ValidateConversion, BitcastInputHasNoType) {
CompileSuccessfully(GenerateKernelCode(body).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 4[%float] cannot be a "
- "type"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Operand '4[%float]' cannot be a "
+ "type"));
}
TEST_F(ValidateConversion, BitcastWrongResultType) {
@@ -1458,7 +1460,7 @@ OpFunctionEnd
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 1[%uint] cannot be a "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand '1[%uint]' cannot be a "
"type"));
}
diff --git a/test/val/val_data_test.cpp b/test/val/val_data_test.cpp
index eef08a1e7..6a7f243f6 100644
--- a/test/val/val_data_test.cpp
+++ b/test/val/val_data_test.cpp
@@ -387,7 +387,7 @@ TEST_F(ValidateData, ids_should_be_validated_before_data) {
CompileSuccessfully(str.c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 3[%3] requires a previous definition"));
+ HasSubstr("Operand '3[%3]' requires a previous definition"));
}
TEST_F(ValidateData, matrix_bad_column_type) {
@@ -549,7 +549,7 @@ TEST_F(ValidateData, missing_forward_pointer_decl) {
CompileSuccessfully(str.c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 3[%3] requires a previous definition"));
+ HasSubstr("Operand '3[%3]' requires a previous definition"));
}
TEST_F(ValidateData, missing_forward_pointer_decl_self_reference) {
@@ -561,7 +561,7 @@ TEST_F(ValidateData, missing_forward_pointer_decl_self_reference) {
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Operand 2[%_struct_2] requires a previous definition"));
+ HasSubstr("Operand '2[%_struct_2]' requires a previous definition"));
}
TEST_F(ValidateData, forward_pointer_missing_definition) {
@@ -824,7 +824,7 @@ OpMemoryModel Logical GLSL450
CompileSuccessfully(test, SPV_ENV_UNIVERSAL_1_5);
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 3[%_ptr_PhysicalStorageBuffer__struct_1] "
+ HasSubstr("Operand '3[%_ptr_PhysicalStorageBuffer__struct_1]' "
"requires a previous definition"));
}
diff --git a/test/val/val_decoration_test.cpp b/test/val/val_decoration_test.cpp
index 77526bf9f..28ee970a1 100644
--- a/test/val/val_decoration_test.cpp
+++ b/test/val/val_decoration_test.cpp
@@ -120,7 +120,7 @@ TEST_F(ValidateDecorations, ValidateOpMemberDecorateOutOfBound) {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Index 1 provided in OpMemberDecorate for struct <id> "
- "2[%_struct_2] is out of bounds. The structure has 1 "
+ "'2[%_struct_2]' is out of bounds. The structure has 1 "
"members. Largest valid index is 0."));
}
@@ -280,12 +280,13 @@ TEST_F(ValidateDecorations, StructContainsBuiltInStructBad) {
)";
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Structure <id> 1[%_struct_1] contains members with "
- "BuiltIn decoration. Therefore this structure may not "
- "be contained as a member of another structure type. "
- "Structure <id> 4[%_struct_4] contains structure <id> "
- "1[%_struct_1]."));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Structure <id> '1[%_struct_1]' contains members with "
+ "BuiltIn decoration. Therefore this structure may not "
+ "be contained as a member of another structure type. "
+ "Structure <id> '4[%_struct_4]' contains structure <id> "
+ "'1[%_struct_1]'."));
}
TEST_F(ValidateDecorations, StructContainsNonBuiltInStructGood) {
@@ -4687,7 +4688,7 @@ OpDecorate %1 Coherent
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Coherent decoration targeting 1[%1] is "
+ HasSubstr("Coherent decoration targeting '1[%1]' is "
"banned when using the Vulkan memory model."));
}
@@ -4707,8 +4708,9 @@ OpMemberDecorate %1 0 Coherent
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Coherent decoration targeting 1[%_struct_1] (member index 0) "
- "is banned when using the Vulkan memory model."));
+ HasSubstr(
+ "Coherent decoration targeting '1[%_struct_1]' (member index 0) "
+ "is banned when using the Vulkan memory model."));
}
TEST_F(ValidateDecorations, VulkanMemoryModelNoVolatile) {
@@ -4728,7 +4730,7 @@ OpDecorate %1 Volatile
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Volatile decoration targeting 1[%1] is banned when "
+ HasSubstr("Volatile decoration targeting '1[%1]' is banned when "
"using the Vulkan memory model."));
}
@@ -4747,7 +4749,7 @@ OpMemberDecorate %1 1 Volatile
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Volatile decoration targeting 1[%_struct_1] (member "
+ HasSubstr("Volatile decoration targeting '1[%_struct_1]' (member "
"index 1) is banned when using the Vulkan memory "
"model."));
}
diff --git a/test/val/val_derivatives_test.cpp b/test/val/val_derivatives_test.cpp
index 0a8466107..e605f3a03 100644
--- a/test/val/val_derivatives_test.cpp
+++ b/test/val/val_derivatives_test.cpp
@@ -130,7 +130,7 @@ TEST_F(ValidateDerivatives, OpDPdxWrongResultType) {
CompileSuccessfully(GenerateShaderCode(body).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 10[%v4float] cannot "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand '10[%v4float]' cannot "
"be a type"));
}
diff --git a/test/val/val_ext_inst_test.cpp b/test/val/val_ext_inst_test.cpp
index a2109db0a..e685acde5 100644
--- a/test/val/val_ext_inst_test.cpp
+++ b/test/val/val_ext_inst_test.cpp
@@ -4321,7 +4321,7 @@ TEST_P(ValidateOpenCLStdVStoreHalfLike, PNotPointer) {
CompileSuccessfully(GenerateKernelCode(ss.str()));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 89[%_ptr_Workgroup_half] cannot be a type"));
+ HasSubstr("Operand '89[%_ptr_Workgroup_half]' cannot be a type"));
}
TEST_P(ValidateOpenCLStdVStoreHalfLike, ConstPointer) {
@@ -4493,7 +4493,7 @@ TEST_P(ValidateOpenCLStdVLoadHalfLike, PNotPointer) {
CompileSuccessfully(GenerateKernelCode(ss.str()));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 89[%_ptr_Workgroup_half] cannot be a type"));
+ HasSubstr("Operand '89[%_ptr_Workgroup_half]' cannot be a type"));
}
TEST_P(ValidateOpenCLStdVLoadHalfLike, OffsetWrongStorageType) {
@@ -4664,9 +4664,10 @@ TEST_F(ValidateExtInst, VLoadNPNotPointer) {
CompileSuccessfully(GenerateKernelCode(ss.str()));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 120[%_ptr_UniformConstant_float] cannot be a "
- "type"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Operand '120[%_ptr_UniformConstant_float]' cannot be a "
+ "type"));
}
TEST_F(ValidateExtInst, VLoadNWrongStorageClass) {
@@ -4779,7 +4780,7 @@ TEST_F(ValidateExtInst, VLoadHalfPNotPointer) {
CompileSuccessfully(GenerateKernelCode(ss.str()));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 114[%_ptr_UniformConstant_half] cannot be a "
+ HasSubstr("Operand '114[%_ptr_UniformConstant_half]' cannot be a "
"type"));
}
@@ -4933,7 +4934,7 @@ TEST_F(ValidateExtInst, VStoreNPNotPointer) {
CompileSuccessfully(GenerateKernelCode(ss.str()));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 127[%_ptr_Generic_float] cannot be a type"));
+ HasSubstr("Operand '127[%_ptr_Generic_float]' cannot be a type"));
}
TEST_F(ValidateExtInst, VStoreNWrongStorageClass) {
@@ -5248,9 +5249,10 @@ TEST_F(ValidateExtInst, OpenCLStdPrintfFormatNotPointer) {
CompileSuccessfully(GenerateKernelCode(body));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 137[%_ptr_UniformConstant_uchar] cannot be a "
- "type"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Operand '137[%_ptr_UniformConstant_uchar]' cannot be a "
+ "type"));
}
TEST_F(ValidateExtInst, OpenCLStdPrintfFormatNotUniformConstStorageClass) {
@@ -5342,7 +5344,7 @@ TEST_F(ValidateExtInst, OpenCLStdPrefetchPtrNotPointer) {
CompileSuccessfully(GenerateKernelCode(body));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 99[%_ptr_CrossWorkgroup_uint] cannot be a "
+ HasSubstr("Operand '99[%_ptr_CrossWorkgroup_uint]' cannot be a "
"type"));
}
diff --git a/test/val/val_function_test.cpp b/test/val/val_function_test.cpp
index af0199a60..e7d5cd7e0 100644
--- a/test/val/val_function_test.cpp
+++ b/test/val/val_function_test.cpp
@@ -181,13 +181,14 @@ TEST_P(ValidateFunctionCall, VariableNoVariablePointers) {
} else {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
if (storage_class == "StorageBuffer") {
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("StorageBuffer pointer operand 1[%var] requires a "
- "variable pointers capability"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("StorageBuffer pointer operand '1[%var]' requires a "
+ "variable pointers capability"));
} else {
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Invalid storage class for pointer operand 1[%var]"));
+ HasSubstr("Invalid storage class for pointer operand '1[%var]'"));
}
}
}
@@ -211,8 +212,9 @@ TEST_P(ValidateFunctionCall, VariableVariablePointersStorageClass) {
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
} else {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Invalid storage class for pointer operand 1[%var]"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Invalid storage class for pointer operand '1[%var]'"));
}
}
@@ -235,8 +237,9 @@ TEST_P(ValidateFunctionCall, VariableVariablePointers) {
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
} else {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Invalid storage class for pointer operand 1[%var]"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Invalid storage class for pointer operand '1[%var]'"));
}
}
@@ -258,11 +261,12 @@ TEST_P(ValidateFunctionCall, ParameterNoVariablePointers) {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
if (storage_class == "StorageBuffer") {
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("StorageBuffer pointer operand 1[%p] requires a "
+ HasSubstr("StorageBuffer pointer operand '1[%p]' requires a "
"variable pointers capability"));
} else {
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Invalid storage class for pointer operand 1[%p]"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Invalid storage class for pointer operand '1[%p]'"));
}
}
}
@@ -287,7 +291,7 @@ TEST_P(ValidateFunctionCall, ParameterVariablePointersStorageBuffer) {
} else {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Invalid storage class for pointer operand 1[%p]"));
+ HasSubstr("Invalid storage class for pointer operand '1[%p]'"));
}
}
@@ -311,7 +315,7 @@ TEST_P(ValidateFunctionCall, ParameterVariablePointers) {
} else {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Invalid storage class for pointer operand 1[%p]"));
+ HasSubstr("Invalid storage class for pointer operand '1[%p]'"));
}
}
@@ -334,16 +338,17 @@ TEST_P(ValidateFunctionCall, NonMemoryObjectDeclarationNoVariablePointers) {
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
- "Pointer operand 2[%gep] must be a memory object declaration"));
+ "Pointer operand '2[%gep]' must be a memory object declaration"));
} else {
if (storage_class == "StorageBuffer") {
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("StorageBuffer pointer operand 2[%gep] requires a "
- "variable pointers capability"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("StorageBuffer pointer operand '2[%gep]' requires a "
+ "variable pointers capability"));
} else if (storage_class != "UniformConstant") {
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Invalid storage class for pointer operand 2[%gep]"));
+ HasSubstr("Invalid storage class for pointer operand '2[%gep]'"));
}
}
}
@@ -373,11 +378,11 @@ TEST_P(ValidateFunctionCall,
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
- "Pointer operand 2[%gep] must be a memory object declaration"));
+ "Pointer operand '2[%gep]' must be a memory object declaration"));
} else {
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Invalid storage class for pointer operand 2[%gep]"));
+ HasSubstr("Invalid storage class for pointer operand '2[%gep]'"));
}
}
}
@@ -407,11 +412,11 @@ TEST_P(ValidateFunctionCall, NonMemoryObjectDeclarationVariablePointers) {
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
- "Pointer operand 2[%gep] must be a memory object declaration"));
+ "Pointer operand '2[%gep]' must be a memory object declaration"));
} else {
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Invalid storage class for pointer operand 2[%gep]"));
+ HasSubstr("Invalid storage class for pointer operand '2[%gep]'"));
}
}
}
diff --git a/test/val/val_id_test.cpp b/test/val/val_id_test.cpp
index deda95b49..003497630 100644
--- a/test/val/val_id_test.cpp
+++ b/test/val/val_id_test.cpp
@@ -286,7 +286,7 @@ TEST_F(ValidateIdWithMessage, OpMemberDecorateMemberBad) {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Index 3 provided in OpMemberDecorate for struct <id> "
- "1[%_struct_1] is out of bounds. The structure has 2 "
+ "'1[%_struct_1]' is out of bounds. The structure has 2 "
"members. Largest valid index is 1."));
}
@@ -380,7 +380,7 @@ TEST_F(ValidateIdWithMessage, OpGroupMemberDecorateIndexOutOfBoundBad) {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Index 3 provided in OpGroupMemberDecorate for struct "
- "<id> 2[%_struct_2] is out of bounds. The structure "
+ "<id> '2[%_struct_2]' is out of bounds. The structure "
"has 3 members. Largest valid index is 2."));
}
@@ -1352,7 +1352,7 @@ TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayConstConstituentTypeBad) {
%4 = OpConstantComposite %3 %2 %2 %2 %1)"; // Uses a type as operand
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 1[%uint] cannot be a "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand '1[%uint]' cannot be a "
"type"));
}
TEST_F(ValidateIdWithMessage, OpConstantCompositeArrayConstConstituentBad) {
@@ -2127,7 +2127,7 @@ TEST_F(ValidateIdWithMessage, OpVariableInitializerIsTypeBad) {
%3 = OpVariable %2 Input %2)";
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 2[%_ptr_Input_uint] "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand '2[%_ptr_Input_uint]' "
"cannot be a type"));
}
@@ -2702,7 +2702,7 @@ TEST_F(ValidateIdWithMessage, OpLoadPointerBad) {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
// Prove that SSA checks trigger for a bad Id value.
// The next test case show the not-a-logical-pointer case.
- EXPECT_THAT(getDiagnosticString(), HasSubstr("ID 8[%8] has not been "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("ID '8[%8]' has not been "
"defined"));
}
@@ -3153,7 +3153,7 @@ TEST_F(ValidateIdWithMessage, OpStoreLabel) {
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 7[%7] requires a type"));
+ HasSubstr("Operand '7[%7]' requires a type"));
}
// TODO: enable when this bug is fixed:
@@ -3730,7 +3730,7 @@ OpFunctionEnd
)";
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 1[%void] cannot be a "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand '1[%void]' cannot be a "
"type"));
}
@@ -3749,7 +3749,7 @@ OpFunctionEnd
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 8[%_ptr_Private_float] cannot be a type"));
+ HasSubstr("Operand '8[%_ptr_Private_float]' cannot be a type"));
}
// Invalid: The storage class of Base and Result do not match.
@@ -4248,7 +4248,7 @@ OpFunctionEnd
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Invalid use of function result id 3[%3]."));
+ HasSubstr("Invalid use of function result id '3[%3]'."));
}
TEST_F(ValidateIdWithMessage, OpFunctionParameterGood) {
@@ -4883,7 +4883,7 @@ OpFunctionEnd
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("ID 3[%true] is not a type "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("ID '3[%true]' is not a type "
"id"));
}
@@ -4996,9 +4996,9 @@ OpFunctionEnd
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("OpPhi's result type <id> 2[%bool] does not match "
- "incoming value <id> 6[%uint_0] type <id> "
- "5[%uint]."));
+ HasSubstr("OpPhi's result type <id> '2[%bool]' does not match "
+ "incoming value <id> '6[%uint_0]' type <id> "
+ "'5[%uint]'."));
}
TEST_F(ValidateIdWithMessage, OpPhiPredecessorNotABlock) {
@@ -5022,9 +5022,10 @@ OpFunctionEnd
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("OpPhi's incoming basic block <id> 3[%true] is not an "
- "OpLabel."));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("OpPhi's incoming basic block <id> '3[%true]' is not an "
+ "OpLabel."));
}
TEST_F(ValidateIdWithMessage, OpPhiNotAPredecessor) {
@@ -5049,8 +5050,8 @@ OpFunctionEnd
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("OpPhi's incoming basic block <id> 9[%9] is not a "
- "predecessor of <id> 8[%8]."));
+ HasSubstr("OpPhi's incoming basic block <id> '9[%9]' is not a "
+ "predecessor of <id> '8[%8]'."));
}
TEST_F(ValidateIdWithMessage, OpBranchConditionalGood) {
@@ -5150,7 +5151,7 @@ OpBranchConditional %bool %target_t %target_f
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 3[%bool] cannot be a "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand '3[%bool]' cannot be a "
"type"));
}
@@ -5213,7 +5214,7 @@ TEST_F(ValidateIdWithMessage, OpReturnValueIsType) {
OpFunctionEnd)";
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 1[%void] cannot be a "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand '1[%void]' cannot be a "
"type"));
}
@@ -5229,7 +5230,7 @@ TEST_F(ValidateIdWithMessage, OpReturnValueIsLabel) {
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 5[%5] requires a type"));
+ HasSubstr("Operand '5[%5]' requires a type"));
}
TEST_F(ValidateIdWithMessage, OpReturnValueIsVoid) {
@@ -5339,7 +5340,7 @@ TEST_F(ValidateIdWithMessage, UndefinedTypeId) {
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 2[%2] requires a previous definition"));
+ HasSubstr("Operand '2[%2]' requires a previous definition"));
}
TEST_F(ValidateIdWithMessage, UndefinedIdScope) {
@@ -5356,7 +5357,7 @@ TEST_F(ValidateIdWithMessage, UndefinedIdScope) {
)";
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("ID 7[%7] has not been "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("ID '7[%7]' has not been "
"defined"));
}
@@ -5374,7 +5375,7 @@ TEST_F(ValidateIdWithMessage, UndefinedIdMemSem) {
)";
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("ID 7[%7] has not been "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("ID '7[%7]' has not been "
"defined"));
}
@@ -5576,11 +5577,10 @@ OpFunctionEnd
)";
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(
- getDiagnosticString(),
- HasSubstr(
- "ID 7[%7] defined in block 6[%6] does not dominate its use in block "
- "9[%9]"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("ID '7[%7]' defined in block '6[%6]' does not dominate "
+ "its use in block "
+ "'9[%9]'"));
}
TEST_F(ValidateIdWithMessage, SpecIdTargetNotSpecializationConstant) {
@@ -5717,7 +5717,7 @@ TEST_F(ValidateIdWithMessage, TypeFunctionBadUse) {
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Invalid use of function type result id 2[%2]."));
+ HasSubstr("Invalid use of function type result id '2[%2]'."));
}
TEST_F(ValidateIdWithMessage, BadTypeId) {
@@ -5735,7 +5735,7 @@ TEST_F(ValidateIdWithMessage, BadTypeId) {
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("ID 4[%float_0] is not a type "
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("ID '4[%float_0]' is not a type "
"id"));
}
@@ -6398,9 +6398,10 @@ OpFunctionEnd
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("ID 8[%8] defined in block 7[%7] does not dominate its "
- "use in block 10[%10]\n %10 = OpLabel"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("ID '8[%8]' defined in block '7[%7]' does not dominate its "
+ "use in block '10[%10]'\n %10 = OpLabel"));
}
TEST_F(ValidateIdWithMessage, IdDefInUnreachableBlock2) {
@@ -6424,9 +6425,10 @@ OpFunctionEnd
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("ID 8[%8] defined in block 7[%7] does not dominate its "
- "use in block 10[%10]\n %10 = OpLabel"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("ID '8[%8]' defined in block '7[%7]' does not dominate its "
+ "use in block '10[%10]'\n %10 = OpLabel"));
}
TEST_F(ValidateIdWithMessage, IdDefInUnreachableBlock3) {
@@ -6450,9 +6452,10 @@ OpFunctionEnd
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("ID 8[%8] defined in block 7[%7] does not dominate its "
- "use in block 10[%10]\n %10 = OpLabel"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("ID '8[%8]' defined in block '7[%7]' does not dominate its "
+ "use in block '10[%10]'\n %10 = OpLabel"));
}
TEST_F(ValidateIdWithMessage, IdDefInUnreachableBlock4) {
@@ -6517,9 +6520,10 @@ OpFunctionEnd
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("ID 9[%9] defined in block 8[%8] does not dominate its "
- "use in block 7[%7]\n %7 = OpLabel"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("ID '9[%9]' defined in block '8[%8]' does not dominate its "
+ "use in block '7[%7]'\n %7 = OpLabel"));
}
TEST_F(ValidateIdWithMessage, ReachableDefUnreachableUse) {
@@ -6570,9 +6574,10 @@ TEST_F(ValidateIdWithMessage, UnreachableDefUsedInPhi) {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("In OpPhi instruction 14[%14], ID 13[%13] definition does not "
- "dominate its parent 7[%7]\n %14 = OpPhi %float %11 %10 %13 "
- "%7"));
+ HasSubstr(
+ "In OpPhi instruction '14[%14]', ID '13[%13]' definition does not "
+ "dominate its parent '7[%7]'\n %14 = OpPhi %float %11 %10 %13 "
+ "%7"));
}
TEST_F(ValidateIdWithMessage, OpTypeForwardPointerNotAPointerType) {
@@ -6638,10 +6643,9 @@ TEST_F(ValidateIdWithMessage, MissingForwardPointer) {
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(
- getDiagnosticString(),
- HasSubstr(
- "Operand 3[%_ptr_Uniform__struct_2] requires a previous definition"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Operand '3[%_ptr_Uniform__struct_2]' requires a "
+ "previous definition"));
}
TEST_F(ValidateIdWithMessage, NVBindlessSamplerInStruct) {
diff --git a/test/val/val_image_test.cpp b/test/val/val_image_test.cpp
index df1402460..a97ef7cb3 100644
--- a/test/val/val_image_test.cpp
+++ b/test/val/val_image_test.cpp
@@ -1125,8 +1125,9 @@ TEST_F(ValidateImage, ImageTexelPointerImageNotResultTypePointer) {
CompileSuccessfully(GenerateShaderCode(body).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 148[%148] cannot be a "
- "type"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Operand '148[%148]' cannot be a "
+ "type"));
}
TEST_F(ValidateImage, ImageTexelPointerImageNotImage) {
diff --git a/test/val/val_interfaces_test.cpp b/test/val/val_interfaces_test.cpp
index d9c3748f1..22a0e7c34 100644
--- a/test/val/val_interfaces_test.cpp
+++ b/test/val/val_interfaces_test.cpp
@@ -217,7 +217,7 @@ OpFunctionEnd
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Non-unique OpEntryPoint interface 2[%var] is disallowed"));
+ HasSubstr("Non-unique OpEntryPoint interface '2[%var]' is disallowed"));
}
TEST_F(ValidateInterfacesTest, MissingGlobalVarSPV1p3) {
diff --git a/test/val/val_memory_test.cpp b/test/val/val_memory_test.cpp
index 35e8af756..4299eda9d 100644
--- a/test/val/val_memory_test.cpp
+++ b/test/val/val_memory_test.cpp
@@ -693,7 +693,7 @@ TEST_F(ValidateMemory, ArrayLenInputNotStruct) {
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("The Struture's type in OpArrayLength <id> '11[%11]' "
+ HasSubstr("The Structure's type in OpArrayLength <id> '11[%11]' "
"must be a pointer to an OpTypeStruct."));
}
@@ -723,7 +723,7 @@ TEST_F(ValidateMemory, ArrayLenInputLastMemberNoRTA) {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("The Struture's last member in OpArrayLength <id> '11[%11]' "
+ HasSubstr("The Structure's last member in OpArrayLength <id> '11[%11]' "
"must be an OpTypeRuntimeArray.\n %11 = OpArrayLength %uint "
"%10 0\n"));
}
@@ -754,7 +754,7 @@ TEST_F(ValidateMemory, ArrayLenInputLastMemberNoRTA2) {
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("The Struture's last member in OpArrayLength <id> '11[%11]' "
+ HasSubstr("The Structure's last member in OpArrayLength <id> '11[%11]' "
"must be an OpTypeRuntimeArray.\n %11 = OpArrayLength %uint "
"%10 1\n"));
}
@@ -818,7 +818,7 @@ TEST_F(ValidateMemory, ArrayLenIndexNotPointerToStruct) {
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
- "The Struture's type in OpArrayLength <id> '12[%12]' must be a "
+ "The Structure's type in OpArrayLength <id> '12[%12]' must be a "
"pointer to an OpTypeStruct.\n %12 = OpArrayLength %uint %11 0\n"));
}
@@ -842,8 +842,9 @@ TEST_F(ValidateMemory, ArrayLenPointerIsAType) {
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Operand 4[%float] cannot be a "
- "type"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Operand '4[%float]' cannot be a "
+ "type"));
}
TEST_F(ValidateMemory, PushConstantNotStructGood) {
@@ -1651,7 +1652,7 @@ OpFunctionEnd
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 1[%incorrect] requires a type"));
+ HasSubstr("Operand '1[%incorrect]' requires a type"));
}
TEST_F(ValidateMemory, PSBLoadAlignedSuccess) {
diff --git a/test/val/val_non_semantic_test.cpp b/test/val/val_non_semantic_test.cpp
index 210cd1ac1..85362fefe 100644
--- a/test/val/val_non_semantic_test.cpp
+++ b/test/val/val_non_semantic_test.cpp
@@ -187,7 +187,7 @@ OpEntryPoint Vertex %main "main"
// there's no specific error for using an OpExtInst too early, it requires a
// type so by definition any use of a type in it will be an undefined ID
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("ID 2[%2] has not been defined"));
+ HasSubstr("ID '2[%2]' has not been defined"));
}
TEST_F(ValidateNonSemanticString, MissingOpExtensionPost1p6) {
diff --git a/test/val/val_ray_query_test.cpp b/test/val/val_ray_query_test.cpp
index 1541c7453..e0eb06758 100644
--- a/test/val/val_ray_query_test.cpp
+++ b/test/val/val_ray_query_test.cpp
@@ -447,7 +447,7 @@ OpRayQueryInitializeKHR %ray_query %load %u32vec2 %u32_0 %f32vec3_0 %f32_0 %f32v
CompileSuccessfully(GenerateShaderCode(body).c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Operand 15[%v2uint] cannot be a type"));
+ HasSubstr("Operand '15[%v2uint]' cannot be a type"));
}
TEST_F(ValidateRayQuery, InitializeBadCullMask) {
diff --git a/test/val/val_ssa_test.cpp b/test/val/val_ssa_test.cpp
index 035c710a2..c22f4ada9 100644
--- a/test/val/val_ssa_test.cpp
+++ b/test/val/val_ssa_test.cpp
@@ -118,7 +118,7 @@ TEST_F(ValidateSSA, DominateUsageWithinBlockBad) {
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- MatchesRegex("ID .\\[%bad\\] has not been defined\n"
+ MatchesRegex("ID '.\\[%bad\\]' has not been defined\n"
" %8 = OpIAdd %uint %uint_1 %bad\n"));
}
@@ -141,7 +141,7 @@ TEST_F(ValidateSSA, DominateUsageSameInstructionBad) {
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- MatchesRegex("ID .\\[%sum\\] has not been defined\n"
+ MatchesRegex("ID '.\\[%sum\\]' has not been defined\n"
" %sum = OpIAdd %uint %uint_1 %sum\n"));
}
@@ -204,7 +204,7 @@ TEST_F(ValidateSSA, ForwardMemberNameMissingTargetBad) {
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("The following forward referenced IDs have not been "
- "defined:\n2[%2]"));
+ "defined:\n'2[%2]'"));
}
TEST_F(ValidateSSA, ForwardDecorateGood) {
@@ -1126,8 +1126,8 @@ TEST_F(ValidateSSA, IdDoesNotDominateItsUseBad) {
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- MatchesRegex("ID .\\[%eleven\\] defined in block .\\[%true_block\\] "
- "does not dominate its use in block .\\[%false_block\\]\n"
+ MatchesRegex("ID '.\\[%eleven\\]' defined in block '.\\[%true_block\\]' "
+ "does not dominate its use in block '.\\[%false_block\\]'\n"
" %false_block = OpLabel\n"));
}
@@ -1187,7 +1187,7 @@ TEST_F(ValidateSSA,
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- MatchesRegex("ID .\\[%inew\\] has not been defined\n"
+ MatchesRegex("ID '.\\[%inew\\]' has not been defined\n"
" %19 = OpIAdd %uint %inew %uint_1\n"));
}
@@ -1268,12 +1268,12 @@ TEST_F(ValidateSSA, PhiVariableDefNotDominatedByParentBlockBad) {
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(
- getDiagnosticString(),
- MatchesRegex("In OpPhi instruction .\\[%phi\\], ID .\\[%true_copy\\] "
- "definition does not dominate its parent .\\[%if_false\\]\n"
- " %phi = OpPhi %bool %true_copy %if_false %false_copy "
- "%if_true\n"));
+ EXPECT_THAT(getDiagnosticString(),
+ MatchesRegex(
+ "In OpPhi instruction '.\\[%phi\\]', ID '.\\[%true_copy\\]' "
+ "definition does not dominate its parent '.\\[%if_false\\]'\n"
+ " %phi = OpPhi %bool %true_copy %if_false %false_copy "
+ "%if_true\n"));
}
TEST_F(ValidateSSA, PhiVariableDefDominatesButNotDefinedInParentBlock) {
@@ -1396,11 +1396,11 @@ TEST_F(ValidateSSA, UseFunctionParameterFromOtherFunctionBad) {
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(
- getDiagnosticString(),
- MatchesRegex("ID .\\[%first\\] used in function .\\[%func2\\] is used "
- "outside of it's defining function .\\[%func\\]\n"
- " %func = OpFunction %void None %14\n"));
+ EXPECT_THAT(getDiagnosticString(),
+ MatchesRegex(
+ "ID '.\\[%first\\]' used in function '.\\[%func2\\]' is used "
+ "outside of it's defining function '.\\[%func\\]'\n"
+ " %func = OpFunction %void None %14\n"));
}
TEST_F(ValidateSSA, TypeForwardPointerForwardReference) {