mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-10-18 11:10:05 +00:00
Remove use of deprecated googletest macro (#2286)
* Remove use of deprecated googletest macro INSTANTIATE_TEST_CASE_P has been deprecated. We need to use INSTANTIATE_TEST_SUITE_P instead. * Remove extra commas from test suites.
This commit is contained in:
parent
7f1a020abc
commit
464111eaef
@ -46,7 +46,7 @@ TEST_P(EncodeStringTest, Sample) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
BinaryEncodeString, EncodeStringTest,
|
BinaryEncodeString, EncodeStringTest,
|
||||||
::testing::ValuesIn(std::vector<EncodeStringCase>{
|
::testing::ValuesIn(std::vector<EncodeStringCase>{
|
||||||
// Use cases that exercise at least one to two words,
|
// Use cases that exercise at least one to two words,
|
||||||
@ -70,7 +70,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// A very long string, encoded after an initial word.
|
// A very long string, encoded after an initial word.
|
||||||
// SPIR-V limits strings to 65535 characters.
|
// SPIR-V limits strings to 65535 characters.
|
||||||
{std::string(65535, 'a'), {1}},
|
{std::string(65535, 'a'), {1}},
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -561,7 +561,7 @@ TEST_P(BinaryParseWordsAndCountDiagnosticTest, WordAndCountCases) {
|
|||||||
EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
|
EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
BinaryParseDiagnostic, BinaryParseWordsAndCountDiagnosticTest,
|
BinaryParseDiagnostic, BinaryParseWordsAndCountDiagnosticTest,
|
||||||
::testing::ValuesIn(std::vector<WordsAndCountDiagnosticCase>{
|
::testing::ValuesIn(std::vector<WordsAndCountDiagnosticCase>{
|
||||||
{nullptr, 0, "Missing module."},
|
{nullptr, 0, "Missing module."},
|
||||||
@ -575,7 +575,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"Module has incomplete header: only 3 words instead of 5"},
|
"Module has incomplete header: only 3 words instead of 5"},
|
||||||
{kHeaderForBound1, 4,
|
{kHeaderForBound1, 4,
|
||||||
"Module has incomplete header: only 4 words instead of 5"},
|
"Module has incomplete header: only 4 words instead of 5"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
// A binary parser diagnostic test case where a vector of words is
|
// A binary parser diagnostic test case where a vector of words is
|
||||||
// provided. We'll use this to express cases that can't be created
|
// provided. We'll use this to express cases that can't be created
|
||||||
@ -598,7 +598,7 @@ TEST_P(BinaryParseWordVectorDiagnosticTest, WordVectorCases) {
|
|||||||
EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
|
EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
BinaryParseDiagnostic, BinaryParseWordVectorDiagnosticTest,
|
BinaryParseDiagnostic, BinaryParseWordVectorDiagnosticTest,
|
||||||
::testing::ValuesIn(std::vector<WordVectorDiagnosticCase>{
|
::testing::ValuesIn(std::vector<WordVectorDiagnosticCase>{
|
||||||
{Concatenate({ExpectedHeaderForBound(1), {spvOpcodeMake(0, SpvOpNop)}}),
|
{Concatenate({ExpectedHeaderForBound(1), {spvOpcodeMake(0, SpvOpNop)}}),
|
||||||
@ -816,7 +816,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
MakeInstruction(SpvOpConstant, {1, 2, 42}),
|
MakeInstruction(SpvOpConstant, {1, 2, 42}),
|
||||||
}),
|
}),
|
||||||
"Type Id 1 is not a scalar numeric type"},
|
"Type Id 1 is not a scalar numeric type"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
// A binary parser diagnostic case generated from an assembly text input.
|
// A binary parser diagnostic case generated from an assembly text input.
|
||||||
struct AssemblyDiagnosticCase {
|
struct AssemblyDiagnosticCase {
|
||||||
@ -836,7 +836,7 @@ TEST_P(BinaryParseAssemblyDiagnosticTest, AssemblyCases) {
|
|||||||
EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
|
EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
BinaryParseDiagnostic, BinaryParseAssemblyDiagnosticTest,
|
BinaryParseDiagnostic, BinaryParseAssemblyDiagnosticTest,
|
||||||
::testing::ValuesIn(std::vector<AssemblyDiagnosticCase>{
|
::testing::ValuesIn(std::vector<AssemblyDiagnosticCase>{
|
||||||
{"%1 = OpConstant !0 42", "Error: Type Id is 0"},
|
{"%1 = OpConstant !0 42", "Error: Type Id is 0"},
|
||||||
@ -886,7 +886,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"Invalid image operand: 32770 has invalid mask component 32768"},
|
"Invalid image operand: 32770 has invalid mask component 32768"},
|
||||||
{"OpSelectionMerge %1 !7",
|
{"OpSelectionMerge %1 !7",
|
||||||
"Invalid selection control operand: 7 has invalid mask component 4"},
|
"Invalid selection control operand: 7 has invalid mask component 4"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
@ -32,7 +32,7 @@ TEST_P(RoundTripLiteralsTest, Sample) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
StringLiterals, RoundTripLiteralsTest,
|
StringLiterals, RoundTripLiteralsTest,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"OpName %1 \"\"\n", // empty
|
"OpName %1 \"\"\n", // empty
|
||||||
@ -49,7 +49,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"OpName %1 \"\\\"foo\nbar\\\"\"\n", // escaped quote
|
"OpName %1 \"\\\"foo\nbar\\\"\"\n", // escaped quote
|
||||||
"OpName %1 \"\\\\foo\nbar\\\\\"\n", // escaped backslash
|
"OpName %1 \"\\\\foo\nbar\\\\\"\n", // escaped backslash
|
||||||
"OpName %1 \"\xE4\xBA\xB2\"\n", // UTF-8
|
"OpName %1 \"\xE4\xBA\xB2\"\n", // UTF-8
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
using RoundTripSpecialCaseLiteralsTest = spvtest::TextToBinaryTestBase<
|
using RoundTripSpecialCaseLiteralsTest = spvtest::TextToBinaryTestBase<
|
||||||
@ -63,13 +63,13 @@ TEST_P(RoundTripSpecialCaseLiteralsTest, Sample) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
StringLiterals, RoundTripSpecialCaseLiteralsTest,
|
StringLiterals, RoundTripSpecialCaseLiteralsTest,
|
||||||
::testing::ValuesIn(std::vector<std::pair<std::string, std::string>>{
|
::testing::ValuesIn(std::vector<std::pair<std::string, std::string>>{
|
||||||
{"OpName %1 \"\\foo\"\n", "OpName %1 \"foo\"\n"}, // Escape f
|
{"OpName %1 \"\\foo\"\n", "OpName %1 \"foo\"\n"}, // Escape f
|
||||||
{"OpName %1 \"\\\nfoo\"\n", "OpName %1 \"\nfoo\"\n"}, // Escape newline
|
{"OpName %1 \"\\\nfoo\"\n", "OpName %1 \"\nfoo\"\n"}, // Escape newline
|
||||||
{"OpName %1 \"\\\xE4\xBA\xB2\"\n", "OpName %1 \"\xE4\xBA\xB2\"\n"}, // Escape utf-8
|
{"OpName %1 \"\\\xE4\xBA\xB2\"\n", "OpName %1 \"\xE4\xBA\xB2\"\n"}, // Escape utf-8
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -171,7 +171,7 @@ TEST_P(BinaryToTextFail, EncodeSuccessfullyDecodeFailed) {
|
|||||||
Eq(GetParam().expected_error_message));
|
Eq(GetParam().expected_error_message));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
InvalidIds, BinaryToTextFail,
|
InvalidIds, BinaryToTextFail,
|
||||||
::testing::ValuesIn(std::vector<FailedDecodeCase>{
|
::testing::ValuesIn(std::vector<FailedDecodeCase>{
|
||||||
{"", spvtest::MakeInstruction(SpvOpTypeVoid, {0}),
|
{"", spvtest::MakeInstruction(SpvOpTypeVoid, {0}),
|
||||||
@ -196,9 +196,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%2 = OpTypeVector %1 4",
|
"%2 = OpTypeVector %1 4",
|
||||||
spvtest::MakeInstruction(SpvOpConstant, {2, 3, 999}),
|
spvtest::MakeInstruction(SpvOpConstant, {2, 3, 999}),
|
||||||
"Type Id 2 is not a scalar numeric type"},
|
"Type Id 2 is not a scalar numeric type"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
InvalidIdsCheckedDuringLiteralCaseParsing, BinaryToTextFail,
|
InvalidIdsCheckedDuringLiteralCaseParsing, BinaryToTextFail,
|
||||||
::testing::ValuesIn(std::vector<FailedDecodeCase>{
|
::testing::ValuesIn(std::vector<FailedDecodeCase>{
|
||||||
{"", spvtest::MakeInstruction(SpvOpSwitch, {1, 2, 3, 4}),
|
{"", spvtest::MakeInstruction(SpvOpSwitch, {1, 2, 3, 4}),
|
||||||
@ -212,7 +212,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"%1 = OpTypeFloat 32\n%2 = OpConstant %1 1.5",
|
{"%1 = OpTypeFloat 32\n%2 = OpConstant %1 1.5",
|
||||||
spvtest::MakeInstruction(SpvOpSwitch, {2, 3, 4, 5}),
|
spvtest::MakeInstruction(SpvOpSwitch, {2, 3, 4, 5}),
|
||||||
"Invalid OpSwitch: selector id 2 is not a scalar integer"},
|
"Invalid OpSwitch: selector id 2 is not a scalar integer"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(TextToBinaryTest, OneInstruction) {
|
TEST_F(TextToBinaryTest, OneInstruction) {
|
||||||
const std::string input = "OpSource OpenCL_C 12\n";
|
const std::string input = "OpSource OpenCL_C 12\n";
|
||||||
@ -243,7 +243,7 @@ TEST_P(RoundTripInstructionsTest, Sample) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
NumericLiterals, RoundTripInstructionsTest,
|
NumericLiterals, RoundTripInstructionsTest,
|
||||||
// This test is independent of environment, so just test the one.
|
// This test is independent of environment, so just test the one.
|
||||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||||
@ -275,10 +275,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.0002p+1024\n", // NaN
|
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.0002p+1024\n", // NaN
|
||||||
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1p+1024\n", // Inf
|
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1p+1024\n", // Inf
|
||||||
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024\n", // -Inf
|
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024\n", // -Inf
|
||||||
})), );
|
})));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
MemoryAccessMasks, RoundTripInstructionsTest,
|
MemoryAccessMasks, RoundTripInstructionsTest,
|
||||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||||
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
||||||
@ -292,9 +292,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"OpStore %1 %2 Volatile|Aligned 16\n",
|
"OpStore %1 %2 Volatile|Aligned 16\n",
|
||||||
"OpStore %1 %2 Volatile|Nontemporal\n",
|
"OpStore %1 %2 Volatile|Nontemporal\n",
|
||||||
"OpStore %1 %2 Volatile|Aligned|Nontemporal 32\n",
|
"OpStore %1 %2 Volatile|Aligned|Nontemporal 32\n",
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
FPFastMathModeMasks, RoundTripInstructionsTest,
|
FPFastMathModeMasks, RoundTripInstructionsTest,
|
||||||
Combine(
|
Combine(
|
||||||
::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||||
@ -310,9 +310,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"OpDecorate %1 FPFastMathMode NotNaN|NotInf\n",
|
"OpDecorate %1 FPFastMathMode NotNaN|NotInf\n",
|
||||||
"OpDecorate %1 FPFastMathMode NSZ|AllowRecip\n",
|
"OpDecorate %1 FPFastMathMode NSZ|AllowRecip\n",
|
||||||
"OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|Fast\n",
|
"OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|Fast\n",
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
LoopControlMasks, RoundTripInstructionsTest,
|
LoopControlMasks, RoundTripInstructionsTest,
|
||||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||||
SPV_ENV_UNIVERSAL_1_3, SPV_ENV_UNIVERSAL_1_2),
|
SPV_ENV_UNIVERSAL_1_3, SPV_ENV_UNIVERSAL_1_2),
|
||||||
@ -321,18 +321,18 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"OpLoopMerge %1 %2 Unroll\n",
|
"OpLoopMerge %1 %2 Unroll\n",
|
||||||
"OpLoopMerge %1 %2 DontUnroll\n",
|
"OpLoopMerge %1 %2 DontUnroll\n",
|
||||||
"OpLoopMerge %1 %2 Unroll|DontUnroll\n",
|
"OpLoopMerge %1 %2 Unroll|DontUnroll\n",
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(LoopControlMasksV11, RoundTripInstructionsTest,
|
INSTANTIATE_TEST_SUITE_P(LoopControlMasksV11, RoundTripInstructionsTest,
|
||||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_1,
|
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_1,
|
||||||
SPV_ENV_UNIVERSAL_1_2,
|
SPV_ENV_UNIVERSAL_1_2,
|
||||||
SPV_ENV_UNIVERSAL_1_3),
|
SPV_ENV_UNIVERSAL_1_3),
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"OpLoopMerge %1 %2 DependencyInfinite\n",
|
"OpLoopMerge %1 %2 DependencyInfinite\n",
|
||||||
"OpLoopMerge %1 %2 DependencyLength 8\n",
|
"OpLoopMerge %1 %2 DependencyLength 8\n",
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SelectionControlMasks, RoundTripInstructionsTest,
|
SelectionControlMasks, RoundTripInstructionsTest,
|
||||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||||
SPV_ENV_UNIVERSAL_1_3, SPV_ENV_UNIVERSAL_1_2),
|
SPV_ENV_UNIVERSAL_1_3, SPV_ENV_UNIVERSAL_1_2),
|
||||||
@ -341,9 +341,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"OpSelectionMerge %1 Flatten\n",
|
"OpSelectionMerge %1 Flatten\n",
|
||||||
"OpSelectionMerge %1 DontFlatten\n",
|
"OpSelectionMerge %1 DontFlatten\n",
|
||||||
"OpSelectionMerge %1 Flatten|DontFlatten\n",
|
"OpSelectionMerge %1 Flatten|DontFlatten\n",
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
FunctionControlMasks, RoundTripInstructionsTest,
|
FunctionControlMasks, RoundTripInstructionsTest,
|
||||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||||
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
||||||
@ -355,9 +355,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%2 = OpFunction %1 Const %3\n",
|
"%2 = OpFunction %1 Const %3\n",
|
||||||
"%2 = OpFunction %1 Inline|Pure|Const %3\n",
|
"%2 = OpFunction %1 Inline|Pure|Const %3\n",
|
||||||
"%2 = OpFunction %1 DontInline|Const %3\n",
|
"%2 = OpFunction %1 DontInline|Const %3\n",
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ImageMasks, RoundTripInstructionsTest,
|
ImageMasks, RoundTripInstructionsTest,
|
||||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||||
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
||||||
@ -378,9 +378,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%2 = OpImageFetch %1 %3 %4 Sample|MinLod %5 %6\n",
|
"%2 = OpImageFetch %1 %3 %4 Sample|MinLod %5 %6\n",
|
||||||
"%2 = OpImageFetch %1 %3 %4"
|
"%2 = OpImageFetch %1 %3 %4"
|
||||||
" Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod"
|
" Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod"
|
||||||
" %5 %6 %7 %8 %9 %10 %11 %12 %13\n"})), );
|
" %5 %6 %7 %8 %9 %10 %11 %12 %13\n"})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
NewInstructionsInSPIRV1_2, RoundTripInstructionsTest,
|
NewInstructionsInSPIRV1_2, RoundTripInstructionsTest,
|
||||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
@ -389,7 +389,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"OpExecutionModeId %1 LocalSizeHintId %2\n",
|
"OpExecutionModeId %1 LocalSizeHintId %2\n",
|
||||||
"OpDecorateId %1 AlignmentId %2\n",
|
"OpDecorateId %1 AlignmentId %2\n",
|
||||||
"OpDecorateId %1 MaxByteOffsetId %2\n",
|
"OpDecorateId %1 MaxByteOffsetId %2\n",
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
using MaskSorting = TextToBinaryTest;
|
using MaskSorting = TextToBinaryTest;
|
||||||
|
|
||||||
@ -537,23 +537,23 @@ TEST_P(GeneratorStringTest, Sample) {
|
|||||||
spvTextDestroy(decoded_text);
|
spvTextDestroy(decoded_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GeneratorStrings, GeneratorStringTest,
|
INSTANTIATE_TEST_SUITE_P(GeneratorStrings, GeneratorStringTest,
|
||||||
::testing::ValuesIn(std::vector<GeneratorStringCase>{
|
::testing::ValuesIn(std::vector<GeneratorStringCase>{
|
||||||
{SPV_GENERATOR_KHRONOS, 12, "Khronos; 12"},
|
{SPV_GENERATOR_KHRONOS, 12, "Khronos; 12"},
|
||||||
{SPV_GENERATOR_LUNARG, 99, "LunarG; 99"},
|
{SPV_GENERATOR_LUNARG, 99, "LunarG; 99"},
|
||||||
{SPV_GENERATOR_VALVE, 1, "Valve; 1"},
|
{SPV_GENERATOR_VALVE, 1, "Valve; 1"},
|
||||||
{SPV_GENERATOR_CODEPLAY, 65535, "Codeplay; 65535"},
|
{SPV_GENERATOR_CODEPLAY, 65535, "Codeplay; 65535"},
|
||||||
{SPV_GENERATOR_NVIDIA, 19, "NVIDIA; 19"},
|
{SPV_GENERATOR_NVIDIA, 19, "NVIDIA; 19"},
|
||||||
{SPV_GENERATOR_ARM, 1000, "ARM; 1000"},
|
{SPV_GENERATOR_ARM, 1000, "ARM; 1000"},
|
||||||
{SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR, 38,
|
{SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR, 38,
|
||||||
"Khronos LLVM/SPIR-V Translator; 38"},
|
"Khronos LLVM/SPIR-V Translator; 38"},
|
||||||
{SPV_GENERATOR_KHRONOS_ASSEMBLER, 2,
|
{SPV_GENERATOR_KHRONOS_ASSEMBLER, 2,
|
||||||
"Khronos SPIR-V Tools Assembler; 2"},
|
"Khronos SPIR-V Tools Assembler; 2"},
|
||||||
{SPV_GENERATOR_KHRONOS_GLSLANG, 1,
|
{SPV_GENERATOR_KHRONOS_GLSLANG, 1,
|
||||||
"Khronos Glslang Reference Front End; 1"},
|
"Khronos Glslang Reference Front End; 1"},
|
||||||
{1000, 18, "Unknown(1000); 18"},
|
{1000, 18, "Unknown(1000); 18"},
|
||||||
{65535, 32767, "Unknown(65535); 32767"},
|
{65535, 32767, "Unknown(65535); 32767"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
// TODO(dneto): Test new instructions and enums in SPIR-V 1.3
|
// TODO(dneto): Test new instructions and enums in SPIR-V 1.3
|
||||||
|
|
||||||
|
@ -817,12 +817,12 @@ OpFunctionEnd
|
|||||||
)");
|
)");
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllMarkvModels, MarkvTest,
|
INSTANTIATE_TEST_SUITE_P(AllMarkvModels, MarkvTest,
|
||||||
::testing::ValuesIn(std::vector<MarkvModelType>{
|
::testing::ValuesIn(std::vector<MarkvModelType>{
|
||||||
kMarkvModelShaderLite,
|
kMarkvModelShaderLite,
|
||||||
kMarkvModelShaderMid,
|
kMarkvModelShaderMid,
|
||||||
kMarkvModelShaderMax,
|
kMarkvModelShaderMax,
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace comp
|
} // namespace comp
|
||||||
|
@ -267,24 +267,24 @@ TEST_P(CapabilitySetForEachTest, OperatorEqualsSelfAssign) {
|
|||||||
EXPECT_THAT(ElementsIn(assigned), Eq(GetParam().expected));
|
EXPECT_THAT(ElementsIn(assigned), Eq(GetParam().expected));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Samples, CapabilitySetForEachTest,
|
INSTANTIATE_TEST_SUITE_P(Samples, CapabilitySetForEachTest,
|
||||||
ValuesIn(std::vector<ForEachCase>{
|
ValuesIn(std::vector<ForEachCase>{
|
||||||
{{}, {}},
|
{{}, {}},
|
||||||
{{SpvCapabilityMatrix}, {SpvCapabilityMatrix}},
|
{{SpvCapabilityMatrix}, {SpvCapabilityMatrix}},
|
||||||
{{SpvCapabilityKernel, SpvCapabilityShader},
|
{{SpvCapabilityKernel, SpvCapabilityShader},
|
||||||
{SpvCapabilityShader, SpvCapabilityKernel}},
|
{SpvCapabilityShader, SpvCapabilityKernel}},
|
||||||
{{static_cast<SpvCapability>(999)},
|
{{static_cast<SpvCapability>(999)},
|
||||||
{static_cast<SpvCapability>(999)}},
|
{static_cast<SpvCapability>(999)}},
|
||||||
{{static_cast<SpvCapability>(0x7fffffff)},
|
{{static_cast<SpvCapability>(0x7fffffff)},
|
||||||
{static_cast<SpvCapability>(0x7fffffff)}},
|
{static_cast<SpvCapability>(0x7fffffff)}},
|
||||||
// Mixture and out of order
|
// Mixture and out of order
|
||||||
{{static_cast<SpvCapability>(0x7fffffff),
|
{{static_cast<SpvCapability>(0x7fffffff),
|
||||||
static_cast<SpvCapability>(100),
|
static_cast<SpvCapability>(100),
|
||||||
SpvCapabilityShader, SpvCapabilityMatrix},
|
SpvCapabilityShader, SpvCapabilityMatrix},
|
||||||
{SpvCapabilityMatrix, SpvCapabilityShader,
|
{SpvCapabilityMatrix, SpvCapabilityShader,
|
||||||
static_cast<SpvCapability>(100),
|
static_cast<SpvCapability>(100),
|
||||||
static_cast<SpvCapability>(0x7fffffff)}},
|
static_cast<SpvCapability>(0x7fffffff)}},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
@ -64,7 +64,7 @@ TEST_P(CapabilityTest, TestCapabilityToString) {
|
|||||||
EXPECT_EQ(capability_str, result_str);
|
EXPECT_EQ(capability_str, result_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
AllExtensions, ExtensionTest,
|
AllExtensions, ExtensionTest,
|
||||||
ValuesIn(std::vector<std::pair<Extension, std::string>>({
|
ValuesIn(std::vector<std::pair<Extension, std::string>>({
|
||||||
{Extension::kSPV_KHR_16bit_storage, "SPV_KHR_16bit_storage"},
|
{Extension::kSPV_KHR_16bit_storage, "SPV_KHR_16bit_storage"},
|
||||||
@ -89,13 +89,13 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{Extension::kSPV_KHR_8bit_storage, "SPV_KHR_8bit_storage"},
|
{Extension::kSPV_KHR_8bit_storage, "SPV_KHR_8bit_storage"},
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(UnknownExtensions, UnknownExtensionTest,
|
INSTANTIATE_TEST_SUITE_P(UnknownExtensions, UnknownExtensionTest,
|
||||||
Values("", "SPV_KHR_", "SPV_KHR_device_group_ERROR",
|
Values("", "SPV_KHR_", "SPV_KHR_device_group_ERROR",
|
||||||
/*alphabetically before all extensions*/ "A",
|
/*alphabetically before all extensions*/ "A",
|
||||||
/*alphabetically after all extensions*/ "Z",
|
/*alphabetically after all extensions*/ "Z",
|
||||||
"SPV_ERROR_random_string_hfsdklhlktherh"));
|
"SPV_ERROR_random_string_hfsdklhlktherh"));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
AllCapabilities, CapabilityTest,
|
AllCapabilities, CapabilityTest,
|
||||||
ValuesIn(std::vector<std::pair<SpvCapability, std::string>>(
|
ValuesIn(std::vector<std::pair<SpvCapability, std::string>>(
|
||||||
{{SpvCapabilityMatrix, "Matrix"},
|
{{SpvCapabilityMatrix, "Matrix"},
|
||||||
@ -189,7 +189,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"ShaderViewportIndexLayerEXT"},
|
"ShaderViewportIndexLayerEXT"},
|
||||||
{SpvCapabilityShaderViewportMaskNV, "ShaderViewportMaskNV"},
|
{SpvCapabilityShaderViewportMaskNV, "ShaderViewportMaskNV"},
|
||||||
{SpvCapabilityShaderStereoViewNV, "ShaderStereoViewNV"},
|
{SpvCapabilityShaderStereoViewNV, "ShaderStereoViewNV"},
|
||||||
{SpvCapabilityPerViewAttributesNV, "PerViewAttributesNV"}})), );
|
{SpvCapabilityPerViewAttributesNV, "PerViewAttributesNV"}})));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
@ -368,30 +368,30 @@ TEST_P(ExtInstDebugInfoRoundTripTest, ParameterizedExtInst) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DebugInfo 4.1 Absent Debugging Information
|
// DebugInfo 4.1 Absent Debugging Information
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugInfoNone, ExtInstDebugInfoRoundTripTest,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugInfoNone, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_0(InfoNone), // enum value 0
|
CASE_0(InfoNone), // enum value 0
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// DebugInfo 4.2 Compilation Unit
|
// DebugInfo 4.2 Compilation Unit
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugCompilationUnit,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugCompilationUnit,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_ILL(CompilationUnit, 100, 42),
|
CASE_ILL(CompilationUnit, 100, 42),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// DebugInfo 4.3 Type instructions
|
// DebugInfo 4.3 Type instructions
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeBasic, ExtInstDebugInfoRoundTripTest,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeBasic, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IIE(TypeBasic, Unspecified),
|
CASE_IIE(TypeBasic, Unspecified),
|
||||||
CASE_IIE(TypeBasic, Address),
|
CASE_IIE(TypeBasic, Address),
|
||||||
CASE_IIE(TypeBasic, Boolean),
|
CASE_IIE(TypeBasic, Boolean),
|
||||||
CASE_IIE(TypeBasic, Float),
|
CASE_IIE(TypeBasic, Float),
|
||||||
CASE_IIE(TypeBasic, Signed),
|
CASE_IIE(TypeBasic, Signed),
|
||||||
CASE_IIE(TypeBasic, SignedChar),
|
CASE_IIE(TypeBasic, SignedChar),
|
||||||
CASE_IIE(TypeBasic, Unsigned),
|
CASE_IIE(TypeBasic, Unsigned),
|
||||||
CASE_IIE(TypeBasic, UnsignedChar),
|
CASE_IIE(TypeBasic, UnsignedChar),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// The FlagIsPublic is value is (1 << 0) | (1 << 2) which is the same
|
// The FlagIsPublic is value is (1 << 0) | (1 << 2) which is the same
|
||||||
// as the bitwise-OR of FlagIsProtected and FlagIsPrivate.
|
// as the bitwise-OR of FlagIsProtected and FlagIsPrivate.
|
||||||
@ -417,7 +417,7 @@ TEST_F(ExtInstDebugInfoRoundTripTestExplicit, FlagIsPublic) {
|
|||||||
EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(expected)) << input;
|
EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(expected)) << input;
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DebugInfoDebugTypePointer, ExtInstDebugInfoRoundTripTest,
|
DebugInfoDebugTypePointer, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
|
|
||||||
@ -463,49 +463,50 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
uint32_t(DebugInfoFlagIndirectVariable) |
|
uint32_t(DebugInfoFlagIndirectVariable) |
|
||||||
uint32_t(DebugInfoFlagIsOptimized)),
|
uint32_t(DebugInfoFlagIsOptimized)),
|
||||||
|
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeQualifier,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeQualifier,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IE(TypeQualifier, ConstType),
|
CASE_IE(TypeQualifier, ConstType),
|
||||||
CASE_IE(TypeQualifier, VolatileType),
|
CASE_IE(TypeQualifier, VolatileType),
|
||||||
CASE_IE(TypeQualifier, RestrictType),
|
CASE_IE(TypeQualifier, RestrictType),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeArray, ExtInstDebugInfoRoundTripTest,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeArray, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_II(TypeArray),
|
CASE_II(TypeArray),
|
||||||
CASE_III(TypeArray),
|
CASE_III(TypeArray),
|
||||||
CASE_IIII(TypeArray),
|
CASE_IIII(TypeArray),
|
||||||
CASE_IIIII(TypeArray),
|
CASE_IIIII(TypeArray),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeVector, ExtInstDebugInfoRoundTripTest,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeVector,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
ExtInstDebugInfoRoundTripTest,
|
||||||
CASE_IL(TypeVector, 2),
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IL(TypeVector, 3),
|
CASE_IL(TypeVector, 2),
|
||||||
CASE_IL(TypeVector, 4),
|
CASE_IL(TypeVector, 3),
|
||||||
CASE_IL(TypeVector, 16),
|
CASE_IL(TypeVector, 4),
|
||||||
})), );
|
CASE_IL(TypeVector, 16),
|
||||||
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypedef, ExtInstDebugInfoRoundTripTest,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypedef, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IIILLI(Typedef, 12, 13),
|
CASE_IIILLI(Typedef, 12, 13),
|
||||||
CASE_IIILLI(Typedef, 14, 99),
|
CASE_IIILLI(Typedef, 14, 99),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeFunction,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeFunction,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_I(TypeFunction),
|
CASE_I(TypeFunction),
|
||||||
CASE_II(TypeFunction),
|
CASE_II(TypeFunction),
|
||||||
CASE_III(TypeFunction),
|
CASE_III(TypeFunction),
|
||||||
CASE_IIII(TypeFunction),
|
CASE_IIII(TypeFunction),
|
||||||
CASE_IIIII(TypeFunction),
|
CASE_IIIII(TypeFunction),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DebugInfoDebugTypeEnum, ExtInstDebugInfoRoundTripTest,
|
DebugInfoDebugTypeEnum, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IIILLIIFII(
|
CASE_IIILLIIFII(
|
||||||
@ -518,9 +519,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
uint32_t(DebugInfoFlagStaticMember)),
|
uint32_t(DebugInfoFlagStaticMember)),
|
||||||
CASE_IIILLIIFIIIIII(TypeEnum, 99, 1, "FlagStaticMember",
|
CASE_IIILLIIFIIIIII(TypeEnum, 99, 1, "FlagStaticMember",
|
||||||
uint32_t(DebugInfoFlagStaticMember)),
|
uint32_t(DebugInfoFlagStaticMember)),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DebugInfoDebugTypeComposite, ExtInstDebugInfoRoundTripTest,
|
DebugInfoDebugTypeComposite, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IEILLIIF(
|
CASE_IEILLIIF(
|
||||||
@ -545,22 +546,22 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
uint32_t(DebugInfoFlagIsPrivate)),
|
uint32_t(DebugInfoFlagIsPrivate)),
|
||||||
CASE_IEILLIIFIIII(TypeComposite, Class, 9, 10, "FlagIsPrivate",
|
CASE_IEILLIIFIIII(TypeComposite, Class, 9, 10, "FlagIsPrivate",
|
||||||
uint32_t(DebugInfoFlagIsPrivate)),
|
uint32_t(DebugInfoFlagIsPrivate)),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeMember, ExtInstDebugInfoRoundTripTest,
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
DebugInfoDebugTypeMember, ExtInstDebugInfoRoundTripTest,
|
||||||
CASE_IIILLIIIF(TypeMember, 12, 13, "FlagIsPrivate",
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
uint32_t(DebugInfoFlagIsPrivate)),
|
CASE_IIILLIIIF(TypeMember, 12, 13, "FlagIsPrivate",
|
||||||
CASE_IIILLIIIF(TypeMember, 99, 100,
|
uint32_t(DebugInfoFlagIsPrivate)),
|
||||||
"FlagIsPrivate|FlagFwdDecl",
|
CASE_IIILLIIIF(TypeMember, 99, 100, "FlagIsPrivate|FlagFwdDecl",
|
||||||
uint32_t(DebugInfoFlagIsPrivate) |
|
uint32_t(DebugInfoFlagIsPrivate) |
|
||||||
uint32_t(DebugInfoFlagFwdDecl)),
|
uint32_t(DebugInfoFlagFwdDecl)),
|
||||||
// Add the optional Id argument.
|
// Add the optional Id argument.
|
||||||
CASE_IIILLIIIFI(TypeMember, 12, 13, "FlagIsPrivate",
|
CASE_IIILLIIIFI(TypeMember, 12, 13, "FlagIsPrivate",
|
||||||
uint32_t(DebugInfoFlagIsPrivate)),
|
uint32_t(DebugInfoFlagIsPrivate)),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DebugInfoDebugTypeInheritance, ExtInstDebugInfoRoundTripTest,
|
DebugInfoDebugTypeInheritance, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IIIIF(TypeInheritance, "FlagIsPrivate",
|
CASE_IIIIF(TypeInheritance, "FlagIsPrivate",
|
||||||
@ -568,53 +569,53 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE_IIIIF(TypeInheritance, "FlagIsPrivate|FlagFwdDecl",
|
CASE_IIIIF(TypeInheritance, "FlagIsPrivate|FlagFwdDecl",
|
||||||
uint32_t(DebugInfoFlagIsPrivate) |
|
uint32_t(DebugInfoFlagIsPrivate) |
|
||||||
uint32_t(DebugInfoFlagFwdDecl)),
|
uint32_t(DebugInfoFlagFwdDecl)),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypePtrToMember,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypePtrToMember,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_II(TypePtrToMember),
|
CASE_II(TypePtrToMember),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// DebugInfo 4.4 Templates
|
// DebugInfo 4.4 Templates
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplate,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplate,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_II(TypeTemplate),
|
CASE_II(TypeTemplate),
|
||||||
CASE_III(TypeTemplate),
|
CASE_III(TypeTemplate),
|
||||||
CASE_IIII(TypeTemplate),
|
CASE_IIII(TypeTemplate),
|
||||||
CASE_IIIII(TypeTemplate),
|
CASE_IIIII(TypeTemplate),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateParameter,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplateParameter,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IIIILL(TypeTemplateParameter, 1, 2),
|
CASE_IIIILL(TypeTemplateParameter, 1, 2),
|
||||||
CASE_IIIILL(TypeTemplateParameter, 99, 102),
|
CASE_IIIILL(TypeTemplateParameter, 99, 102),
|
||||||
CASE_IIIILL(TypeTemplateParameter, 10, 7),
|
CASE_IIIILL(TypeTemplateParameter, 10, 7),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateTemplateParameter,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplateTemplateParameter,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IIILL(TypeTemplateTemplateParameter, 1, 2),
|
CASE_IIILL(TypeTemplateTemplateParameter, 1, 2),
|
||||||
CASE_IIILL(TypeTemplateTemplateParameter, 99, 102),
|
CASE_IIILL(TypeTemplateTemplateParameter, 99, 102),
|
||||||
CASE_IIILL(TypeTemplateTemplateParameter, 10, 7),
|
CASE_IIILL(TypeTemplateTemplateParameter, 10, 7),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateParameterPack,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplateParameterPack,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IILLI(TypeTemplateParameterPack, 1, 2),
|
CASE_IILLI(TypeTemplateParameterPack, 1, 2),
|
||||||
CASE_IILLII(TypeTemplateParameterPack, 99, 102),
|
CASE_IILLII(TypeTemplateParameterPack, 99, 102),
|
||||||
CASE_IILLIII(TypeTemplateParameterPack, 10, 7),
|
CASE_IILLIII(TypeTemplateParameterPack, 10, 7),
|
||||||
CASE_IILLIIII(TypeTemplateParameterPack, 10, 7),
|
CASE_IILLIIII(TypeTemplateParameterPack, 10, 7),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// DebugInfo 4.5 Global Variables
|
// DebugInfo 4.5 Global Variables
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DebugInfoDebugGlobalVariable, ExtInstDebugInfoRoundTripTest,
|
DebugInfoDebugGlobalVariable, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IIILLIIIF(GlobalVariable, 1, 2, "FlagIsOptimized",
|
CASE_IIILLIIIF(GlobalVariable, 1, 2, "FlagIsOptimized",
|
||||||
@ -625,20 +626,20 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
uint32_t(DebugInfoFlagIsOptimized)),
|
uint32_t(DebugInfoFlagIsOptimized)),
|
||||||
CASE_IIILLIIIFI(GlobalVariable, 42, 43, "FlagIsOptimized",
|
CASE_IIILLIIIFI(GlobalVariable, 42, 43, "FlagIsOptimized",
|
||||||
uint32_t(DebugInfoFlagIsOptimized)),
|
uint32_t(DebugInfoFlagIsOptimized)),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// DebugInfo 4.6 Functions
|
// DebugInfo 4.6 Functions
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DebugInfoDebugFunctionDeclaration, ExtInstDebugInfoRoundTripTest,
|
DebugInfoDebugFunctionDeclaration, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IIILLIIF(FunctionDeclaration, 1, 2, "FlagIsOptimized",
|
CASE_IIILLIIF(FunctionDeclaration, 1, 2, "FlagIsOptimized",
|
||||||
uint32_t(DebugInfoFlagIsOptimized)),
|
uint32_t(DebugInfoFlagIsOptimized)),
|
||||||
CASE_IIILLIIF(FunctionDeclaration, 42, 43, "FlagFwdDecl",
|
CASE_IIILLIIF(FunctionDeclaration, 42, 43, "FlagFwdDecl",
|
||||||
uint32_t(DebugInfoFlagFwdDecl)),
|
uint32_t(DebugInfoFlagFwdDecl)),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DebugInfoDebugFunction, ExtInstDebugInfoRoundTripTest,
|
DebugInfoDebugFunction, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IIILLIIFLI(Function, 1, 2, "FlagIsOptimized",
|
CASE_IIILLIIFLI(Function, 1, 2, "FlagIsOptimized",
|
||||||
@ -650,65 +651,65 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
uint32_t(DebugInfoFlagIsOptimized), 3),
|
uint32_t(DebugInfoFlagIsOptimized), 3),
|
||||||
CASE_IIILLIIFLII(Function, 42, 43, "FlagFwdDecl",
|
CASE_IIILLIIFLII(Function, 42, 43, "FlagFwdDecl",
|
||||||
uint32_t(DebugInfoFlagFwdDecl), 44),
|
uint32_t(DebugInfoFlagFwdDecl), 44),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// DebugInfo 4.7 Local Information
|
// DebugInfo 4.7 Local Information
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugLexicalBlock,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugLexicalBlock,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_ILLII(LexicalBlock, 1, 2),
|
CASE_ILLII(LexicalBlock, 1, 2),
|
||||||
CASE_ILLII(LexicalBlock, 42, 43),
|
CASE_ILLII(LexicalBlock, 42, 43),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugLexicalBlockDiscriminator,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugLexicalBlockDiscriminator,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_ILI(LexicalBlockDiscriminator, 1),
|
CASE_ILI(LexicalBlockDiscriminator, 1),
|
||||||
CASE_ILI(LexicalBlockDiscriminator, 42),
|
CASE_ILI(LexicalBlockDiscriminator, 42),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugScope, ExtInstDebugInfoRoundTripTest,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugScope, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_I(Scope),
|
CASE_I(Scope),
|
||||||
CASE_II(Scope),
|
CASE_II(Scope),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugNoScope, ExtInstDebugInfoRoundTripTest,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugNoScope, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_0(NoScope),
|
CASE_0(NoScope),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugInlinedAt, ExtInstDebugInfoRoundTripTest,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugInlinedAt, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_LII(InlinedAt, 1),
|
CASE_LII(InlinedAt, 1),
|
||||||
CASE_LII(InlinedAt, 42),
|
CASE_LII(InlinedAt, 42),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// DebugInfo 4.8 Local Variables
|
// DebugInfo 4.8 Local Variables
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugLocalVariable,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugLocalVariable,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_IIILLI(LocalVariable, 1, 2),
|
CASE_IIILLI(LocalVariable, 1, 2),
|
||||||
CASE_IIILLI(LocalVariable, 42, 43),
|
CASE_IIILLI(LocalVariable, 42, 43),
|
||||||
CASE_IIILLIL(LocalVariable, 1, 2, 3),
|
CASE_IIILLIL(LocalVariable, 1, 2, 3),
|
||||||
CASE_IIILLIL(LocalVariable, 42, 43, 44),
|
CASE_IIILLIL(LocalVariable, 42, 43, 44),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugInlinedVariable,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugInlinedVariable,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_II(InlinedVariable),
|
CASE_II(InlinedVariable),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugDeclare,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugDebugDeclare,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_III(Declare),
|
CASE_III(Declare),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DebugInfoDebugDebugValue, ExtInstDebugInfoRoundTripTest,
|
DebugInfoDebugDebugValue, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_III(Value),
|
CASE_III(Value),
|
||||||
@ -717,53 +718,54 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE_IIIIII(Value),
|
CASE_IIIIII(Value),
|
||||||
// Test up to 4 id parameters. We can always try more.
|
// Test up to 4 id parameters. We can always try more.
|
||||||
CASE_IIIIIII(Value),
|
CASE_IIIIIII(Value),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugOperation,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugDebugOperation,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_E(Operation, Deref),
|
CASE_E(Operation, Deref),
|
||||||
CASE_E(Operation, Plus),
|
CASE_E(Operation, Plus),
|
||||||
CASE_E(Operation, Minus),
|
CASE_E(Operation, Minus),
|
||||||
CASE_EL(Operation, PlusUconst, 1),
|
CASE_EL(Operation, PlusUconst, 1),
|
||||||
CASE_EL(Operation, PlusUconst, 42),
|
CASE_EL(Operation, PlusUconst, 42),
|
||||||
CASE_ELL(Operation, BitPiece, 1, 2),
|
CASE_ELL(Operation, BitPiece, 1, 2),
|
||||||
CASE_ELL(Operation, BitPiece, 4, 5),
|
CASE_ELL(Operation, BitPiece, 4, 5),
|
||||||
CASE_E(Operation, Swap),
|
CASE_E(Operation, Swap),
|
||||||
CASE_E(Operation, Xderef),
|
CASE_E(Operation, Xderef),
|
||||||
CASE_E(Operation, StackValue),
|
CASE_E(Operation, StackValue),
|
||||||
CASE_EL(Operation, Constu, 1),
|
CASE_EL(Operation, Constu, 1),
|
||||||
CASE_EL(Operation, Constu, 42),
|
CASE_EL(Operation, Constu, 42),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugExpression,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugDebugExpression,
|
||||||
ExtInstDebugInfoRoundTripTest,
|
ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_0(Expression),
|
CASE_0(Expression),
|
||||||
CASE_I(Expression),
|
CASE_I(Expression),
|
||||||
CASE_II(Expression),
|
CASE_II(Expression),
|
||||||
CASE_III(Expression),
|
CASE_III(Expression),
|
||||||
CASE_IIII(Expression),
|
CASE_IIII(Expression),
|
||||||
CASE_IIIII(Expression),
|
CASE_IIIII(Expression),
|
||||||
CASE_IIIIII(Expression),
|
CASE_IIIIII(Expression),
|
||||||
CASE_IIIIIII(Expression),
|
CASE_IIIIIII(Expression),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// DebugInfo 4.9 Macros
|
// DebugInfo 4.9 Macros
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugMacroDef, ExtInstDebugInfoRoundTripTest,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugMacroDef, ExtInstDebugInfoRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_ILI(MacroDef, 1),
|
CASE_ILI(MacroDef, 1),
|
||||||
CASE_ILI(MacroDef, 42),
|
CASE_ILI(MacroDef, 42),
|
||||||
CASE_ILII(MacroDef, 1),
|
CASE_ILII(MacroDef, 1),
|
||||||
CASE_ILII(MacroDef, 42),
|
CASE_ILII(MacroDef, 42),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugMacroUndef, ExtInstDebugInfoRoundTripTest,
|
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugMacroUndef,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
ExtInstDebugInfoRoundTripTest,
|
||||||
CASE_ILI(MacroUndef, 1),
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE_ILI(MacroUndef, 42),
|
CASE_ILI(MacroUndef, 1),
|
||||||
})), );
|
CASE_ILI(MacroUndef, 42),
|
||||||
|
})));
|
||||||
|
|
||||||
#undef CASE_0
|
#undef CASE_0
|
||||||
#undef CASE_ILL
|
#undef CASE_ILL
|
||||||
|
@ -106,7 +106,7 @@ OpFunctionEnd
|
|||||||
spvContextDestroy(context);
|
spvContextDestroy(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ExtInstParameters, ExtInstGLSLstd450RoundTripTest,
|
ExtInstParameters, ExtInstGLSLstd450RoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<ExtInstContext>({
|
::testing::ValuesIn(std::vector<ExtInstContext>({
|
||||||
// We are only testing the correctness of encoding and decoding here.
|
// We are only testing the correctness of encoding and decoding here.
|
||||||
@ -198,7 +198,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"NMin", "%5 %5", 79, 7, {5, 5}},
|
{"NMin", "%5 %5", 79, 7, {5, 5}},
|
||||||
{"NMax", "%5 %5", 80, 7, {5, 5}},
|
{"NMax", "%5 %5", 80, 7, {5, 5}},
|
||||||
{"NClamp", "%5 %5 %5", 81, 8, {5, 5, 5}},
|
{"NClamp", "%5 %5 %5", 81, 8, {5, 5, 5}},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
@ -90,7 +90,7 @@ TEST_P(ExtInstOpenCLStdRoundTripTest, ParameterizedExtInst) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// OpenCL.std: 2.1 Math extended instructions
|
// OpenCL.std: 2.1 Math extended instructions
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpenCLMath, ExtInstOpenCLStdRoundTripTest,
|
OpenCLMath, ExtInstOpenCLStdRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
// We are only testing the correctness of encoding and decoding here.
|
// We are only testing the correctness of encoding and decoding here.
|
||||||
@ -190,10 +190,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(Native_sin, native_sin),
|
CASE1(Native_sin, native_sin),
|
||||||
CASE1(Native_sqrt, native_sqrt),
|
CASE1(Native_sqrt, native_sqrt),
|
||||||
CASE1(Native_tan, native_tan), // enum value 94
|
CASE1(Native_tan, native_tan), // enum value 94
|
||||||
})),);
|
})));
|
||||||
|
|
||||||
// OpenCL.std: 2.1 Integer instructions
|
// OpenCL.std: 2.1 Integer instructions
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpenCLInteger, ExtInstOpenCLStdRoundTripTest,
|
OpenCLInteger, ExtInstOpenCLStdRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE1(SAbs, s_abs), // enum value 141
|
CASE1(SAbs, s_abs), // enum value 141
|
||||||
@ -230,10 +230,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE2(UAbs_diff, u_abs_diff),
|
CASE2(UAbs_diff, u_abs_diff),
|
||||||
CASE2(UMul_hi, u_mul_hi),
|
CASE2(UMul_hi, u_mul_hi),
|
||||||
CASE3(UMad_hi, u_mad_hi), // enum value 204
|
CASE3(UMad_hi, u_mad_hi), // enum value 204
|
||||||
})),);
|
})));
|
||||||
|
|
||||||
// OpenCL.std: 2.3 Common instrucitons
|
// OpenCL.std: 2.3 Common instrucitons
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpenCLCommon, ExtInstOpenCLStdRoundTripTest,
|
OpenCLCommon, ExtInstOpenCLStdRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE3(FClamp, fclamp), // enum value 95
|
CASE3(FClamp, fclamp), // enum value 95
|
||||||
@ -245,10 +245,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE2(Step, step),
|
CASE2(Step, step),
|
||||||
CASE3(Smoothstep, smoothstep),
|
CASE3(Smoothstep, smoothstep),
|
||||||
CASE1(Sign, sign), // enum value 103
|
CASE1(Sign, sign), // enum value 103
|
||||||
})),);
|
})));
|
||||||
|
|
||||||
// OpenCL.std: 2.4 Geometric instructions
|
// OpenCL.std: 2.4 Geometric instructions
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpenCLGeometric, ExtInstOpenCLStdRoundTripTest,
|
OpenCLGeometric, ExtInstOpenCLStdRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE2(Cross, cross), // enum value 104
|
CASE2(Cross, cross), // enum value 104
|
||||||
@ -258,18 +258,18 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE2(Fast_distance, fast_distance),
|
CASE2(Fast_distance, fast_distance),
|
||||||
CASE1(Fast_length, fast_length),
|
CASE1(Fast_length, fast_length),
|
||||||
CASE1(Fast_normalize, fast_normalize), // enum value 110
|
CASE1(Fast_normalize, fast_normalize), // enum value 110
|
||||||
})),);
|
})));
|
||||||
|
|
||||||
// OpenCL.std: 2.5 Relational instructions
|
// OpenCL.std: 2.5 Relational instructions
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpenCLRelational, ExtInstOpenCLStdRoundTripTest,
|
OpenCLRelational, ExtInstOpenCLStdRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE3(Bitselect, bitselect), // enum value 186
|
CASE3(Bitselect, bitselect), // enum value 186
|
||||||
CASE3(Select, select), // enum value 187
|
CASE3(Select, select), // enum value 187
|
||||||
})),);
|
})));
|
||||||
|
|
||||||
// OpenCL.std: 2.6 Vector data load and store instructions
|
// OpenCL.std: 2.6 Vector data load and store instructions
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpenCLVectorLoadStore, ExtInstOpenCLStdRoundTripTest,
|
OpenCLVectorLoadStore, ExtInstOpenCLStdRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
// The last argument to Vloadn must be one of 2, 3, 4, 8, 16.
|
// The last argument to Vloadn must be one of 2, 3, 4, 8, 16.
|
||||||
@ -306,20 +306,20 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTZ),
|
CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTZ),
|
||||||
CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTP),
|
CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTP),
|
||||||
CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTN),
|
CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTN),
|
||||||
})),);
|
})));
|
||||||
|
|
||||||
// OpenCL.std: 2.7 Miscellaneous vector instructions
|
// OpenCL.std: 2.7 Miscellaneous vector instructions
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpenCLMiscellaneousVector, ExtInstOpenCLStdRoundTripTest,
|
OpenCLMiscellaneousVector, ExtInstOpenCLStdRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE2(Shuffle, shuffle),
|
CASE2(Shuffle, shuffle),
|
||||||
CASE3(Shuffle2, shuffle2),
|
CASE3(Shuffle2, shuffle2),
|
||||||
})),);
|
})));
|
||||||
|
|
||||||
// OpenCL.std: 2.8 Miscellaneous instructions
|
// OpenCL.std: 2.8 Miscellaneous instructions
|
||||||
|
|
||||||
#define PREFIX uint32_t(OpenCLLIB::Entrypoints::Printf), "printf"
|
#define PREFIX uint32_t(OpenCLLIB::Entrypoints::Printf), "printf"
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpenCLMiscPrintf, ExtInstOpenCLStdRoundTripTest,
|
OpenCLMiscPrintf, ExtInstOpenCLStdRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
// Printf is interesting because it takes a variable number of arguments.
|
// Printf is interesting because it takes a variable number of arguments.
|
||||||
@ -338,14 +338,14 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{4, 5, 6, 7, 8, 9, 10, 11, 12, 13}},
|
{4, 5, 6, 7, 8, 9, 10, 11, 12, 13}},
|
||||||
{PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14",
|
{PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14",
|
||||||
{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}},
|
{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}},
|
||||||
})),);
|
})));
|
||||||
#undef PREFIX
|
#undef PREFIX
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpenCLMiscPrefetch, ExtInstOpenCLStdRoundTripTest,
|
OpenCLMiscPrefetch, ExtInstOpenCLStdRoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||||
CASE2(Prefetch, prefetch),
|
CASE2(Prefetch, prefetch),
|
||||||
})),);
|
})));
|
||||||
|
|
||||||
// OpenCL.std: 2.9.1 Image encoding
|
// OpenCL.std: 2.9.1 Image encoding
|
||||||
// No new instructions defined in this section.
|
// No new instructions defined in this section.
|
||||||
|
@ -34,7 +34,7 @@ TEST_P(GeneratorMagicNumberTest, Single) {
|
|||||||
GetParam().name());
|
GetParam().name());
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Registered, GeneratorMagicNumberTest,
|
Registered, GeneratorMagicNumberTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<spv_generator_t>>{
|
::testing::ValuesIn(std::vector<EnumCase<spv_generator_t>>{
|
||||||
{SPV_GENERATOR_KHRONOS, "Khronos"},
|
{SPV_GENERATOR_KHRONOS, "Khronos"},
|
||||||
@ -47,16 +47,16 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"Khronos LLVM/SPIR-V Translator"},
|
"Khronos LLVM/SPIR-V Translator"},
|
||||||
{SPV_GENERATOR_KHRONOS_ASSEMBLER, "Khronos SPIR-V Tools Assembler"},
|
{SPV_GENERATOR_KHRONOS_ASSEMBLER, "Khronos SPIR-V Tools Assembler"},
|
||||||
{SPV_GENERATOR_KHRONOS_GLSLANG, "Khronos Glslang Reference Front End"},
|
{SPV_GENERATOR_KHRONOS_GLSLANG, "Khronos Glslang Reference Front End"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Unregistered, GeneratorMagicNumberTest,
|
Unregistered, GeneratorMagicNumberTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<spv_generator_t>>{
|
::testing::ValuesIn(std::vector<EnumCase<spv_generator_t>>{
|
||||||
// We read registered entries from the SPIR-V XML Registry file
|
// We read registered entries from the SPIR-V XML Registry file
|
||||||
// which can change over time.
|
// which can change over time.
|
||||||
{spv_generator_t(1000), "Unknown"},
|
{spv_generator_t(1000), "Unknown"},
|
||||||
{spv_generator_t(9999), "Unknown"},
|
{spv_generator_t(9999), "Unknown"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
@ -81,7 +81,7 @@ TEST_P(HexDoubleTest, DecodeCorrectly) {
|
|||||||
EXPECT_THAT(Decode<double>(GetParam().second), Eq(GetParam().first));
|
EXPECT_THAT(Decode<double>(GetParam().second), Eq(GetParam().first));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float32Tests, HexFloatTest,
|
Float32Tests, HexFloatTest,
|
||||||
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
|
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
|
||||||
{0.f, "0x0p+0"},
|
{0.f, "0x0p+0"},
|
||||||
@ -131,9 +131,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{float(ldexp(1.0, -127) / 2.0 + (ldexp(1.0, -127) / 4.0f)),
|
{float(ldexp(1.0, -127) / 2.0 + (ldexp(1.0, -127) / 4.0f)),
|
||||||
"0x1.8p-128"},
|
"0x1.8p-128"},
|
||||||
|
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float32NanTests, HexFloatTest,
|
Float32NanTests, HexFloatTest,
|
||||||
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
|
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
|
||||||
// Various NAN and INF cases
|
// Various NAN and INF cases
|
||||||
@ -149,9 +149,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{uint32_t(0x7f800c00), "0x1.0018p+128"}, // +nan
|
{uint32_t(0x7f800c00), "0x1.0018p+128"}, // +nan
|
||||||
{uint32_t(0x7F80F000), "0x1.01ep+128"}, // +nan
|
{uint32_t(0x7F80F000), "0x1.01ep+128"}, // +nan
|
||||||
{uint32_t(0x7FFFFFFF), "0x1.fffffep+128"}, // +nan
|
{uint32_t(0x7FFFFFFF), "0x1.fffffep+128"}, // +nan
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float64Tests, HexDoubleTest,
|
Float64Tests, HexDoubleTest,
|
||||||
::testing::ValuesIn(
|
::testing::ValuesIn(
|
||||||
std::vector<std::pair<FloatProxy<double>, std::string>>({
|
std::vector<std::pair<FloatProxy<double>, std::string>>({
|
||||||
@ -222,9 +222,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{ldexp(1.0, -1023) / 2.0 + (ldexp(1.0, -1023) / 4.0),
|
{ldexp(1.0, -1023) / 2.0 + (ldexp(1.0, -1023) / 4.0),
|
||||||
"0x1.8p-1024"},
|
"0x1.8p-1024"},
|
||||||
|
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float64NanTests, HexDoubleTest,
|
Float64NanTests, HexDoubleTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
std::pair<FloatProxy<double>, std::string>>({
|
std::pair<FloatProxy<double>, std::string>>({
|
||||||
@ -241,7 +241,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{uint64_t(0x7FF0000000000001LL), "0x1.0000000000001p+1024"}, // -nan
|
{uint64_t(0x7FF0000000000001LL), "0x1.0000000000001p+1024"}, // -nan
|
||||||
{uint64_t(0x7FF0000300000000LL), "0x1.00003p+1024"}, // -nan
|
{uint64_t(0x7FF0000300000000LL), "0x1.00003p+1024"}, // -nan
|
||||||
{uint64_t(0x7FFFFFFFFFFFFFFFLL), "0x1.fffffffffffffp+1024"}, // -nan
|
{uint64_t(0x7FFFFFFFFFFFFFFFLL), "0x1.fffffffffffffp+1024"}, // -nan
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// Tests that encoding a value and decoding it again restores
|
// Tests that encoding a value and decoding it again restores
|
||||||
// the same value.
|
// the same value.
|
||||||
@ -263,14 +263,14 @@ TEST_P(RoundTripDoubleTest, CanStoreAccurately) {
|
|||||||
EXPECT_THAT(GetParam(), Eq(res.getAsFloat()));
|
EXPECT_THAT(GetParam(), Eq(res.getAsFloat()));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float32StoreTests, RoundTripFloatTest,
|
Float32StoreTests, RoundTripFloatTest,
|
||||||
::testing::ValuesIn(std::vector<float>(
|
::testing::ValuesIn(std::vector<float>(
|
||||||
{// Value requiring more than 6 digits of precision to be
|
{// Value requiring more than 6 digits of precision to be
|
||||||
// represented accurately.
|
// represented accurately.
|
||||||
3.0000002f})));
|
3.0000002f})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float64StoreTests, RoundTripDoubleTest,
|
Float64StoreTests, RoundTripDoubleTest,
|
||||||
::testing::ValuesIn(std::vector<double>(
|
::testing::ValuesIn(std::vector<double>(
|
||||||
{// Value requiring more than 15 digits of precision to be
|
{// Value requiring more than 15 digits of precision to be
|
||||||
@ -300,7 +300,7 @@ TEST_P(DecodeHexDoubleTest, DecodeCorrectly) {
|
|||||||
EXPECT_THAT(Decode<double>(GetParam().first), Eq(GetParam().second));
|
EXPECT_THAT(Decode<double>(GetParam().first), Eq(GetParam().second));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float32DecodeTests, DecodeHexFloatTest,
|
Float32DecodeTests, DecodeHexFloatTest,
|
||||||
::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
|
::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
|
||||||
{"0x0p+000", 0.f},
|
{"0x0p+000", 0.f},
|
||||||
@ -320,9 +320,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"0xFFp+0", 255.f},
|
{"0xFFp+0", 255.f},
|
||||||
{"0x0.8p+0", 0.5f},
|
{"0x0.8p+0", 0.5f},
|
||||||
{"0x0.4p+0", 0.25f},
|
{"0x0.4p+0", 0.25f},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float32DecodeInfTests, DecodeHexFloatTest,
|
Float32DecodeInfTests, DecodeHexFloatTest,
|
||||||
::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
|
::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
|
||||||
// inf cases
|
// inf cases
|
||||||
@ -330,9 +330,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"0x32p+127", uint32_t(0x7F800000)}, // inf
|
{"0x32p+127", uint32_t(0x7F800000)}, // inf
|
||||||
{"0x32p+500", uint32_t(0x7F800000)}, // inf
|
{"0x32p+500", uint32_t(0x7F800000)}, // inf
|
||||||
{"-0x32p+127", uint32_t(0xFF800000)}, // -inf
|
{"-0x32p+127", uint32_t(0xFF800000)}, // -inf
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float64DecodeTests, DecodeHexDoubleTest,
|
Float64DecodeTests, DecodeHexDoubleTest,
|
||||||
::testing::ValuesIn(
|
::testing::ValuesIn(
|
||||||
std::vector<std::pair<std::string, FloatProxy<double>>>({
|
std::vector<std::pair<std::string, FloatProxy<double>>>({
|
||||||
@ -353,9 +353,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"0xFFp+0", 255.},
|
{"0xFFp+0", 255.},
|
||||||
{"0x0.8p+0", 0.5},
|
{"0x0.8p+0", 0.5},
|
||||||
{"0x0.4p+0", 0.25},
|
{"0x0.4p+0", 0.25},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float64DecodeInfTests, DecodeHexDoubleTest,
|
Float64DecodeInfTests, DecodeHexDoubleTest,
|
||||||
::testing::ValuesIn(
|
::testing::ValuesIn(
|
||||||
std::vector<std::pair<std::string, FloatProxy<double>>>({
|
std::vector<std::pair<std::string, FloatProxy<double>>>({
|
||||||
@ -364,7 +364,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"0x32p+1023", uint64_t(0x7FF0000000000000)}, // inf
|
{"0x32p+1023", uint64_t(0x7FF0000000000000)}, // inf
|
||||||
{"0x32p+5000", uint64_t(0x7FF0000000000000)}, // inf
|
{"0x32p+5000", uint64_t(0x7FF0000000000000)}, // inf
|
||||||
{"-0x32p+1023", uint64_t(0xFFF0000000000000)}, // -inf
|
{"-0x32p+1023", uint64_t(0xFFF0000000000000)}, // -inf
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
TEST(FloatProxy, ValidConversion) {
|
TEST(FloatProxy, ValidConversion) {
|
||||||
EXPECT_THAT(FloatProxy<float>(1.f).getAsFloat(), Eq(1.0f));
|
EXPECT_THAT(FloatProxy<float>(1.f).getAsFloat(), Eq(1.0f));
|
||||||
@ -503,7 +503,7 @@ TEST_P(FloatProxyDoubleTest, EncodeCorrectly) {
|
|||||||
Eq(GetParam().second));
|
Eq(GetParam().second));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float32Tests, FloatProxyFloatTest,
|
Float32Tests, FloatProxyFloatTest,
|
||||||
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
|
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
|
||||||
// Zero
|
// Zero
|
||||||
@ -533,9 +533,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
|
|
||||||
{std::numeric_limits<float>::infinity(), "0x1p+128"},
|
{std::numeric_limits<float>::infinity(), "0x1p+128"},
|
||||||
{-std::numeric_limits<float>::infinity(), "-0x1p+128"},
|
{-std::numeric_limits<float>::infinity(), "-0x1p+128"},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float64Tests, FloatProxyDoubleTest,
|
Float64Tests, FloatProxyDoubleTest,
|
||||||
::testing::ValuesIn(
|
::testing::ValuesIn(
|
||||||
std::vector<std::pair<FloatProxy<double>, std::string>>({
|
std::vector<std::pair<FloatProxy<double>, std::string>>({
|
||||||
@ -570,7 +570,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{std::numeric_limits<double>::infinity(), "0x1p+1024"},
|
{std::numeric_limits<double>::infinity(), "0x1p+1024"},
|
||||||
{-std::numeric_limits<double>::infinity(), "-0x1p+1024"},
|
{-std::numeric_limits<double>::infinity(), "-0x1p+1024"},
|
||||||
|
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// double is used so that unbiased_exponent can be used with the output
|
// double is used so that unbiased_exponent can be used with the output
|
||||||
// of ldexp directly.
|
// of ldexp directly.
|
||||||
@ -792,7 +792,7 @@ TEST_P(HexFloatRoundTest, RoundDownToFP16) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatRoundTest,
|
INSTANTIATE_TEST_SUITE_P(F32ToF16, HexFloatRoundTest,
|
||||||
::testing::ValuesIn(std::vector<RoundSignificandCase>(
|
::testing::ValuesIn(std::vector<RoundSignificandCase>(
|
||||||
{
|
{
|
||||||
{float_fractions({0}), std::make_pair(half_bits_set({}), false), RD::kToZero},
|
{float_fractions({0}), std::make_pair(half_bits_set({}), false), RD::kToZero},
|
||||||
@ -838,7 +838,7 @@ INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatRoundTest,
|
|||||||
{static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -129)), std::make_pair(half_bits_set({0, 9}), false), RD::kToPositiveInfinity},
|
{static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -129)), std::make_pair(half_bits_set({0, 9}), false), RD::kToPositiveInfinity},
|
||||||
{static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -131)), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity},
|
{static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -131)), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity},
|
||||||
{static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -130)), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven},
|
{static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -130)), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven},
|
||||||
})),);
|
})));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
struct UpCastSignificandCase {
|
struct UpCastSignificandCase {
|
||||||
@ -872,7 +872,7 @@ TEST_P(HexFloatRoundUpSignificandTest, Widening) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
F16toF32, HexFloatRoundUpSignificandTest,
|
F16toF32, HexFloatRoundUpSignificandTest,
|
||||||
// 0xFC00 of the source 16-bit hex value cover the sign and the exponent.
|
// 0xFC00 of the source 16-bit hex value cover the sign and the exponent.
|
||||||
// They are ignored for this test.
|
// They are ignored for this test.
|
||||||
@ -881,7 +881,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{0x0F00, 0x600000},
|
{0x0F00, 0x600000},
|
||||||
{0x0F01, 0x602000},
|
{0x0F01, 0x602000},
|
||||||
{0x0FFF, 0x7FE000},
|
{0x0FFF, 0x7FE000},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
struct DownCastTest {
|
struct DownCastTest {
|
||||||
float source_float;
|
float source_float;
|
||||||
@ -923,7 +923,7 @@ TEST_P(HexFloatFP32To16Tests, NarrowingCasts) {
|
|||||||
const uint16_t positive_infinity = 0x7C00;
|
const uint16_t positive_infinity = 0x7C00;
|
||||||
const uint16_t negative_infinity = 0xFC00;
|
const uint16_t negative_infinity = 0xFC00;
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
F32ToF16, HexFloatFP32To16Tests,
|
F32ToF16, HexFloatFP32To16Tests,
|
||||||
::testing::ValuesIn(std::vector<DownCastTest>({
|
::testing::ValuesIn(std::vector<DownCastTest>({
|
||||||
// Exactly representable as half.
|
// Exactly representable as half.
|
||||||
@ -1014,7 +1014,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
RD::kToNearestEven}},
|
RD::kToNearestEven}},
|
||||||
|
|
||||||
// Nans are below because we cannot test for equality.
|
// Nans are below because we cannot test for equality.
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
struct UpCastCase {
|
struct UpCastCase {
|
||||||
uint16_t source_half;
|
uint16_t source_half;
|
||||||
@ -1043,7 +1043,7 @@ TEST_P(HexFloatFP16To32Tests, WideningCasts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
F16ToF32, HexFloatFP16To32Tests,
|
F16ToF32, HexFloatFP16To32Tests,
|
||||||
::testing::ValuesIn(std::vector<UpCastCase>({
|
::testing::ValuesIn(std::vector<UpCastCase>({
|
||||||
{0x0000, 0.f},
|
{0x0000, 0.f},
|
||||||
@ -1064,7 +1064,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// inf
|
// inf
|
||||||
{0x7C00, std::numeric_limits<float>::infinity()},
|
{0x7C00, std::numeric_limits<float>::infinity()},
|
||||||
{0xFC00, -std::numeric_limits<float>::infinity()},
|
{0xFC00, -std::numeric_limits<float>::infinity()},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
TEST(HexFloatOperationTests, NanTests) {
|
TEST(HexFloatOperationTests, NanTests) {
|
||||||
using HF = HexFloat<FloatProxy<float>>;
|
using HF = HexFloat<FloatProxy<float>>;
|
||||||
@ -1137,7 +1137,7 @@ FloatParseCase<T> GoodFloatParseCase(std::string literal, bool negate_value,
|
|||||||
return FloatParseCase<T>{literal, negate_value, true, proxy_expected_value};
|
return FloatParseCase<T>{literal, negate_value, true, proxy_expected_value};
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
FloatParse, ParseNormalFloatTest,
|
FloatParse, ParseNormalFloatTest,
|
||||||
::testing::ValuesIn(std::vector<FloatParseCase<float>>{
|
::testing::ValuesIn(std::vector<FloatParseCase<float>>{
|
||||||
// Failing cases due to trivially incorrect syntax.
|
// Failing cases due to trivially incorrect syntax.
|
||||||
@ -1169,7 +1169,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// We can't have -1e40 and negate_value == true since
|
// We can't have -1e40 and negate_value == true since
|
||||||
// that represents an original case of "--1e40" which
|
// that represents an original case of "--1e40" which
|
||||||
// is invalid.
|
// is invalid.
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
using ParseNormalFloat16Test =
|
using ParseNormalFloat16Test =
|
||||||
::testing::TestWithParam<FloatParseCase<Float16>>;
|
::testing::TestWithParam<FloatParseCase<Float16>>;
|
||||||
@ -1188,7 +1188,7 @@ TEST_P(ParseNormalFloat16Test, Samples) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float16Parse, ParseNormalFloat16Test,
|
Float16Parse, ParseNormalFloat16Test,
|
||||||
::testing::ValuesIn(std::vector<FloatParseCase<Float16>>{
|
::testing::ValuesIn(std::vector<FloatParseCase<Float16>>{
|
||||||
// Failing cases due to trivially incorrect syntax.
|
// Failing cases due to trivially incorrect syntax.
|
||||||
@ -1212,7 +1212,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
BadFloatParseCase<Float16>("-2.0", true, uint16_t{0}),
|
BadFloatParseCase<Float16>("-2.0", true, uint16_t{0}),
|
||||||
BadFloatParseCase<Float16>("+0.0", true, uint16_t{0}),
|
BadFloatParseCase<Float16>("+0.0", true, uint16_t{0}),
|
||||||
BadFloatParseCase<Float16>("+2.0", true, uint16_t{0}),
|
BadFloatParseCase<Float16>("+2.0", true, uint16_t{0}),
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
// A test case for detecting infinities.
|
// A test case for detecting infinities.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -1235,7 +1235,7 @@ TEST_P(FloatProxyParseOverflowFloatTest, Sample) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
FloatOverflow, FloatProxyParseOverflowFloatTest,
|
FloatOverflow, FloatProxyParseOverflowFloatTest,
|
||||||
::testing::ValuesIn(std::vector<OverflowParseCase<float>>({
|
::testing::ValuesIn(std::vector<OverflowParseCase<float>>({
|
||||||
{"0", true, 0.0f},
|
{"0", true, 0.0f},
|
||||||
@ -1247,7 +1247,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"-1e40", false, -FLT_MAX},
|
{"-1e40", false, -FLT_MAX},
|
||||||
{"1e400", false, FLT_MAX},
|
{"1e400", false, FLT_MAX},
|
||||||
{"-1e400", false, -FLT_MAX},
|
{"-1e400", false, -FLT_MAX},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
using FloatProxyParseOverflowDoubleTest =
|
using FloatProxyParseOverflowDoubleTest =
|
||||||
::testing::TestWithParam<OverflowParseCase<double>>;
|
::testing::TestWithParam<OverflowParseCase<double>>;
|
||||||
@ -1262,7 +1262,7 @@ TEST_P(FloatProxyParseOverflowDoubleTest, Sample) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DoubleOverflow, FloatProxyParseOverflowDoubleTest,
|
DoubleOverflow, FloatProxyParseOverflowDoubleTest,
|
||||||
::testing::ValuesIn(std::vector<OverflowParseCase<double>>({
|
::testing::ValuesIn(std::vector<OverflowParseCase<double>>({
|
||||||
{"0", true, 0.0},
|
{"0", true, 0.0},
|
||||||
@ -1274,7 +1274,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"-1e40", true, -1e40},
|
{"-1e40", true, -1e40},
|
||||||
{"1e400", false, DBL_MAX},
|
{"1e400", false, DBL_MAX},
|
||||||
{"-1e400", false, -DBL_MAX},
|
{"-1e400", false, -DBL_MAX},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
using FloatProxyParseOverflowFloat16Test =
|
using FloatProxyParseOverflowFloat16Test =
|
||||||
::testing::TestWithParam<OverflowParseCase<uint16_t>>;
|
::testing::TestWithParam<OverflowParseCase<uint16_t>>;
|
||||||
@ -1291,7 +1291,7 @@ TEST_P(FloatProxyParseOverflowFloat16Test, Sample) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Float16Overflow, FloatProxyParseOverflowFloat16Test,
|
Float16Overflow, FloatProxyParseOverflowFloat16Test,
|
||||||
::testing::ValuesIn(std::vector<OverflowParseCase<uint16_t>>({
|
::testing::ValuesIn(std::vector<OverflowParseCase<uint16_t>>({
|
||||||
{"0", true, uint16_t{0}},
|
{"0", true, uint16_t{0}},
|
||||||
@ -1305,7 +1305,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"-1e38", false, uint16_t{0xfbff}},
|
{"-1e38", false, uint16_t{0xfbff}},
|
||||||
{"-1e40", false, uint16_t{0xfbff}},
|
{"-1e40", false, uint16_t{0xfbff}},
|
||||||
{"-1e400", false, uint16_t{0xfbff}},
|
{"-1e400", false, uint16_t{0xfbff}},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
TEST(FloatProxy, Max) {
|
TEST(FloatProxy, Max) {
|
||||||
EXPECT_THAT(FloatProxy<Float16>::max().getAsFloat().get_value(),
|
EXPECT_THAT(FloatProxy<Float16>::max().getAsFloat().get_value(),
|
||||||
|
@ -54,31 +54,31 @@ TEST_P(FriendlyNameTest, SingleMapping) {
|
|||||||
<< " for id " << GetParam().id;
|
<< " for id " << GetParam().id;
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ScalarType, FriendlyNameTest,
|
INSTANTIATE_TEST_SUITE_P(ScalarType, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"%1 = OpTypeVoid", 1, "void"},
|
{"%1 = OpTypeVoid", 1, "void"},
|
||||||
{"%1 = OpTypeBool", 1, "bool"},
|
{"%1 = OpTypeBool", 1, "bool"},
|
||||||
{"%1 = OpTypeInt 8 0", 1, "uchar"},
|
{"%1 = OpTypeInt 8 0", 1, "uchar"},
|
||||||
{"%1 = OpTypeInt 8 1", 1, "char"},
|
{"%1 = OpTypeInt 8 1", 1, "char"},
|
||||||
{"%1 = OpTypeInt 16 0", 1, "ushort"},
|
{"%1 = OpTypeInt 16 0", 1, "ushort"},
|
||||||
{"%1 = OpTypeInt 16 1", 1, "short"},
|
{"%1 = OpTypeInt 16 1", 1, "short"},
|
||||||
{"%1 = OpTypeInt 32 0", 1, "uint"},
|
{"%1 = OpTypeInt 32 0", 1, "uint"},
|
||||||
{"%1 = OpTypeInt 32 1", 1, "int"},
|
{"%1 = OpTypeInt 32 1", 1, "int"},
|
||||||
{"%1 = OpTypeInt 64 0", 1, "ulong"},
|
{"%1 = OpTypeInt 64 0", 1, "ulong"},
|
||||||
{"%1 = OpTypeInt 64 1", 1, "long"},
|
{"%1 = OpTypeInt 64 1", 1, "long"},
|
||||||
{"%1 = OpTypeInt 1 0", 1, "u1"},
|
{"%1 = OpTypeInt 1 0", 1, "u1"},
|
||||||
{"%1 = OpTypeInt 1 1", 1, "i1"},
|
{"%1 = OpTypeInt 1 1", 1, "i1"},
|
||||||
{"%1 = OpTypeInt 33 0", 1, "u33"},
|
{"%1 = OpTypeInt 33 0", 1, "u33"},
|
||||||
{"%1 = OpTypeInt 33 1", 1, "i33"},
|
{"%1 = OpTypeInt 33 1", 1, "i33"},
|
||||||
|
|
||||||
{"%1 = OpTypeFloat 16", 1, "half"},
|
{"%1 = OpTypeFloat 16", 1, "half"},
|
||||||
{"%1 = OpTypeFloat 32", 1, "float"},
|
{"%1 = OpTypeFloat 32", 1, "float"},
|
||||||
{"%1 = OpTypeFloat 64", 1, "double"},
|
{"%1 = OpTypeFloat 64", 1, "double"},
|
||||||
{"%1 = OpTypeFloat 10", 1, "fp10"},
|
{"%1 = OpTypeFloat 10", 1, "fp10"},
|
||||||
{"%1 = OpTypeFloat 55", 1, "fp55"},
|
{"%1 = OpTypeFloat 55", 1, "fp55"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
VectorType, FriendlyNameTest,
|
VectorType, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"%1 = OpTypeBool %2 = OpTypeVector %1 1", 2, "v1bool"},
|
{"%1 = OpTypeBool %2 = OpTypeVector %1 1", 2, "v1bool"},
|
||||||
@ -97,9 +97,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// OpName overrides the element name.
|
// OpName overrides the element name.
|
||||||
{"OpName %1 \"time\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2", 2,
|
{"OpName %1 \"time\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2", 2,
|
||||||
"v2time"},
|
"v2time"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
MatrixType, FriendlyNameTest,
|
MatrixType, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"%1 = OpTypeBool %2 = OpTypeVector %1 2 %3 = OpTypeMatrix %2 2", 3,
|
{"%1 = OpTypeBool %2 = OpTypeVector %1 2 %3 = OpTypeMatrix %2 2", 3,
|
||||||
@ -114,9 +114,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpName %2 \"lat_long\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2 %3 "
|
{"OpName %2 \"lat_long\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2 %3 "
|
||||||
"= OpTypeMatrix %2 4",
|
"= OpTypeMatrix %2 4",
|
||||||
3, "mat4lat_long"},
|
3, "mat4lat_long"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpName, FriendlyNameTest,
|
OpName, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"OpName %1 \"abcdefg\"", 1, "abcdefg"},
|
{"OpName %1 \"abcdefg\"", 1, "abcdefg"},
|
||||||
@ -146,38 +146,38 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// OpName can override other inferences. We assume valid instruction
|
// OpName can override other inferences. We assume valid instruction
|
||||||
// ordering, where OpName precedes type definitions.
|
// ordering, where OpName precedes type definitions.
|
||||||
{"OpName %1 \"myfloat\" %1 = OpTypeFloat 32", 1, "myfloat"},
|
{"OpName %1 \"myfloat\" %1 = OpTypeFloat 32", 1, "myfloat"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
UniquenessHeuristic, FriendlyNameTest,
|
UniquenessHeuristic, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 1, "void"},
|
{"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 1, "void"},
|
||||||
{"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 2, "void_0"},
|
{"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 2, "void_0"},
|
||||||
{"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 3, "void_1"},
|
{"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 3, "void_1"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Arrays, FriendlyNameTest,
|
INSTANTIATE_TEST_SUITE_P(Arrays, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"OpName %2 \"FortyTwo\" %1 = OpTypeFloat 32 "
|
{"OpName %2 \"FortyTwo\" %1 = OpTypeFloat 32 "
|
||||||
"%2 = OpConstant %1 42 %3 = OpTypeArray %1 %2",
|
"%2 = OpConstant %1 42 %3 = OpTypeArray %1 %2",
|
||||||
3, "_arr_float_FortyTwo"},
|
3, "_arr_float_FortyTwo"},
|
||||||
{"%1 = OpTypeInt 32 0 "
|
{"%1 = OpTypeInt 32 0 "
|
||||||
"%2 = OpTypeRuntimeArray %1",
|
"%2 = OpTypeRuntimeArray %1",
|
||||||
2, "_runtimearr_uint"},
|
2, "_runtimearr_uint"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Structs, FriendlyNameTest,
|
INSTANTIATE_TEST_SUITE_P(Structs, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"%1 = OpTypeBool "
|
{"%1 = OpTypeBool "
|
||||||
"%2 = OpTypeStruct %1 %1 %1",
|
"%2 = OpTypeStruct %1 %1 %1",
|
||||||
2, "_struct_2"},
|
2, "_struct_2"},
|
||||||
{"%1 = OpTypeBool "
|
{"%1 = OpTypeBool "
|
||||||
"%2 = OpTypeStruct %1 %1 %1 "
|
"%2 = OpTypeStruct %1 %1 %1 "
|
||||||
"%3 = OpTypeStruct %2 %2",
|
"%3 = OpTypeStruct %2 %2",
|
||||||
3, "_struct_3"},
|
3, "_struct_3"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Pointer, FriendlyNameTest,
|
Pointer, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"%1 = OpTypeFloat 32 %2 = OpTypePointer Workgroup %1", 2,
|
{"%1 = OpTypeFloat 32 %2 = OpTypePointer Workgroup %1", 2,
|
||||||
@ -189,22 +189,22 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"%1 = OpTypeBool OpTypeForwardPointer %2 Private %2 = OpTypePointer "
|
{"%1 = OpTypeBool OpTypeForwardPointer %2 Private %2 = OpTypePointer "
|
||||||
"Private %1",
|
"Private %1",
|
||||||
2, "_ptr_Private_bool"},
|
2, "_ptr_Private_bool"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ExoticTypes, FriendlyNameTest,
|
INSTANTIATE_TEST_SUITE_P(ExoticTypes, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"%1 = OpTypeEvent", 1, "Event"},
|
{"%1 = OpTypeEvent", 1, "Event"},
|
||||||
{"%1 = OpTypeDeviceEvent", 1, "DeviceEvent"},
|
{"%1 = OpTypeDeviceEvent", 1, "DeviceEvent"},
|
||||||
{"%1 = OpTypeReserveId", 1, "ReserveId"},
|
{"%1 = OpTypeReserveId", 1, "ReserveId"},
|
||||||
{"%1 = OpTypeQueue", 1, "Queue"},
|
{"%1 = OpTypeQueue", 1, "Queue"},
|
||||||
{"%1 = OpTypeOpaque \"hello world!\"", 1,
|
{"%1 = OpTypeOpaque \"hello world!\"", 1,
|
||||||
"Opaque_hello_world_"},
|
"Opaque_hello_world_"},
|
||||||
{"%1 = OpTypePipe ReadOnly", 1, "PipeReadOnly"},
|
{"%1 = OpTypePipe ReadOnly", 1, "PipeReadOnly"},
|
||||||
{"%1 = OpTypePipe WriteOnly", 1, "PipeWriteOnly"},
|
{"%1 = OpTypePipe WriteOnly", 1, "PipeWriteOnly"},
|
||||||
{"%1 = OpTypePipe ReadWrite", 1, "PipeReadWrite"},
|
{"%1 = OpTypePipe ReadWrite", 1, "PipeReadWrite"},
|
||||||
{"%1 = OpTypePipeStorage", 1, "PipeStorage"},
|
{"%1 = OpTypePipeStorage", 1, "PipeStorage"},
|
||||||
{"%1 = OpTypeNamedBarrier", 1, "NamedBarrier"},
|
{"%1 = OpTypeNamedBarrier", 1, "NamedBarrier"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
// Makes a test case for a BuiltIn variable declaration.
|
// Makes a test case for a BuiltIn variable declaration.
|
||||||
NameIdCase BuiltInCase(std::string assembly_name, std::string expected) {
|
NameIdCase BuiltInCase(std::string assembly_name, std::string expected) {
|
||||||
@ -226,7 +226,7 @@ NameIdCase BuiltInGLCase(std::string assembly_name) {
|
|||||||
return BuiltInCase(assembly_name, std::string("gl_") + assembly_name);
|
return BuiltInCase(assembly_name, std::string("gl_") + assembly_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
BuiltIns, FriendlyNameTest,
|
BuiltIns, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
BuiltInGLCase("Position"),
|
BuiltInGLCase("Position"),
|
||||||
@ -275,15 +275,15 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
BuiltInCase("SubgroupGtMaskKHR"),
|
BuiltInCase("SubgroupGtMaskKHR"),
|
||||||
BuiltInCase("SubgroupLeMaskKHR"),
|
BuiltInCase("SubgroupLeMaskKHR"),
|
||||||
BuiltInCase("SubgroupLtMaskKHR"),
|
BuiltInCase("SubgroupLtMaskKHR"),
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DebugNameOverridesBuiltin, FriendlyNameTest,
|
INSTANTIATE_TEST_SUITE_P(DebugNameOverridesBuiltin, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"OpName %1 \"foo\" OpDecorate %1 BuiltIn WorkDim "
|
{"OpName %1 \"foo\" OpDecorate %1 BuiltIn WorkDim "
|
||||||
"%1 = OpVariable %2 Input",
|
"%1 = OpVariable %2 Input",
|
||||||
1, "foo"}}), );
|
1, "foo"}}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SimpleIntegralConstants, FriendlyNameTest,
|
SimpleIntegralConstants, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"%1 = OpTypeInt 32 0 %2 = OpConstant %1 0", 2, "uint_0"},
|
{"%1 = OpTypeInt 32 0 %2 = OpConstant %1 0", 2, "uint_0"},
|
||||||
@ -301,9 +301,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"%1 = OpTypeInt 33 0 %2 = OpConstant %1 0", 2, "u33_0"},
|
{"%1 = OpTypeInt 33 0 %2 = OpConstant %1 0", 2, "u33_0"},
|
||||||
{"%1 = OpTypeInt 33 1 %2 = OpConstant %1 10", 2, "i33_10"},
|
{"%1 = OpTypeInt 33 1 %2 = OpConstant %1 10", 2, "i33_10"},
|
||||||
{"%1 = OpTypeInt 33 1 %2 = OpConstant %1 -19", 2, "i33_n19"},
|
{"%1 = OpTypeInt 33 1 %2 = OpConstant %1 -19", 2, "i33_n19"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SimpleFloatConstants, FriendlyNameTest,
|
SimpleFloatConstants, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ff4p+16", 2,
|
{"%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ff4p+16", 2,
|
||||||
@ -334,14 +334,14 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"double_0x1p_1024"}, // Inf
|
"double_0x1p_1024"}, // Inf
|
||||||
{"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024", 2,
|
{"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024", 2,
|
||||||
"double_n0x1p_1024"}, // -Inf
|
"double_n0x1p_1024"}, // -Inf
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
BooleanConstants, FriendlyNameTest,
|
BooleanConstants, FriendlyNameTest,
|
||||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||||
{"%1 = OpTypeBool\n%2 = OpConstantTrue %1", 2, "true"},
|
{"%1 = OpTypeBool\n%2 = OpConstantTrue %1", 2, "true"},
|
||||||
{"%1 = OpTypeBool\n%2 = OpConstantFalse %1", 2, "false"},
|
{"%1 = OpTypeBool\n%2 = OpConstantFalse %1", 2, "false"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
@ -65,7 +65,7 @@ TEST_P(IdValidityTest, IdTypes) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidAndInvalidIds, IdValidityTest,
|
ValidAndInvalidIds, IdValidityTest,
|
||||||
::testing::ValuesIn(std::vector<IdCheckCase>(
|
::testing::ValuesIn(std::vector<IdCheckCase>(
|
||||||
{{"%1", true}, {"%2abc", true}, {"%3Def", true},
|
{{"%1", true}, {"%2abc", true}, {"%3Def", true},
|
||||||
@ -81,7 +81,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"%foo_@_bar", false}, {"%", false},
|
{"%foo_@_bar", false}, {"%", false},
|
||||||
|
|
||||||
{"5", false}, {"32", false}, {"foo", false},
|
{"5", false}, {"32", false}, {"foo", false},
|
||||||
{"a%bar", false}})), );
|
{"a%bar", false}})));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
@ -42,7 +42,7 @@ TEST_P(OpcodeTableCapabilitiesTest, TableEntryMatchesExpectedCapabilities) {
|
|||||||
ElementsIn(CapabilitySet(entry->numCapabilities, entry->capabilities)));
|
ElementsIn(CapabilitySet(entry->numCapabilities, entry->capabilities)));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TableRowTest, OpcodeTableCapabilitiesTest,
|
TableRowTest, OpcodeTableCapabilitiesTest,
|
||||||
// Spot-check a few opcodes.
|
// Spot-check a few opcodes.
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
@ -72,7 +72,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CapabilitySet{SpvCapabilityNamedBarrier}},
|
CapabilitySet{SpvCapabilityNamedBarrier}},
|
||||||
ExpectedOpCodeCapabilities{
|
ExpectedOpCodeCapabilities{
|
||||||
SpvOpGetKernelMaxNumSubgroups,
|
SpvOpGetKernelMaxNumSubgroups,
|
||||||
CapabilitySet{SpvCapabilitySubgroupDispatch}}), );
|
CapabilitySet{SpvCapabilitySubgroupDispatch}}));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
@ -32,8 +32,8 @@ TEST_P(GetTargetOpcodeTableGetTest, InvalidPointerTable) {
|
|||||||
ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOpcodeTableGet(nullptr, GetParam()));
|
ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOpcodeTableGet(nullptr, GetParam()));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(OpcodeTableGet, GetTargetOpcodeTableGetTest,
|
INSTANTIATE_TEST_SUITE_P(OpcodeTableGet, GetTargetOpcodeTableGetTest,
|
||||||
ValuesIn(spvtest::AllTargetEnvironments()));
|
ValuesIn(spvtest::AllTargetEnvironments()));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
@ -91,7 +91,7 @@ TEST_P(EnumCapabilityTest, Sample) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// See SPIR-V Section 3.3 Execution Model
|
// See SPIR-V Section 3.3 Execution Model
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ExecutionModel, EnumCapabilityTest,
|
ExecutionModel, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -104,30 +104,30 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(EXECUTION_MODEL, ExecutionModelFragment, Shader),
|
CASE1(EXECUTION_MODEL, ExecutionModelFragment, Shader),
|
||||||
CASE1(EXECUTION_MODEL, ExecutionModelGLCompute, Shader),
|
CASE1(EXECUTION_MODEL, ExecutionModelGLCompute, Shader),
|
||||||
CASE1(EXECUTION_MODEL, ExecutionModelKernel, Kernel),
|
CASE1(EXECUTION_MODEL, ExecutionModelKernel, Kernel),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.4 Addressing Model
|
// See SPIR-V Section 3.4 Addressing Model
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
AddressingModel, EnumCapabilityTest,
|
AddressingModel, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
CASE0(ADDRESSING_MODEL, AddressingModelLogical),
|
CASE0(ADDRESSING_MODEL, AddressingModelLogical),
|
||||||
CASE1(ADDRESSING_MODEL, AddressingModelPhysical32, Addresses),
|
CASE1(ADDRESSING_MODEL, AddressingModelPhysical32, Addresses),
|
||||||
CASE1(ADDRESSING_MODEL, AddressingModelPhysical64, Addresses),
|
CASE1(ADDRESSING_MODEL, AddressingModelPhysical64, Addresses),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.5 Memory Model
|
// See SPIR-V Section 3.5 Memory Model
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
MemoryModel, EnumCapabilityTest,
|
MemoryModel, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
CASE1(MEMORY_MODEL, MemoryModelSimple, Shader),
|
CASE1(MEMORY_MODEL, MemoryModelSimple, Shader),
|
||||||
CASE1(MEMORY_MODEL, MemoryModelGLSL450, Shader),
|
CASE1(MEMORY_MODEL, MemoryModelGLSL450, Shader),
|
||||||
CASE1(MEMORY_MODEL, MemoryModelOpenCL, Kernel),
|
CASE1(MEMORY_MODEL, MemoryModelOpenCL, Kernel),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.6 Execution Mode
|
// See SPIR-V Section 3.6 Execution Mode
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ExecutionMode, EnumCapabilityTest,
|
ExecutionMode, EnumCapabilityTest,
|
||||||
Combine(
|
Combine(
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
@ -169,9 +169,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(EXECUTION_MODE, ExecutionModeOutputTriangleStrip, Geometry),
|
CASE1(EXECUTION_MODE, ExecutionModeOutputTriangleStrip, Geometry),
|
||||||
CASE1(EXECUTION_MODE, ExecutionModeVecTypeHint, Kernel),
|
CASE1(EXECUTION_MODE, ExecutionModeVecTypeHint, Kernel),
|
||||||
CASE1(EXECUTION_MODE, ExecutionModeContractionOff, Kernel),
|
CASE1(EXECUTION_MODE, ExecutionModeContractionOff, Kernel),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ExecutionModeV11, EnumCapabilityTest,
|
ExecutionModeV11, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -180,10 +180,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(EXECUTION_MODE, ExecutionModeSubgroupSize,
|
CASE1(EXECUTION_MODE, ExecutionModeSubgroupSize,
|
||||||
SubgroupDispatch),
|
SubgroupDispatch),
|
||||||
CASE1(EXECUTION_MODE, ExecutionModeSubgroupsPerWorkgroup,
|
CASE1(EXECUTION_MODE, ExecutionModeSubgroupsPerWorkgroup,
|
||||||
SubgroupDispatch)})), );
|
SubgroupDispatch)})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.7 Storage Class
|
// See SPIR-V Section 3.7 Storage Class
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
StorageClass, EnumCapabilityTest,
|
StorageClass, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -199,10 +199,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(STORAGE_CLASS, StorageClassPushConstant, Shader),
|
CASE1(STORAGE_CLASS, StorageClassPushConstant, Shader),
|
||||||
CASE1(STORAGE_CLASS, StorageClassAtomicCounter, AtomicStorage),
|
CASE1(STORAGE_CLASS, StorageClassAtomicCounter, AtomicStorage),
|
||||||
CASE0(STORAGE_CLASS, StorageClassImage),
|
CASE0(STORAGE_CLASS, StorageClassImage),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.8 Dim
|
// See SPIR-V Section 3.8 Dim
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Dim, EnumCapabilityTest,
|
Dim, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -213,10 +213,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE2(DIMENSIONALITY, DimRect, SampledRect, ImageRect),
|
CASE2(DIMENSIONALITY, DimRect, SampledRect, ImageRect),
|
||||||
CASE2(DIMENSIONALITY, DimBuffer, SampledBuffer, ImageBuffer),
|
CASE2(DIMENSIONALITY, DimBuffer, SampledBuffer, ImageBuffer),
|
||||||
CASE1(DIMENSIONALITY, DimSubpassData, InputAttachment),
|
CASE1(DIMENSIONALITY, DimSubpassData, InputAttachment),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.9 Sampler Addressing Mode
|
// See SPIR-V Section 3.9 Sampler Addressing Mode
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SamplerAddressingMode, EnumCapabilityTest,
|
SamplerAddressingMode, EnumCapabilityTest,
|
||||||
Combine(
|
Combine(
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
@ -228,19 +228,19 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeat, Kernel),
|
CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeat, Kernel),
|
||||||
CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeatMirrored,
|
CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeatMirrored,
|
||||||
Kernel),
|
Kernel),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.10 Sampler Filter Mode
|
// See SPIR-V Section 3.10 Sampler Filter Mode
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SamplerFilterMode, EnumCapabilityTest,
|
SamplerFilterMode, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeNearest, Kernel),
|
CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeNearest, Kernel),
|
||||||
CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeLinear, Kernel),
|
CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeLinear, Kernel),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.11 Image Format
|
// See SPIR-V Section 3.11 Image Format
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ImageFormat, EnumCapabilityTest,
|
ImageFormat, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -286,10 +286,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16ui, StorageImageExtendedFormats),
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16ui, StorageImageExtendedFormats),
|
||||||
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8ui, StorageImageExtendedFormats),
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8ui, StorageImageExtendedFormats),
|
||||||
// clang-format on
|
// clang-format on
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.12 Image Channel Order
|
// See SPIR-V Section 3.12 Image Channel Order
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ImageChannelOrder, EnumCapabilityTest,
|
ImageChannelOrder, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -314,10 +314,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBA, Kernel),
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBA, Kernel),
|
||||||
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersBGRA, Kernel),
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersBGRA, Kernel),
|
||||||
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderABGR, Kernel),
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderABGR, Kernel),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.13 Image Channel Data Type
|
// See SPIR-V Section 3.13 Image Channel Data Type
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ImageChannelDataType, EnumCapabilityTest,
|
ImageChannelDataType, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -340,10 +340,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt24, Kernel),
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt24, Kernel),
|
||||||
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010_2, Kernel),
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010_2, Kernel),
|
||||||
// clang-format on
|
// clang-format on
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.14 Image Operands
|
// See SPIR-V Section 3.14 Image Operands
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ImageOperands, EnumCapabilityTest,
|
ImageOperands, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -358,10 +358,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE0(OPTIONAL_IMAGE, ImageOperandsSampleMask),
|
CASE0(OPTIONAL_IMAGE, ImageOperandsSampleMask),
|
||||||
CASE1(OPTIONAL_IMAGE, ImageOperandsMinLodMask, MinLod),
|
CASE1(OPTIONAL_IMAGE, ImageOperandsMinLodMask, MinLod),
|
||||||
// clang-format on
|
// clang-format on
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.15 FP Fast Math Mode
|
// See SPIR-V Section 3.15 FP Fast Math Mode
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
FPFastMathMode, EnumCapabilityTest,
|
FPFastMathMode, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -371,29 +371,29 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(FP_FAST_MATH_MODE, FPFastMathModeNSZMask, Kernel),
|
CASE1(FP_FAST_MATH_MODE, FPFastMathModeNSZMask, Kernel),
|
||||||
CASE1(FP_FAST_MATH_MODE, FPFastMathModeAllowRecipMask, Kernel),
|
CASE1(FP_FAST_MATH_MODE, FPFastMathModeAllowRecipMask, Kernel),
|
||||||
CASE1(FP_FAST_MATH_MODE, FPFastMathModeFastMask, Kernel),
|
CASE1(FP_FAST_MATH_MODE, FPFastMathModeFastMask, Kernel),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.17 Linkage Type
|
// See SPIR-V Section 3.17 Linkage Type
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
LinkageType, EnumCapabilityTest,
|
LinkageType, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
CASE1(LINKAGE_TYPE, LinkageTypeExport, Linkage),
|
CASE1(LINKAGE_TYPE, LinkageTypeExport, Linkage),
|
||||||
CASE1(LINKAGE_TYPE, LinkageTypeImport, Linkage),
|
CASE1(LINKAGE_TYPE, LinkageTypeImport, Linkage),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.18 Access Qualifier
|
// See SPIR-V Section 3.18 Access Qualifier
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
AccessQualifier, EnumCapabilityTest,
|
AccessQualifier, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
CASE1(ACCESS_QUALIFIER, AccessQualifierReadOnly, Kernel),
|
CASE1(ACCESS_QUALIFIER, AccessQualifierReadOnly, Kernel),
|
||||||
CASE1(ACCESS_QUALIFIER, AccessQualifierWriteOnly, Kernel),
|
CASE1(ACCESS_QUALIFIER, AccessQualifierWriteOnly, Kernel),
|
||||||
CASE1(ACCESS_QUALIFIER, AccessQualifierReadWrite, Kernel),
|
CASE1(ACCESS_QUALIFIER, AccessQualifierReadWrite, Kernel),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.19 Function Parameter Attribute
|
// See SPIR-V Section 3.19 Function Parameter Attribute
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
FunctionParameterAttribute, EnumCapabilityTest,
|
FunctionParameterAttribute, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -407,10 +407,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoWrite, Kernel),
|
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoWrite, Kernel),
|
||||||
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoReadWrite, Kernel),
|
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoReadWrite, Kernel),
|
||||||
// clang-format on
|
// clang-format on
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.20 Decoration
|
// See SPIR-V Section 3.20 Decoration
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Decoration, EnumCapabilityTest,
|
Decoration, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -460,25 +460,25 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(DECORATION, DecorationInputAttachmentIndex,
|
CASE1(DECORATION, DecorationInputAttachmentIndex,
|
||||||
InputAttachment),
|
InputAttachment),
|
||||||
CASE1(DECORATION, DecorationAlignment, Kernel),
|
CASE1(DECORATION, DecorationAlignment, Kernel),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// SpecId has different requirements in v1.0 and v1.1:
|
// SpecId has different requirements in v1.0 and v1.1:
|
||||||
INSTANTIATE_TEST_CASE_P(DecorationSpecIdV10, EnumCapabilityTest,
|
INSTANTIATE_TEST_SUITE_P(DecorationSpecIdV10, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{CASE1(
|
ValuesIn(std::vector<EnumCapabilityCase>{CASE1(
|
||||||
DECORATION, DecorationSpecId, Shader)})), );
|
DECORATION, DecorationSpecId, Shader)})));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DecorationV11, EnumCapabilityTest,
|
DecorationV11, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
CASE2(DECORATION, DecorationSpecId, Shader, Kernel),
|
CASE2(DECORATION, DecorationSpecId, Shader, Kernel),
|
||||||
CASE1(DECORATION, DecorationMaxByteOffset, Addresses)})), );
|
CASE1(DECORATION, DecorationMaxByteOffset, Addresses)})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.21 BuiltIn
|
// See SPIR-V Section 3.21 BuiltIn
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
BuiltIn, EnumCapabilityTest,
|
BuiltIn, EnumCapabilityTest,
|
||||||
Combine(
|
Combine(
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
@ -530,38 +530,38 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(BUILT_IN, BuiltInVertexIndex, Shader),
|
CASE1(BUILT_IN, BuiltInVertexIndex, Shader),
|
||||||
CASE1(BUILT_IN, BuiltInInstanceIndex, Shader),
|
CASE1(BUILT_IN, BuiltInInstanceIndex, Shader),
|
||||||
// clang-format on
|
// clang-format on
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.22 Selection Control
|
// See SPIR-V Section 3.22 Selection Control
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SelectionControl, EnumCapabilityTest,
|
SelectionControl, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
CASE0(SELECTION_CONTROL, SelectionControlMaskNone),
|
CASE0(SELECTION_CONTROL, SelectionControlMaskNone),
|
||||||
CASE0(SELECTION_CONTROL, SelectionControlFlattenMask),
|
CASE0(SELECTION_CONTROL, SelectionControlFlattenMask),
|
||||||
CASE0(SELECTION_CONTROL, SelectionControlDontFlattenMask),
|
CASE0(SELECTION_CONTROL, SelectionControlDontFlattenMask),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.23 Loop Control
|
// See SPIR-V Section 3.23 Loop Control
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
LoopControl, EnumCapabilityTest,
|
LoopControl, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
CASE0(LOOP_CONTROL, LoopControlMaskNone),
|
CASE0(LOOP_CONTROL, LoopControlMaskNone),
|
||||||
CASE0(LOOP_CONTROL, LoopControlUnrollMask),
|
CASE0(LOOP_CONTROL, LoopControlUnrollMask),
|
||||||
CASE0(LOOP_CONTROL, LoopControlDontUnrollMask),
|
CASE0(LOOP_CONTROL, LoopControlDontUnrollMask),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
LoopControlV11, EnumCapabilityTest,
|
LoopControlV11, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
CASE0(LOOP_CONTROL, LoopControlDependencyInfiniteMask),
|
CASE0(LOOP_CONTROL, LoopControlDependencyInfiniteMask),
|
||||||
CASE0(LOOP_CONTROL, LoopControlDependencyLengthMask),
|
CASE0(LOOP_CONTROL, LoopControlDependencyLengthMask),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.24 Function Control
|
// See SPIR-V Section 3.24 Function Control
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
FunctionControl, EnumCapabilityTest,
|
FunctionControl, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -570,10 +570,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE0(FUNCTION_CONTROL, FunctionControlDontInlineMask),
|
CASE0(FUNCTION_CONTROL, FunctionControlDontInlineMask),
|
||||||
CASE0(FUNCTION_CONTROL, FunctionControlPureMask),
|
CASE0(FUNCTION_CONTROL, FunctionControlPureMask),
|
||||||
CASE0(FUNCTION_CONTROL, FunctionControlConstMask),
|
CASE0(FUNCTION_CONTROL, FunctionControlConstMask),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.25 Memory Semantics <id>
|
// See SPIR-V Section 3.25 Memory Semantics <id>
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
MemorySemantics, EnumCapabilityTest,
|
MemorySemantics, EnumCapabilityTest,
|
||||||
Combine(
|
Combine(
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
@ -592,10 +592,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsAtomicCounterMemoryMask,
|
CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsAtomicCounterMemoryMask,
|
||||||
AtomicStorage), // Bug 15234
|
AtomicStorage), // Bug 15234
|
||||||
CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsImageMemoryMask),
|
CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsImageMemoryMask),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.26 Memory Access
|
// See SPIR-V Section 3.26 Memory Access
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
MemoryAccess, EnumCapabilityTest,
|
MemoryAccess, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -603,10 +603,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessVolatileMask),
|
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessVolatileMask),
|
||||||
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessAlignedMask),
|
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessAlignedMask),
|
||||||
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessNontemporalMask),
|
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessNontemporalMask),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.27 Scope <id>
|
// See SPIR-V Section 3.27 Scope <id>
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Scope, EnumCapabilityTest,
|
Scope, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||||
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
||||||
@ -617,10 +617,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE0(SCOPE_ID, ScopeSubgroup),
|
CASE0(SCOPE_ID, ScopeSubgroup),
|
||||||
CASE0(SCOPE_ID, ScopeInvocation),
|
CASE0(SCOPE_ID, ScopeInvocation),
|
||||||
CASE1(SCOPE_ID, ScopeQueueFamilyKHR, VulkanMemoryModelKHR),
|
CASE1(SCOPE_ID, ScopeQueueFamilyKHR, VulkanMemoryModelKHR),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.28 Group Operation
|
// See SPIR-V Section 3.28 Group Operation
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
GroupOperation, EnumCapabilityTest,
|
GroupOperation, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -630,10 +630,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
GroupNonUniformArithmetic, GroupNonUniformBallot),
|
GroupNonUniformArithmetic, GroupNonUniformBallot),
|
||||||
CASE3(GROUP_OPERATION, GroupOperationExclusiveScan, Kernel,
|
CASE3(GROUP_OPERATION, GroupOperationExclusiveScan, Kernel,
|
||||||
GroupNonUniformArithmetic, GroupNonUniformBallot),
|
GroupNonUniformArithmetic, GroupNonUniformBallot),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.29 Kernel Enqueue Flags
|
// See SPIR-V Section 3.29 Kernel Enqueue Flags
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
KernelEnqueueFlags, EnumCapabilityTest,
|
KernelEnqueueFlags, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
@ -641,20 +641,20 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitKernel, Kernel),
|
CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitKernel, Kernel),
|
||||||
CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitWorkGroup,
|
CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitWorkGroup,
|
||||||
Kernel),
|
Kernel),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.30 Kernel Profiling Info
|
// See SPIR-V Section 3.30 Kernel Profiling Info
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
KernelProfilingInfo, EnumCapabilityTest,
|
KernelProfilingInfo, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
CASE0(KERNEL_PROFILING_INFO, KernelProfilingInfoMaskNone),
|
CASE0(KERNEL_PROFILING_INFO, KernelProfilingInfoMaskNone),
|
||||||
CASE1(KERNEL_PROFILING_INFO, KernelProfilingInfoCmdExecTimeMask,
|
CASE1(KERNEL_PROFILING_INFO, KernelProfilingInfoCmdExecTimeMask,
|
||||||
Kernel),
|
Kernel),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// See SPIR-V Section 3.31 Capability
|
// See SPIR-V Section 3.31 Capability
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
CapabilityDependsOn, EnumCapabilityTest,
|
CapabilityDependsOn, EnumCapabilityTest,
|
||||||
Combine(
|
Combine(
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
@ -717,16 +717,16 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE1(CAPABILITY, CapabilityStorageImageWriteWithoutFormat, Shader),
|
CASE1(CAPABILITY, CapabilityStorageImageWriteWithoutFormat, Shader),
|
||||||
CASE1(CAPABILITY, CapabilityMultiViewport, Geometry),
|
CASE1(CAPABILITY, CapabilityMultiViewport, Geometry),
|
||||||
// clang-format on
|
// clang-format on
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
CapabilityDependsOnV11, EnumCapabilityTest,
|
CapabilityDependsOnV11, EnumCapabilityTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||||
CASE1(CAPABILITY, CapabilitySubgroupDispatch, DeviceEnqueue),
|
CASE1(CAPABILITY, CapabilitySubgroupDispatch, DeviceEnqueue),
|
||||||
CASE1(CAPABILITY, CapabilityNamedBarrier, Kernel),
|
CASE1(CAPABILITY, CapabilityNamedBarrier, Kernel),
|
||||||
CASE1(CAPABILITY, CapabilityPipeStorage, Pipes),
|
CASE1(CAPABILITY, CapabilityPipeStorage, Pipes),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
#undef CASE0
|
#undef CASE0
|
||||||
#undef CASE1
|
#undef CASE1
|
||||||
|
@ -84,7 +84,7 @@ TEST_P(MaskExpansionTest, Sample) {
|
|||||||
#define PREFIX1 \
|
#define PREFIX1 \
|
||||||
SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE, \
|
SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE, \
|
||||||
SPV_OPERAND_TYPE_ID
|
SPV_OPERAND_TYPE_ID
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OperandPattern, MaskExpansionTest,
|
OperandPattern, MaskExpansionTest,
|
||||||
::testing::ValuesIn(std::vector<MaskExpansionCase>{
|
::testing::ValuesIn(std::vector<MaskExpansionCase>{
|
||||||
// No bits means no change.
|
// No bits means no change.
|
||||||
@ -111,7 +111,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
SpvMemoryAccessVolatileMask | SpvMemoryAccessAlignedMask,
|
SpvMemoryAccessVolatileMask | SpvMemoryAccessAlignedMask,
|
||||||
{PREFIX1},
|
{PREFIX1},
|
||||||
{PREFIX1, SPV_OPERAND_TYPE_LITERAL_INTEGER}},
|
{PREFIX1, SPV_OPERAND_TYPE_LITERAL_INTEGER}},
|
||||||
}), );
|
}));
|
||||||
#undef PREFIX0
|
#undef PREFIX0
|
||||||
#undef PREFIX1
|
#undef PREFIX1
|
||||||
|
|
||||||
@ -137,9 +137,9 @@ TEST_P(MatchableOperandExpansionTest, MatchableOperandsDontExpand) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(MatchableOperandExpansion,
|
INSTANTIATE_TEST_SUITE_P(MatchableOperandExpansion,
|
||||||
MatchableOperandExpansionTest,
|
MatchableOperandExpansionTest,
|
||||||
::testing::ValuesIn(allOperandTypes()), );
|
::testing::ValuesIn(allOperandTypes()));
|
||||||
|
|
||||||
using VariableOperandExpansionTest =
|
using VariableOperandExpansionTest =
|
||||||
::testing::TestWithParam<spv_operand_type_t>;
|
::testing::TestWithParam<spv_operand_type_t>;
|
||||||
@ -157,9 +157,9 @@ TEST_P(VariableOperandExpansionTest, NonMatchableOperandsExpand) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(NonMatchableOperandExpansion,
|
INSTANTIATE_TEST_SUITE_P(NonMatchableOperandExpansion,
|
||||||
VariableOperandExpansionTest,
|
VariableOperandExpansionTest,
|
||||||
::testing::ValuesIn(allOperandTypes()), );
|
::testing::ValuesIn(allOperandTypes()));
|
||||||
|
|
||||||
TEST(AlternatePatternFollowingImmediate, Empty) {
|
TEST(AlternatePatternFollowingImmediate, Empty) {
|
||||||
EXPECT_THAT(spvAlternatePatternFollowingImmediate({}),
|
EXPECT_THAT(spvAlternatePatternFollowingImmediate({}),
|
||||||
|
@ -33,10 +33,10 @@ TEST_P(GetTargetTest, InvalidPointerTable) {
|
|||||||
ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOperandTableGet(nullptr, GetParam()));
|
ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOperandTableGet(nullptr, GetParam()));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(OperandTableGet, GetTargetTest,
|
INSTANTIATE_TEST_SUITE_P(OperandTableGet, GetTargetTest,
|
||||||
ValuesIn(std::vector<spv_target_env>{
|
ValuesIn(std::vector<spv_target_env>{
|
||||||
SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||||
SPV_ENV_VULKAN_1_0}), );
|
SPV_ENV_VULKAN_1_0}));
|
||||||
|
|
||||||
TEST(OperandString, AllAreDefinedExceptVariable) {
|
TEST(OperandString, AllAreDefinedExceptVariable) {
|
||||||
// None has no string, so don't test it.
|
// None has no string, so don't test it.
|
||||||
|
@ -4254,7 +4254,7 @@ TEST_P(AggressiveEliminateDeadConstantTest, Custom) {
|
|||||||
SinglePassRunAndMatch<AggressiveDCEPass>(assembly_with_dead_const, false);
|
SinglePassRunAndMatch<AggressiveDCEPass>(assembly_with_dead_const, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ScalarTypeConstants, AggressiveEliminateDeadConstantTest,
|
ScalarTypeConstants, AggressiveEliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -4346,7 +4346,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
VectorTypeConstants, AggressiveEliminateDeadConstantTest,
|
VectorTypeConstants, AggressiveEliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -4473,7 +4473,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
StructTypeConstants, AggressiveEliminateDeadConstantTest,
|
StructTypeConstants, AggressiveEliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -4644,7 +4644,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ScalarTypeSpecConstants, AggressiveEliminateDeadConstantTest,
|
ScalarTypeSpecConstants, AggressiveEliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -4697,7 +4697,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
VectorTypeSpecConstants, AggressiveEliminateDeadConstantTest,
|
VectorTypeSpecConstants, AggressiveEliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -4819,7 +4819,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SpecConstantOp, AggressiveEliminateDeadConstantTest,
|
SpecConstantOp, AggressiveEliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -5001,7 +5001,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
LongDefUseChain, AggressiveEliminateDeadConstantTest,
|
LongDefUseChain, AggressiveEliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
@ -206,7 +206,7 @@ TEST_P(ParseDefUseTest, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TestCase, ParseDefUseTest,
|
TestCase, ParseDefUseTest,
|
||||||
::testing::ValuesIn(std::vector<ParseDefUseCase>{
|
::testing::ValuesIn(std::vector<ParseDefUseCase>{
|
||||||
{"", {{}, {}}}, // no instruction
|
{"", {{}, {}}}, // no instruction
|
||||||
@ -629,7 +629,7 @@ TEST_P(ReplaceUseTest, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TestCase, ReplaceUseTest,
|
TestCase, ReplaceUseTest,
|
||||||
::testing::ValuesIn(std::vector<ReplaceUseCase>{
|
::testing::ValuesIn(std::vector<ReplaceUseCase>{
|
||||||
{ // no use, no replace request
|
{ // no use, no replace request
|
||||||
@ -981,7 +981,7 @@ TEST_P(KillDefTest, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TestCase, KillDefTest,
|
TestCase, KillDefTest,
|
||||||
::testing::ValuesIn(std::vector<KillDefCase>{
|
::testing::ValuesIn(std::vector<KillDefCase>{
|
||||||
{ // no def, no use, no kill
|
{ // no def, no use, no kill
|
||||||
@ -1343,7 +1343,7 @@ TEST_P(AnalyzeInstDefUseTest, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TestCase, AnalyzeInstDefUseTest,
|
TestCase, AnalyzeInstDefUseTest,
|
||||||
::testing::ValuesIn(std::vector<AnalyzeInstDefUseTestCase>{
|
::testing::ValuesIn(std::vector<AnalyzeInstDefUseTestCase>{
|
||||||
{ // A type declaring instruction.
|
{ // A type declaring instruction.
|
||||||
@ -1464,7 +1464,7 @@ TEST_P(KillInstTest, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TestCase, KillInstTest,
|
TestCase, KillInstTest,
|
||||||
::testing::ValuesIn(std::vector<KillInstTestCase>{
|
::testing::ValuesIn(std::vector<KillInstTestCase>{
|
||||||
// Kill id defining instructions.
|
// Kill id defining instructions.
|
||||||
@ -1588,7 +1588,7 @@ TEST_P(GetAnnotationsTest, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TestCase, GetAnnotationsTest,
|
TestCase, GetAnnotationsTest,
|
||||||
::testing::ValuesIn(std::vector<GetAnnotationsTestCase>{
|
::testing::ValuesIn(std::vector<GetAnnotationsTestCase>{
|
||||||
// empty
|
// empty
|
||||||
|
@ -197,7 +197,7 @@ TEST_P(EliminateDeadConstantTest, Custom) {
|
|||||||
assembly_with_dead_const, expected, /* skip_nop = */ true);
|
assembly_with_dead_const, expected, /* skip_nop = */ true);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ScalarTypeConstants, EliminateDeadConstantTest,
|
ScalarTypeConstants, EliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -265,7 +265,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
VectorTypeConstants, EliminateDeadConstantTest,
|
VectorTypeConstants, EliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -358,7 +358,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
StructTypeConstants, EliminateDeadConstantTest,
|
StructTypeConstants, EliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -485,7 +485,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ScalarTypeSpecConstants, EliminateDeadConstantTest,
|
ScalarTypeSpecConstants, EliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -522,7 +522,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
VectorTypeSpecConstants, EliminateDeadConstantTest,
|
VectorTypeSpecConstants, EliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -617,7 +617,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SpecConstantOp, EliminateDeadConstantTest,
|
SpecConstantOp, EliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -768,7 +768,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
})));
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
LongDefUseChain, EliminateDeadConstantTest,
|
LongDefUseChain, EliminateDeadConstantTest,
|
||||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
@ -81,158 +81,158 @@ TEST_P(FlattenDecorationTest, TransformsDecorations) {
|
|||||||
SinglePassRunAndCheck<FlattenDecorationPass>(before, after, false, true);
|
SinglePassRunAndCheck<FlattenDecorationPass>(before, after, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(NoUses, FlattenDecorationTest,
|
INSTANTIATE_TEST_SUITE_P(NoUses, FlattenDecorationTest,
|
||||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||||
// No OpDecorationGroup
|
// No OpDecorationGroup
|
||||||
{"", ""},
|
{"", ""},
|
||||||
|
|
||||||
// OpDecorationGroup without any uses, and
|
// OpDecorationGroup without any uses, and
|
||||||
// no OpName.
|
// no OpName.
|
||||||
{"%group = OpDecorationGroup\n", ""},
|
{"%group = OpDecorationGroup\n", ""},
|
||||||
|
|
||||||
// OpDecorationGroup without any uses, and
|
// OpDecorationGroup without any uses, and
|
||||||
// with OpName targeting it. Proves you must
|
// with OpName targeting it. Proves you must
|
||||||
// remove the names as well.
|
// remove the names as well.
|
||||||
{"OpName %group \"group\"\n"
|
{"OpName %group \"group\"\n"
|
||||||
"%group = OpDecorationGroup\n",
|
"%group = OpDecorationGroup\n",
|
||||||
""},
|
""},
|
||||||
|
|
||||||
// OpDecorationGroup with decorations that
|
// OpDecorationGroup with decorations that
|
||||||
// target it, but no uses in OpGroupDecorate
|
// target it, but no uses in OpGroupDecorate
|
||||||
// or OpGroupMemberDecorate instructions.
|
// or OpGroupMemberDecorate instructions.
|
||||||
{"OpDecorate %group Flat\n"
|
{"OpDecorate %group Flat\n"
|
||||||
"OpDecorate %group NoPerspective\n"
|
"OpDecorate %group NoPerspective\n"
|
||||||
"%group = OpDecorationGroup\n",
|
"%group = OpDecorationGroup\n",
|
||||||
""},
|
""},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(OpGroupDecorate, FlattenDecorationTest,
|
INSTANTIATE_TEST_SUITE_P(OpGroupDecorate, FlattenDecorationTest,
|
||||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||||
// One OpGroupDecorate
|
// One OpGroupDecorate
|
||||||
{"OpName %group \"group\"\n"
|
{"OpName %group \"group\"\n"
|
||||||
"OpDecorate %group Flat\n"
|
"OpDecorate %group Flat\n"
|
||||||
"OpDecorate %group NoPerspective\n"
|
"OpDecorate %group NoPerspective\n"
|
||||||
"%group = OpDecorationGroup\n"
|
"%group = OpDecorationGroup\n"
|
||||||
"OpGroupDecorate %group %hue %saturation\n",
|
"OpGroupDecorate %group %hue %saturation\n",
|
||||||
"OpDecorate %hue Flat\n"
|
"OpDecorate %hue Flat\n"
|
||||||
"OpDecorate %saturation Flat\n"
|
"OpDecorate %saturation Flat\n"
|
||||||
"OpDecorate %hue NoPerspective\n"
|
"OpDecorate %hue NoPerspective\n"
|
||||||
"OpDecorate %saturation NoPerspective\n"},
|
"OpDecorate %saturation NoPerspective\n"},
|
||||||
// Multiple OpGroupDecorate
|
// Multiple OpGroupDecorate
|
||||||
{"OpName %group \"group\"\n"
|
{"OpName %group \"group\"\n"
|
||||||
"OpDecorate %group Flat\n"
|
"OpDecorate %group Flat\n"
|
||||||
"OpDecorate %group NoPerspective\n"
|
"OpDecorate %group NoPerspective\n"
|
||||||
"%group = OpDecorationGroup\n"
|
"%group = OpDecorationGroup\n"
|
||||||
"OpGroupDecorate %group %hue %value\n"
|
"OpGroupDecorate %group %hue %value\n"
|
||||||
"OpGroupDecorate %group %saturation\n",
|
"OpGroupDecorate %group %saturation\n",
|
||||||
"OpDecorate %hue Flat\n"
|
"OpDecorate %hue Flat\n"
|
||||||
"OpDecorate %value Flat\n"
|
"OpDecorate %value Flat\n"
|
||||||
"OpDecorate %saturation Flat\n"
|
"OpDecorate %saturation Flat\n"
|
||||||
"OpDecorate %hue NoPerspective\n"
|
"OpDecorate %hue NoPerspective\n"
|
||||||
"OpDecorate %value NoPerspective\n"
|
"OpDecorate %value NoPerspective\n"
|
||||||
"OpDecorate %saturation NoPerspective\n"},
|
"OpDecorate %saturation NoPerspective\n"},
|
||||||
// Two group decorations, interleaved
|
// Two group decorations, interleaved
|
||||||
{"OpName %group0 \"group0\"\n"
|
{"OpName %group0 \"group0\"\n"
|
||||||
"OpName %group1 \"group1\"\n"
|
"OpName %group1 \"group1\"\n"
|
||||||
"OpDecorate %group0 Flat\n"
|
"OpDecorate %group0 Flat\n"
|
||||||
"OpDecorate %group1 NoPerspective\n"
|
"OpDecorate %group1 NoPerspective\n"
|
||||||
"%group0 = OpDecorationGroup\n"
|
"%group0 = OpDecorationGroup\n"
|
||||||
"%group1 = OpDecorationGroup\n"
|
"%group1 = OpDecorationGroup\n"
|
||||||
"OpGroupDecorate %group0 %hue %value\n"
|
"OpGroupDecorate %group0 %hue %value\n"
|
||||||
"OpGroupDecorate %group1 %saturation\n",
|
"OpGroupDecorate %group1 %saturation\n",
|
||||||
"OpDecorate %hue Flat\n"
|
"OpDecorate %hue Flat\n"
|
||||||
"OpDecorate %value Flat\n"
|
"OpDecorate %value Flat\n"
|
||||||
"OpDecorate %saturation NoPerspective\n"},
|
"OpDecorate %saturation NoPerspective\n"},
|
||||||
// Decoration with operands
|
// Decoration with operands
|
||||||
{"OpName %group \"group\"\n"
|
{"OpName %group \"group\"\n"
|
||||||
"OpDecorate %group Location 42\n"
|
"OpDecorate %group Location 42\n"
|
||||||
"%group = OpDecorationGroup\n"
|
"%group = OpDecorationGroup\n"
|
||||||
"OpGroupDecorate %group %hue %saturation\n",
|
"OpGroupDecorate %group %hue %saturation\n",
|
||||||
"OpDecorate %hue Location 42\n"
|
"OpDecorate %hue Location 42\n"
|
||||||
"OpDecorate %saturation Location 42\n"},
|
"OpDecorate %saturation Location 42\n"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(OpGroupMemberDecorate, FlattenDecorationTest,
|
INSTANTIATE_TEST_SUITE_P(OpGroupMemberDecorate, FlattenDecorationTest,
|
||||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||||
// One OpGroupMemberDecorate
|
// One OpGroupMemberDecorate
|
||||||
{"OpName %group \"group\"\n"
|
{"OpName %group \"group\"\n"
|
||||||
"OpDecorate %group Flat\n"
|
"OpDecorate %group Flat\n"
|
||||||
"OpDecorate %group Offset 16\n"
|
"OpDecorate %group Offset 16\n"
|
||||||
"%group = OpDecorationGroup\n"
|
"%group = OpDecorationGroup\n"
|
||||||
"OpGroupMemberDecorate %group %Point 1\n",
|
"OpGroupMemberDecorate %group %Point 1\n",
|
||||||
"OpMemberDecorate %Point 1 Flat\n"
|
"OpMemberDecorate %Point 1 Flat\n"
|
||||||
"OpMemberDecorate %Point 1 Offset 16\n"},
|
"OpMemberDecorate %Point 1 Offset 16\n"},
|
||||||
// Multiple OpGroupMemberDecorate using the same
|
// Multiple OpGroupMemberDecorate using the same
|
||||||
// decoration group.
|
// decoration group.
|
||||||
{"OpName %group \"group\"\n"
|
{"OpName %group \"group\"\n"
|
||||||
"OpDecorate %group Flat\n"
|
"OpDecorate %group Flat\n"
|
||||||
"OpDecorate %group NoPerspective\n"
|
"OpDecorate %group NoPerspective\n"
|
||||||
"OpDecorate %group Offset 8\n"
|
"OpDecorate %group Offset 8\n"
|
||||||
"%group = OpDecorationGroup\n"
|
"%group = OpDecorationGroup\n"
|
||||||
"OpGroupMemberDecorate %group %Point 2\n"
|
"OpGroupMemberDecorate %group %Point 2\n"
|
||||||
"OpGroupMemberDecorate %group %Camera 1\n",
|
"OpGroupMemberDecorate %group %Camera 1\n",
|
||||||
"OpMemberDecorate %Point 2 Flat\n"
|
"OpMemberDecorate %Point 2 Flat\n"
|
||||||
"OpMemberDecorate %Camera 1 Flat\n"
|
"OpMemberDecorate %Camera 1 Flat\n"
|
||||||
"OpMemberDecorate %Point 2 NoPerspective\n"
|
"OpMemberDecorate %Point 2 NoPerspective\n"
|
||||||
"OpMemberDecorate %Camera 1 NoPerspective\n"
|
"OpMemberDecorate %Camera 1 NoPerspective\n"
|
||||||
"OpMemberDecorate %Point 2 Offset 8\n"
|
"OpMemberDecorate %Point 2 Offset 8\n"
|
||||||
"OpMemberDecorate %Camera 1 Offset 8\n"},
|
"OpMemberDecorate %Camera 1 Offset 8\n"},
|
||||||
// Two groups of member decorations, interleaved.
|
// Two groups of member decorations, interleaved.
|
||||||
// Decoration is with and without operands.
|
// Decoration is with and without operands.
|
||||||
{"OpName %group0 \"group0\"\n"
|
{"OpName %group0 \"group0\"\n"
|
||||||
"OpName %group1 \"group1\"\n"
|
"OpName %group1 \"group1\"\n"
|
||||||
"OpDecorate %group0 Flat\n"
|
"OpDecorate %group0 Flat\n"
|
||||||
"OpDecorate %group0 Offset 8\n"
|
"OpDecorate %group0 Offset 8\n"
|
||||||
"OpDecorate %group1 NoPerspective\n"
|
"OpDecorate %group1 NoPerspective\n"
|
||||||
"OpDecorate %group1 Offset 16\n"
|
"OpDecorate %group1 Offset 16\n"
|
||||||
"%group0 = OpDecorationGroup\n"
|
"%group0 = OpDecorationGroup\n"
|
||||||
"%group1 = OpDecorationGroup\n"
|
"%group1 = OpDecorationGroup\n"
|
||||||
"OpGroupMemberDecorate %group0 %Point 0\n"
|
"OpGroupMemberDecorate %group0 %Point 0\n"
|
||||||
"OpGroupMemberDecorate %group1 %Point 2\n",
|
"OpGroupMemberDecorate %group1 %Point 2\n",
|
||||||
"OpMemberDecorate %Point 0 Flat\n"
|
"OpMemberDecorate %Point 0 Flat\n"
|
||||||
"OpMemberDecorate %Point 0 Offset 8\n"
|
"OpMemberDecorate %Point 0 Offset 8\n"
|
||||||
"OpMemberDecorate %Point 2 NoPerspective\n"
|
"OpMemberDecorate %Point 2 NoPerspective\n"
|
||||||
"OpMemberDecorate %Point 2 Offset 16\n"},
|
"OpMemberDecorate %Point 2 Offset 16\n"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(UnrelatedDecorations, FlattenDecorationTest,
|
INSTANTIATE_TEST_SUITE_P(UnrelatedDecorations, FlattenDecorationTest,
|
||||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||||
// A non-group non-member decoration is untouched.
|
// A non-group non-member decoration is untouched.
|
||||||
{"OpDecorate %hue Centroid\n"
|
{"OpDecorate %hue Centroid\n"
|
||||||
"OpDecorate %saturation Flat\n",
|
"OpDecorate %saturation Flat\n",
|
||||||
"OpDecorate %hue Centroid\n"
|
"OpDecorate %hue Centroid\n"
|
||||||
"OpDecorate %saturation Flat\n"},
|
"OpDecorate %saturation Flat\n"},
|
||||||
// A non-group member decoration is untouched.
|
// A non-group member decoration is untouched.
|
||||||
{"OpMemberDecorate %Point 0 Offset 0\n"
|
{"OpMemberDecorate %Point 0 Offset 0\n"
|
||||||
"OpMemberDecorate %Point 1 Offset 4\n"
|
"OpMemberDecorate %Point 1 Offset 4\n"
|
||||||
"OpMemberDecorate %Point 1 Flat\n",
|
"OpMemberDecorate %Point 1 Flat\n",
|
||||||
"OpMemberDecorate %Point 0 Offset 0\n"
|
"OpMemberDecorate %Point 0 Offset 0\n"
|
||||||
"OpMemberDecorate %Point 1 Offset 4\n"
|
"OpMemberDecorate %Point 1 Offset 4\n"
|
||||||
"OpMemberDecorate %Point 1 Flat\n"},
|
"OpMemberDecorate %Point 1 Flat\n"},
|
||||||
// A non-group non-member decoration survives any
|
// A non-group non-member decoration survives any
|
||||||
// replacement of group decorations.
|
// replacement of group decorations.
|
||||||
{"OpName %group \"group\"\n"
|
{"OpName %group \"group\"\n"
|
||||||
"OpDecorate %group Flat\n"
|
"OpDecorate %group Flat\n"
|
||||||
"OpDecorate %hue Centroid\n"
|
"OpDecorate %hue Centroid\n"
|
||||||
"OpDecorate %group NoPerspective\n"
|
"OpDecorate %group NoPerspective\n"
|
||||||
"%group = OpDecorationGroup\n"
|
"%group = OpDecorationGroup\n"
|
||||||
"OpGroupDecorate %group %hue %saturation\n",
|
"OpGroupDecorate %group %hue %saturation\n",
|
||||||
"OpDecorate %hue Flat\n"
|
"OpDecorate %hue Flat\n"
|
||||||
"OpDecorate %saturation Flat\n"
|
"OpDecorate %saturation Flat\n"
|
||||||
"OpDecorate %hue Centroid\n"
|
"OpDecorate %hue Centroid\n"
|
||||||
"OpDecorate %hue NoPerspective\n"
|
"OpDecorate %hue NoPerspective\n"
|
||||||
"OpDecorate %saturation NoPerspective\n"},
|
"OpDecorate %saturation NoPerspective\n"},
|
||||||
// A non-group member decoration survives any
|
// A non-group member decoration survives any
|
||||||
// replacement of group decorations.
|
// replacement of group decorations.
|
||||||
{"OpDecorate %group Offset 0\n"
|
{"OpDecorate %group Offset 0\n"
|
||||||
"OpDecorate %group Flat\n"
|
"OpDecorate %group Flat\n"
|
||||||
"OpMemberDecorate %Point 1 Offset 4\n"
|
"OpMemberDecorate %Point 1 Offset 4\n"
|
||||||
"%group = OpDecorationGroup\n"
|
"%group = OpDecorationGroup\n"
|
||||||
"OpGroupMemberDecorate %group %Point 0\n",
|
"OpGroupMemberDecorate %group %Point 0\n",
|
||||||
"OpMemberDecorate %Point 0 Offset 0\n"
|
"OpMemberDecorate %Point 0 Offset 0\n"
|
||||||
"OpMemberDecorate %Point 0 Flat\n"
|
"OpMemberDecorate %Point 0 Flat\n"
|
||||||
"OpMemberDecorate %Point 1 Offset 4\n"},
|
"OpMemberDecorate %Point 1 Offset 4\n"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace opt
|
} // namespace opt
|
||||||
|
@ -224,7 +224,7 @@ TEST_P(FoldSpecConstantOpAndCompositePassTest, ParamTestCase) {
|
|||||||
|
|
||||||
// Tests that OpSpecConstantComposite opcodes are replace with
|
// Tests that OpSpecConstantComposite opcodes are replace with
|
||||||
// OpConstantComposite correctly.
|
// OpConstantComposite correctly.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Composite, FoldSpecConstantOpAndCompositePassTest,
|
Composite, FoldSpecConstantOpAndCompositePassTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||||
@ -330,7 +330,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
})));
|
})));
|
||||||
|
|
||||||
// Tests for operations that resulting in different types.
|
// Tests for operations that resulting in different types.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Cast, FoldSpecConstantOpAndCompositePassTest,
|
Cast, FoldSpecConstantOpAndCompositePassTest,
|
||||||
::testing::ValuesIn(
|
::testing::ValuesIn(
|
||||||
std::vector<FoldSpecConstantOpAndCompositePassTestCase>({
|
std::vector<FoldSpecConstantOpAndCompositePassTestCase>({
|
||||||
@ -567,7 +567,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
|
|
||||||
// Tests about boolean scalar logical operations and comparison operations with
|
// Tests about boolean scalar logical operations and comparison operations with
|
||||||
// scalar int/uint type.
|
// scalar int/uint type.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Logical, FoldSpecConstantOpAndCompositePassTest,
|
Logical, FoldSpecConstantOpAndCompositePassTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||||
@ -636,7 +636,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
})));
|
})));
|
||||||
|
|
||||||
// Tests about arithmetic operations for scalar int and uint types.
|
// Tests about arithmetic operations for scalar int and uint types.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ScalarArithmetic, FoldSpecConstantOpAndCompositePassTest,
|
ScalarArithmetic, FoldSpecConstantOpAndCompositePassTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||||
@ -821,7 +821,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
})));
|
})));
|
||||||
|
|
||||||
// Tests about arithmetic operations for vector int and uint types.
|
// Tests about arithmetic operations for vector int and uint types.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
VectorArithmetic, FoldSpecConstantOpAndCompositePassTest,
|
VectorArithmetic, FoldSpecConstantOpAndCompositePassTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||||
@ -1043,7 +1043,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
})));
|
})));
|
||||||
|
|
||||||
// Tests for SpecConstantOp CompositeExtract instruction
|
// Tests for SpecConstantOp CompositeExtract instruction
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
CompositeExtract, FoldSpecConstantOpAndCompositePassTest,
|
CompositeExtract, FoldSpecConstantOpAndCompositePassTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||||
@ -1217,7 +1217,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
})));
|
})));
|
||||||
|
|
||||||
// Tests the swizzle operations for spec const vectors.
|
// Tests the swizzle operations for spec const vectors.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
VectorShuffle, FoldSpecConstantOpAndCompositePassTest,
|
VectorShuffle, FoldSpecConstantOpAndCompositePassTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||||
@ -1310,7 +1310,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
})));
|
})));
|
||||||
|
|
||||||
// Test with long use-def chain.
|
// Test with long use-def chain.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
LongDefUseChain, FoldSpecConstantOpAndCompositePassTest,
|
LongDefUseChain, FoldSpecConstantOpAndCompositePassTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||||
|
@ -265,7 +265,7 @@ const std::string& HeaderWithNaN() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(TestCase, IntegerInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(TestCase, IntegerInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold 0*n
|
// Test case 0: fold 0*n
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -590,7 +590,7 @@ TEST_P(IntVectorInstructionFoldingTest, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(TestCase, IntVectorInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(TestCase, IntVectorInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold 0*n
|
// Test case 0: fold 0*n
|
||||||
InstructionFoldingCase<std::vector<uint32_t>>(
|
InstructionFoldingCase<std::vector<uint32_t>>(
|
||||||
@ -667,7 +667,7 @@ TEST_P(BooleanInstructionFoldingTest, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(TestCase, BooleanInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(TestCase, BooleanInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold true || n
|
// Test case 0: fold true || n
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -871,7 +871,7 @@ INSTANTIATE_TEST_CASE_P(TestCase, BooleanInstructionFoldingTest,
|
|||||||
2, true)
|
2, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(FClampAndCmpLHS, BooleanInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(FClampAndCmpLHS, BooleanInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold 0.0 > clamp(n, 0.0, 1.0)
|
// Test case 0: fold 0.0 > clamp(n, 0.0, 1.0)
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -1051,7 +1051,7 @@ INSTANTIATE_TEST_CASE_P(FClampAndCmpLHS, BooleanInstructionFoldingTest,
|
|||||||
2, false)
|
2, false)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(FClampAndCmpRHS, BooleanInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(FClampAndCmpRHS, BooleanInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold clamp(n, 0.0, 1.0) > 1.0
|
// Test case 0: fold clamp(n, 0.0, 1.0) > 1.0
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -1281,7 +1281,7 @@ TEST_P(FloatInstructionFoldingTest, Case) {
|
|||||||
// specification.
|
// specification.
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(FloatConstantFoldingTest, FloatInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(FloatConstantFoldingTest, FloatInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Fold 2.0 - 1.0
|
// Test case 0: Fold 2.0 - 1.0
|
||||||
InstructionFoldingCase<float>(
|
InstructionFoldingCase<float>(
|
||||||
@ -1424,7 +1424,7 @@ TEST_P(DoubleInstructionFoldingTest, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(DoubleConstantFoldingTest, DoubleInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(DoubleConstantFoldingTest, DoubleInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Fold 2.0 - 1.0
|
// Test case 0: Fold 2.0 - 1.0
|
||||||
InstructionFoldingCase<double>(
|
InstructionFoldingCase<double>(
|
||||||
@ -1534,7 +1534,7 @@ INSTANTIATE_TEST_CASE_P(DoubleConstantFoldingTest, DoubleInstructionFoldingTest,
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(DoubleOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(DoubleOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold 1.0 == 2.0
|
// Test case 0: fold 1.0 == 2.0
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -1666,7 +1666,7 @@ INSTANTIATE_TEST_CASE_P(DoubleOrderedCompareConstantFoldingTest, BooleanInstruct
|
|||||||
2, true)
|
2, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DoubleUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(DoubleUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold 1.0 == 2.0
|
// Test case 0: fold 1.0 == 2.0
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -1798,7 +1798,7 @@ INSTANTIATE_TEST_CASE_P(DoubleUnorderedCompareConstantFoldingTest, BooleanInstru
|
|||||||
2, true)
|
2, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(FloatOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(FloatOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold 1.0 == 2.0
|
// Test case 0: fold 1.0 == 2.0
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -1930,7 +1930,7 @@ INSTANTIATE_TEST_CASE_P(FloatOrderedCompareConstantFoldingTest, BooleanInstructi
|
|||||||
2, true)
|
2, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(FloatUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(FloatUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold 1.0 == 2.0
|
// Test case 0: fold 1.0 == 2.0
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -2062,7 +2062,7 @@ INSTANTIATE_TEST_CASE_P(FloatUnorderedCompareConstantFoldingTest, BooleanInstruc
|
|||||||
2, true)
|
2, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DoubleNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(DoubleNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold NaN == 0 (ord)
|
// Test case 0: fold NaN == 0 (ord)
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -2098,7 +2098,7 @@ INSTANTIATE_TEST_CASE_P(DoubleNaNCompareConstantFoldingTest, BooleanInstructionF
|
|||||||
2, true)
|
2, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(FloatNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(FloatNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold NaN == 0 (ord)
|
// Test case 0: fold NaN == 0 (ord)
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -2180,7 +2180,7 @@ TEST_P(IntegerInstructionFoldingTestWithMap, Case) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(TestCase, IntegerInstructionFoldingTestWithMap,
|
INSTANTIATE_TEST_SUITE_P(TestCase, IntegerInstructionFoldingTestWithMap,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold %3 = 0; %3 * n
|
// Test case 0: fold %3 = 0; %3 * n
|
||||||
InstructionFoldingCaseWithMap<uint32_t>(
|
InstructionFoldingCaseWithMap<uint32_t>(
|
||||||
@ -2230,7 +2230,7 @@ TEST_P(BooleanInstructionFoldingTestWithMap, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(TestCase, BooleanInstructionFoldingTestWithMap,
|
INSTANTIATE_TEST_SUITE_P(TestCase, BooleanInstructionFoldingTestWithMap,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold %3 = true; %3 || n
|
// Test case 0: fold %3 = true; %3 || n
|
||||||
InstructionFoldingCaseWithMap<bool>(
|
InstructionFoldingCaseWithMap<bool>(
|
||||||
@ -2280,7 +2280,7 @@ TEST_P(GeneralInstructionFoldingTest, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(IntegerArithmeticTestCases, GeneralInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(IntegerArithmeticTestCases, GeneralInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Don't fold n * m
|
// Test case 0: Don't fold n * m
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -2740,7 +2740,7 @@ INSTANTIATE_TEST_CASE_P(IntegerArithmeticTestCases, GeneralInstructionFoldingTes
|
|||||||
2, 3)
|
2, 3)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(CompositeExtractFoldingTest, GeneralInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(CompositeExtractFoldingTest, GeneralInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold Insert feeding extract
|
// Test case 0: fold Insert feeding extract
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -2888,7 +2888,7 @@ INSTANTIATE_TEST_CASE_P(CompositeExtractFoldingTest, GeneralInstructionFoldingTe
|
|||||||
4, INT_7_ID)
|
4, INT_7_ID)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(CompositeConstructFoldingTest, GeneralInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(CompositeConstructFoldingTest, GeneralInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold Extracts feeding construct
|
// Test case 0: fold Extracts feeding construct
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -2951,7 +2951,7 @@ INSTANTIATE_TEST_CASE_P(CompositeConstructFoldingTest, GeneralInstructionFolding
|
|||||||
2, VEC2_0_ID)
|
2, VEC2_0_ID)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(PhiFoldingTest, GeneralInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(PhiFoldingTest, GeneralInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Fold phi with the same values for all edges.
|
// Test case 0: Fold phi with the same values for all edges.
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -2993,7 +2993,7 @@ INSTANTIATE_TEST_CASE_P(PhiFoldingTest, GeneralInstructionFoldingTest,
|
|||||||
2, 0)
|
2, 0)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(FloatRedundantFoldingTest, GeneralInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(FloatRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Don't fold n + 1.0
|
// Test case 0: Don't fold n + 1.0
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -3211,7 +3211,7 @@ INSTANTIATE_TEST_CASE_P(FloatRedundantFoldingTest, GeneralInstructionFoldingTest
|
|||||||
2, 0)
|
2, 0)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DoubleRedundantFoldingTest, GeneralInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(DoubleRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Don't fold n + 1.0
|
// Test case 0: Don't fold n + 1.0
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -3371,7 +3371,7 @@ INSTANTIATE_TEST_CASE_P(DoubleRedundantFoldingTest, GeneralInstructionFoldingTes
|
|||||||
2, 4)
|
2, 4)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(FloatVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(FloatVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Don't fold a * vec4(0.0, 0.0, 0.0, 1.0)
|
// Test case 0: Don't fold a * vec4(0.0, 0.0, 0.0, 1.0)
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -3405,7 +3405,7 @@ INSTANTIATE_TEST_CASE_P(FloatVectorRedundantFoldingTest, GeneralInstructionFoldi
|
|||||||
2, 3)
|
2, 3)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DoubleVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(DoubleVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Don't fold a * vec4(0.0, 0.0, 0.0, 1.0)
|
// Test case 0: Don't fold a * vec4(0.0, 0.0, 0.0, 1.0)
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -3439,7 +3439,7 @@ INSTANTIATE_TEST_CASE_P(DoubleVectorRedundantFoldingTest, GeneralInstructionFold
|
|||||||
2, 3)
|
2, 3)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(IntegerRedundantFoldingTest, GeneralInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(IntegerRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Don't fold n + 1
|
// Test case 0: Don't fold n + 1
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -3523,7 +3523,7 @@ INSTANTIATE_TEST_CASE_P(IntegerRedundantFoldingTest, GeneralInstructionFoldingTe
|
|||||||
2, 3)
|
2, 3)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ClampAndCmpLHS, GeneralInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(ClampAndCmpLHS, GeneralInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Don't Fold 0.0 < clamp(-1, 1)
|
// Test case 0: Don't Fold 0.0 < clamp(-1, 1)
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -3659,7 +3659,7 @@ INSTANTIATE_TEST_CASE_P(ClampAndCmpLHS, GeneralInstructionFoldingTest,
|
|||||||
2, 0)
|
2, 0)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ClampAndCmpRHS, GeneralInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(ClampAndCmpRHS, GeneralInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Don't Fold clamp(-1, 1) < 0.0
|
// Test case 0: Don't Fold clamp(-1, 1) < 0.0
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -3795,7 +3795,7 @@ INSTANTIATE_TEST_CASE_P(ClampAndCmpRHS, GeneralInstructionFoldingTest,
|
|||||||
2, 0)
|
2, 0)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(FToIConstantFoldingTest, IntegerInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(FToIConstantFoldingTest, IntegerInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Fold int(3.0)
|
// Test case 0: Fold int(3.0)
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -3815,7 +3815,7 @@ INSTANTIATE_TEST_CASE_P(FToIConstantFoldingTest, IntegerInstructionFoldingTest,
|
|||||||
2, 3)
|
2, 3)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(IToFConstantFoldingTest, FloatInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(IToFConstantFoldingTest, FloatInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Fold float(3)
|
// Test case 0: Fold float(3)
|
||||||
InstructionFoldingCase<float>(
|
InstructionFoldingCase<float>(
|
||||||
@ -3870,7 +3870,7 @@ TEST_P(ToNegateFoldingTest, Case) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(FloatRedundantSubFoldingTest, ToNegateFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(FloatRedundantSubFoldingTest, ToNegateFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Don't fold 1.0 - n
|
// Test case 0: Don't fold 1.0 - n
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -3914,7 +3914,7 @@ INSTANTIATE_TEST_CASE_P(FloatRedundantSubFoldingTest, ToNegateFoldingTest,
|
|||||||
2, 3)
|
2, 3)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DoubleRedundantSubFoldingTest, ToNegateFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(DoubleRedundantSubFoldingTest, ToNegateFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Don't fold 1.0 - n
|
// Test case 0: Don't fold 1.0 - n
|
||||||
InstructionFoldingCase<uint32_t>(
|
InstructionFoldingCase<uint32_t>(
|
||||||
@ -3981,7 +3981,7 @@ TEST_P(MatchingInstructionFoldingTest, Case) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(RedundantIntegerMatching, MatchingInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(RedundantIntegerMatching, MatchingInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Fold 0 + n (change sign)
|
// Test case 0: Fold 0 + n (change sign)
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -4011,7 +4011,7 @@ INSTANTIATE_TEST_CASE_P(RedundantIntegerMatching, MatchingInstructionFoldingTest
|
|||||||
2, true)
|
2, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(MergeNegateTest, MatchingInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(MergeNegateTest, MatchingInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold consecutive fnegate
|
// Test case 0: fold consecutive fnegate
|
||||||
// -(-x) = x
|
// -(-x) = x
|
||||||
@ -4348,7 +4348,7 @@ INSTANTIATE_TEST_CASE_P(MergeNegateTest, MatchingInstructionFoldingTest,
|
|||||||
2, true)
|
2, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ReciprocalFDivTest, MatchingInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(ReciprocalFDivTest, MatchingInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: scalar reicprocal
|
// Test case 0: scalar reicprocal
|
||||||
// x / 0.5 = x * 2.0
|
// x / 0.5 = x * 2.0
|
||||||
@ -4429,7 +4429,7 @@ INSTANTIATE_TEST_CASE_P(ReciprocalFDivTest, MatchingInstructionFoldingTest,
|
|||||||
3, false)
|
3, false)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(MergeMulTest, MatchingInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(MergeMulTest, MatchingInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: fold consecutive fmuls
|
// Test case 0: fold consecutive fmuls
|
||||||
// (x * 3.0) * 2.0 = x * 6.0
|
// (x * 3.0) * 2.0 = x * 6.0
|
||||||
@ -4845,7 +4845,7 @@ INSTANTIATE_TEST_CASE_P(MergeMulTest, MatchingInstructionFoldingTest,
|
|||||||
5, true)
|
5, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(MergeDivTest, MatchingInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(MergeDivTest, MatchingInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: merge consecutive fdiv
|
// Test case 0: merge consecutive fdiv
|
||||||
// 4.0 / (2.0 / x) = 2.0 * x
|
// 4.0 / (2.0 / x) = 2.0 * x
|
||||||
@ -5091,7 +5091,7 @@ INSTANTIATE_TEST_CASE_P(MergeDivTest, MatchingInstructionFoldingTest,
|
|||||||
5, true)
|
5, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(MergeAddTest, MatchingInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(MergeAddTest, MatchingInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: merge add of negate
|
// Test case 0: merge add of negate
|
||||||
// (-x) + 2 = 2 - x
|
// (-x) + 2 = 2 - x
|
||||||
@ -5299,7 +5299,7 @@ INSTANTIATE_TEST_CASE_P(MergeAddTest, MatchingInstructionFoldingTest,
|
|||||||
4, true)
|
4, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(MergeSubTest, MatchingInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(MergeSubTest, MatchingInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: merge sub of negate
|
// Test case 0: merge sub of negate
|
||||||
// (-x) - 2 = -2 - x
|
// (-x) - 2 = -2 - x
|
||||||
@ -5524,7 +5524,7 @@ INSTANTIATE_TEST_CASE_P(MergeSubTest, MatchingInstructionFoldingTest,
|
|||||||
4, true)
|
4, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(SelectFoldingTest, MatchingInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(SelectFoldingTest, MatchingInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Fold select with the same values for both sides
|
// Test case 0: Fold select with the same values for both sides
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -5632,7 +5632,7 @@ INSTANTIATE_TEST_CASE_P(SelectFoldingTest, MatchingInstructionFoldingTest,
|
|||||||
4, true)
|
4, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(CompositeExtractMatchingTest, MatchingInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(CompositeExtractMatchingTest, MatchingInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Extracting from result of consecutive shuffles of differing
|
// Test case 0: Extracting from result of consecutive shuffles of differing
|
||||||
// size.
|
// size.
|
||||||
@ -5775,7 +5775,7 @@ INSTANTIATE_TEST_CASE_P(CompositeExtractMatchingTest, MatchingInstructionFolding
|
|||||||
4, true)
|
4, true)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DotProductMatchingTest, MatchingInstructionFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(DotProductMatchingTest, MatchingInstructionFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Using OpDot to extract last element.
|
// Test case 0: Using OpDot to extract last element.
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -5891,7 +5891,7 @@ TEST_P(MatchingInstructionWithNoResultFoldingTest, Case) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(StoreMatchingTest, MatchingInstructionWithNoResultFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(StoreMatchingTest, MatchingInstructionWithNoResultFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Remove store of undef.
|
// Test case 0: Remove store of undef.
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
@ -5920,7 +5920,7 @@ INSTANTIATE_TEST_CASE_P(StoreMatchingTest, MatchingInstructionWithNoResultFoldin
|
|||||||
0 /* OpStore */, false)
|
0 /* OpStore */, false)
|
||||||
));
|
));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(VectorShuffleMatchingTest, MatchingInstructionWithNoResultFoldingTest,
|
INSTANTIATE_TEST_SUITE_P(VectorShuffleMatchingTest, MatchingInstructionWithNoResultFoldingTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Test case 0: Basic test 1
|
// Test case 0: Basic test 1
|
||||||
InstructionFoldingCase<bool>(
|
InstructionFoldingCase<bool>(
|
||||||
|
@ -47,7 +47,7 @@ TEST_P(FreezeSpecConstantValueTypeTest, PrimaryType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test each primary type.
|
// Test each primary type.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
PrimaryTypeSpecConst, FreezeSpecConstantValueTypeTest,
|
PrimaryTypeSpecConst, FreezeSpecConstantValueTypeTest,
|
||||||
::testing::ValuesIn(std::vector<FreezeSpecConstantValueTypeTestCase>({
|
::testing::ValuesIn(std::vector<FreezeSpecConstantValueTypeTestCase>({
|
||||||
// Type declaration, original spec constant definition, expected frozen
|
// Type declaration, original spec constant definition, expected frozen
|
||||||
|
@ -50,7 +50,7 @@ TEST_P(DefaultValuesStringParsingTest, TestCase) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidString, DefaultValuesStringParsingTest,
|
ValidString, DefaultValuesStringParsingTest,
|
||||||
::testing::ValuesIn(std::vector<DefaultValuesStringParsingTestCase>{
|
::testing::ValuesIn(std::vector<DefaultValuesStringParsingTestCase>{
|
||||||
// 0. empty map
|
// 0. empty map
|
||||||
@ -93,7 +93,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"100:1.5e-13", true, SpecIdToValueStrMap{{100, "1.5e-13"}}},
|
{"100:1.5e-13", true, SpecIdToValueStrMap{{100, "1.5e-13"}}},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
InvalidString, DefaultValuesStringParsingTest,
|
InvalidString, DefaultValuesStringParsingTest,
|
||||||
::testing::ValuesIn(std::vector<DefaultValuesStringParsingTestCase>{
|
::testing::ValuesIn(std::vector<DefaultValuesStringParsingTestCase>{
|
||||||
// 0. missing default value
|
// 0. missing default value
|
||||||
@ -148,7 +148,7 @@ TEST_P(SetSpecConstantDefaultValueInStringFormParamTest, TestCase) {
|
|||||||
tc.code, tc.expected, /* skip_nop = */ false, tc.default_values);
|
tc.code, tc.expected, /* skip_nop = */ false, tc.default_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidCases, SetSpecConstantDefaultValueInStringFormParamTest,
|
ValidCases, SetSpecConstantDefaultValueInStringFormParamTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
SetSpecConstantDefaultValueInStringFormTestCase>{
|
SetSpecConstantDefaultValueInStringFormTestCase>{
|
||||||
@ -445,7 +445,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
InvalidCases, SetSpecConstantDefaultValueInStringFormParamTest,
|
InvalidCases, SetSpecConstantDefaultValueInStringFormParamTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
SetSpecConstantDefaultValueInStringFormTestCase>{
|
SetSpecConstantDefaultValueInStringFormTestCase>{
|
||||||
@ -610,7 +610,7 @@ TEST_P(SetSpecConstantDefaultValueInBitPatternFormParamTest, TestCase) {
|
|||||||
tc.code, tc.expected, /* skip_nop = */ false, tc.default_values);
|
tc.code, tc.expected, /* skip_nop = */ false, tc.default_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest,
|
ValidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
SetSpecConstantDefaultValueInBitPatternFormTestCase>{
|
SetSpecConstantDefaultValueInBitPatternFormTestCase>{
|
||||||
@ -937,7 +937,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
InvalidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest,
|
InvalidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest,
|
||||||
::testing::ValuesIn(std::vector<
|
::testing::ValuesIn(std::vector<
|
||||||
SetSpecConstantDefaultValueInBitPatternFormTestCase>{
|
SetSpecConstantDefaultValueInBitPatternFormTestCase>{
|
||||||
|
@ -89,7 +89,7 @@ TEST_P(StripDebugInfoTest, Kind) {
|
|||||||
|
|
||||||
// Test each possible non-line debug instruction.
|
// Test each possible non-line debug instruction.
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SingleKindDebugInst, StripDebugInfoTest,
|
SingleKindDebugInst, StripDebugInfoTest,
|
||||||
::testing::ValuesIn(std::vector<const char*>({
|
::testing::ValuesIn(std::vector<const char*>({
|
||||||
"OpSourceContinued \"I'm a happy shader! Yay! ;)\"",
|
"OpSourceContinued \"I'm a happy shader! Yay! ;)\"",
|
||||||
|
@ -354,8 +354,14 @@ TEST_P(UnifyFrontEndConstantParamTest, TestCase) {
|
|||||||
Check(expected_builder, test_builder);
|
Check(expected_builder, test_builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Case, UnifyFrontEndConstantParamTest,
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
::testing::ValuesIn(std::vector<UnifyConstantTestCase>({
|
Case, UnifyFrontEndConstantParamTest,
|
||||||
|
::
|
||||||
|
testing::
|
||||||
|
ValuesIn(
|
||||||
|
std::
|
||||||
|
vector<UnifyConstantTestCase>(
|
||||||
|
{
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// basic tests for scalar constants
|
// basic tests for scalar constants
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,7 @@ TEST_P(FindAndReplaceTest, SubstringReplacement) {
|
|||||||
<< " expected string: " << GetParam().expected_str;
|
<< " expected string: " << GetParam().expected_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SubstringReplacement, FindAndReplaceTest,
|
SubstringReplacement, FindAndReplaceTest,
|
||||||
::testing::ValuesIn(std::vector<SubstringReplacementTestCase>({
|
::testing::ValuesIn(std::vector<SubstringReplacementTestCase>({
|
||||||
// orig string, find substring, replace substring, expected string,
|
// orig string, find substring, replace substring, expected string,
|
||||||
|
@ -45,8 +45,8 @@ TEST_P(TargetEnvTest, ValidSpirvVersion) {
|
|||||||
ASSERT_THAT(spirv_version, AnyOf(0x10000, 0x10100, 0x10200, 0x10300));
|
ASSERT_THAT(spirv_version, AnyOf(0x10000, 0x10100, 0x10200, 0x10300));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllTargetEnvs, TargetEnvTest,
|
INSTANTIATE_TEST_SUITE_P(AllTargetEnvs, TargetEnvTest,
|
||||||
ValuesIn(spvtest::AllTargetEnvironments()));
|
ValuesIn(spvtest::AllTargetEnvironments()));
|
||||||
|
|
||||||
TEST(GetContextTest, InvalidTargetEnvProducesNull) {
|
TEST(GetContextTest, InvalidTargetEnvProducesNull) {
|
||||||
// Use a value beyond the last valid enum value.
|
// Use a value beyond the last valid enum value.
|
||||||
@ -70,7 +70,7 @@ TEST_P(TargetParseTest, InvalidTargetEnvProducesNull) {
|
|||||||
EXPECT_THAT(env, Eq(GetParam().env));
|
EXPECT_THAT(env, Eq(GetParam().env));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TargetParsing, TargetParseTest,
|
TargetParsing, TargetParseTest,
|
||||||
ValuesIn(std::vector<ParseCase>{
|
ValuesIn(std::vector<ParseCase>{
|
||||||
{"spv1.0", true, SPV_ENV_UNIVERSAL_1_0},
|
{"spv1.0", true, SPV_ENV_UNIVERSAL_1_0},
|
||||||
|
@ -106,7 +106,7 @@ TEST_P(GoodStringTest, GoodStrings) {
|
|||||||
EXPECT_EQ(std::get<1>(GetParam()), l.str);
|
EXPECT_EQ(std::get<1>(GetParam()), l.str);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextLiteral, GoodStringTest,
|
TextLiteral, GoodStringTest,
|
||||||
::testing::ValuesIn(std::vector<std::pair<const char*, const char*>>{
|
::testing::ValuesIn(std::vector<std::pair<const char*, const char*>>{
|
||||||
{R"("-")", "-"},
|
{R"("-")", "-"},
|
||||||
@ -121,7 +121,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"\"\xE4\xBA\xB2\"", "\xE4\xBA\xB2"},
|
{"\"\xE4\xBA\xB2\"", "\xE4\xBA\xB2"},
|
||||||
{"\"\\\xE4\xBA\xB2\"", "\xE4\xBA\xB2"},
|
{"\"\\\xE4\xBA\xB2\"", "\xE4\xBA\xB2"},
|
||||||
{"\"this \\\" and this \\\\ and \\\xE4\xBA\xB2\"",
|
{"\"this \\\" and this \\\\ and \\\xE4\xBA\xB2\"",
|
||||||
"this \" and this \\ and \xE4\xBA\xB2"}}), );
|
"this \" and this \\ and \xE4\xBA\xB2"}}));
|
||||||
|
|
||||||
TEST(TextLiteral, StringTooLong) {
|
TEST(TextLiteral, StringTooLong) {
|
||||||
spv_literal_t l;
|
spv_literal_t l;
|
||||||
@ -230,7 +230,7 @@ TextLiteralCase Make_Bad_Unsigned(uint32_t bitwidth, const char* text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DecimalIntegers, IntegerTest,
|
DecimalIntegers, IntegerTest,
|
||||||
::testing::ValuesIn(std::vector<TextLiteralCase>{
|
::testing::ValuesIn(std::vector<TextLiteralCase>{
|
||||||
// Check max value and overflow value for 1-bit numbers.
|
// Check max value and overflow value for 1-bit numbers.
|
||||||
@ -277,7 +277,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
Make_Ok__Unsigned(64, "18446744073709551615", {0xffffffff, 0xffffffff}),
|
Make_Ok__Unsigned(64, "18446744073709551615", {0xffffffff, 0xffffffff}),
|
||||||
Make_Ok__Signed(64, "-9223372036854775808", {0x00000000, 0x80000000}),
|
Make_Ok__Signed(64, "-9223372036854775808", {0x00000000, 0x80000000}),
|
||||||
|
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
using IntegerLeadingMinusTest =
|
using IntegerLeadingMinusTest =
|
||||||
@ -290,7 +290,7 @@ TEST_P(IntegerLeadingMinusTest, CantHaveLeadingMinusOnUnsigned) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DecimalAndHexIntegers, IntegerLeadingMinusTest,
|
DecimalAndHexIntegers, IntegerLeadingMinusTest,
|
||||||
::testing::ValuesIn(std::vector<TextLiteralCase>{
|
::testing::ValuesIn(std::vector<TextLiteralCase>{
|
||||||
// Unsigned numbers never allow a leading minus sign.
|
// Unsigned numbers never allow a leading minus sign.
|
||||||
@ -303,10 +303,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
Make_Bad_Unsigned(64, "-0"),
|
Make_Bad_Unsigned(64, "-0"),
|
||||||
Make_Bad_Unsigned(64, "-0x0"),
|
Make_Bad_Unsigned(64, "-0x0"),
|
||||||
Make_Bad_Unsigned(64, "-0x1"),
|
Make_Bad_Unsigned(64, "-0x1"),
|
||||||
}),);
|
}));
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
HexIntegers, IntegerTest,
|
HexIntegers, IntegerTest,
|
||||||
::testing::ValuesIn(std::vector<TextLiteralCase>{
|
::testing::ValuesIn(std::vector<TextLiteralCase>{
|
||||||
// Check 0x and 0X prefices.
|
// Check 0x and 0X prefices.
|
||||||
@ -370,7 +370,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
Make_Ok__Signed(64, "0x8000000000000000", {0x00000000, 0x80000000}),
|
Make_Ok__Signed(64, "0x8000000000000000", {0x00000000, 0x80000000}),
|
||||||
Make_Ok__Unsigned(64, "0x7fffffffffffffff", {0xffffffff, 0x7fffffff}),
|
Make_Ok__Unsigned(64, "0x7fffffffffffffff", {0xffffffff, 0x7fffffff}),
|
||||||
Make_Ok__Unsigned(64, "0x8000000000000000", {0x00000000, 0x80000000}),
|
Make_Ok__Unsigned(64, "0x8000000000000000", {0x00000000, 0x80000000}),
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
TEST(OverflowIntegerParse, Decimal) {
|
TEST(OverflowIntegerParse, Decimal) {
|
||||||
|
@ -61,7 +61,7 @@ TEST_P(OpDecorateSimpleTest, AnySimpleDecoration) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define CASE(NAME) SpvDecoration##NAME, #NAME
|
#define CASE(NAME) SpvDecoration##NAME, #NAME
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryDecorateSimple, OpDecorateSimpleTest,
|
TextToBinaryDecorateSimple, OpDecorateSimpleTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCase<SpvDecoration>>{
|
ValuesIn(std::vector<EnumCase<SpvDecoration>>{
|
||||||
@ -106,12 +106,12 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{CASE(NoContraction), {}},
|
{CASE(NoContraction), {}},
|
||||||
{CASE(InputAttachmentIndex), {102}},
|
{CASE(InputAttachmentIndex), {102}},
|
||||||
{CASE(Alignment), {16}},
|
{CASE(Alignment), {16}},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateSimpleV11, OpDecorateSimpleTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateSimpleV11, OpDecorateSimpleTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||||
Values(EnumCase<SpvDecoration>{
|
Values(EnumCase<SpvDecoration>{
|
||||||
CASE(MaxByteOffset), {128}})), );
|
CASE(MaxByteOffset), {128}})));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
|
|
||||||
TEST_F(OpDecorateSimpleTest, WrongDecoration) {
|
TEST_F(OpDecorateSimpleTest, WrongDecoration) {
|
||||||
@ -164,7 +164,7 @@ TEST_P(OpDecorateEnumTest, AnyEnumDecoration) {
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) \
|
#define CASE(NAME) \
|
||||||
{ SpvBuiltIn##NAME, #NAME, SpvDecorationBuiltIn, "BuiltIn" }
|
{ SpvBuiltIn##NAME, #NAME, SpvDecorationBuiltIn, "BuiltIn" }
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest,
|
||||||
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
||||||
CASE(Position),
|
CASE(Position),
|
||||||
CASE(PointSize),
|
CASE(PointSize),
|
||||||
@ -209,7 +209,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest,
|
|||||||
CASE(SubgroupLocalInvocationId),
|
CASE(SubgroupLocalInvocationId),
|
||||||
CASE(VertexIndex),
|
CASE(VertexIndex),
|
||||||
CASE(InstanceIndex),
|
CASE(InstanceIndex),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ TEST_F(OpDecorateEnumTest, WrongBuiltIn) {
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) \
|
#define CASE(NAME) \
|
||||||
{ SpvFunctionParameterAttribute##NAME, #NAME, SpvDecorationFuncParamAttr, "FuncParamAttr" }
|
{ SpvFunctionParameterAttribute##NAME, #NAME, SpvDecorationFuncParamAttr, "FuncParamAttr" }
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest,
|
||||||
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
||||||
CASE(Zext),
|
CASE(Zext),
|
||||||
CASE(Sext),
|
CASE(Sext),
|
||||||
@ -232,7 +232,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest,
|
|||||||
CASE(NoCapture),
|
CASE(NoCapture),
|
||||||
CASE(NoWrite),
|
CASE(NoWrite),
|
||||||
CASE(NoReadWrite),
|
CASE(NoReadWrite),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -245,13 +245,13 @@ TEST_F(OpDecorateEnumTest, WrongFuncParamAttr) {
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) \
|
#define CASE(NAME) \
|
||||||
{ SpvFPRoundingMode##NAME, #NAME, SpvDecorationFPRoundingMode, "FPRoundingMode" }
|
{ SpvFPRoundingMode##NAME, #NAME, SpvDecorationFPRoundingMode, "FPRoundingMode" }
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPRoundingMode, OpDecorateEnumTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateFPRoundingMode, OpDecorateEnumTest,
|
||||||
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
||||||
CASE(RTE),
|
CASE(RTE),
|
||||||
CASE(RTZ),
|
CASE(RTZ),
|
||||||
CASE(RTP),
|
CASE(RTP),
|
||||||
CASE(RTN),
|
CASE(RTN),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ TEST_F(OpDecorateEnumTest, WrongFPRoundingMode) {
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(ENUM,NAME) \
|
#define CASE(ENUM,NAME) \
|
||||||
{ SpvFPFastMathMode##ENUM, #NAME, SpvDecorationFPFastMathMode, "FPFastMathMode" }
|
{ SpvFPFastMathMode##ENUM, #NAME, SpvDecorationFPFastMathMode, "FPFastMathMode" }
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest,
|
||||||
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
||||||
CASE(MaskNone, None),
|
CASE(MaskNone, None),
|
||||||
CASE(NotNaNMask, NotNaN),
|
CASE(NotNaNMask, NotNaN),
|
||||||
@ -276,7 +276,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest,
|
|||||||
CASE(NSZMask, NSZ),
|
CASE(NSZMask, NSZ),
|
||||||
CASE(AllowRecipMask, AllowRecip),
|
CASE(AllowRecipMask, AllowRecip),
|
||||||
CASE(FastMask, Fast),
|
CASE(FastMask, Fast),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -329,13 +329,13 @@ TEST_P(OpDecorateLinkageTest, AnyLinkageDecoration) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(ENUM) SpvLinkageType##ENUM, #ENUM
|
#define CASE(ENUM) SpvLinkageType##ENUM, #ENUM
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateLinkage, OpDecorateLinkageTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateLinkage, OpDecorateLinkageTest,
|
||||||
::testing::ValuesIn(std::vector<DecorateLinkageCase>{
|
::testing::ValuesIn(std::vector<DecorateLinkageCase>{
|
||||||
{ CASE(Import), "a" },
|
{ CASE(Import), "a" },
|
||||||
{ CASE(Export), "foo" },
|
{ CASE(Export), "foo" },
|
||||||
{ CASE(Import), "some kind of long name with spaces etc." },
|
{ CASE(Import), "some kind of long name with spaces etc." },
|
||||||
// TODO(dneto): utf-8, escaping, quoting cases.
|
// TODO(dneto): utf-8, escaping, quoting cases.
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -423,7 +423,7 @@ TEST_P(OpMemberDecorateSimpleTest, AnySimpleDecoration) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define CASE(NAME) SpvDecoration##NAME, #NAME
|
#define CASE(NAME) SpvDecoration##NAME, #NAME
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryDecorateSimple, OpMemberDecorateSimpleTest,
|
TextToBinaryDecorateSimple, OpMemberDecorateSimpleTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCase<SpvDecoration>>{
|
ValuesIn(std::vector<EnumCase<SpvDecoration>>{
|
||||||
@ -468,12 +468,12 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{CASE(NoContraction), {}},
|
{CASE(NoContraction), {}},
|
||||||
{CASE(InputAttachmentIndex), {102}},
|
{CASE(InputAttachmentIndex), {102}},
|
||||||
{CASE(Alignment), {16}},
|
{CASE(Alignment), {16}},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryDecorateSimpleV11, OpMemberDecorateSimpleTest,
|
TextToBinaryDecorateSimpleV11, OpMemberDecorateSimpleTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||||
Values(EnumCase<SpvDecoration>{CASE(MaxByteOffset), {128}})), );
|
Values(EnumCase<SpvDecoration>{CASE(MaxByteOffset), {128}})));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
|
|
||||||
TEST_F(OpMemberDecorateSimpleTest, WrongDecoration) {
|
TEST_F(OpMemberDecorateSimpleTest, WrongDecoration) {
|
||||||
|
@ -47,7 +47,7 @@ TEST_P(SamplerAddressingModeTest, AnySamplerAddressingMode) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) { SpvSamplerAddressingMode##NAME, #NAME }
|
#define CASE(NAME) { SpvSamplerAddressingMode##NAME, #NAME }
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinarySamplerAddressingMode, SamplerAddressingModeTest,
|
TextToBinarySamplerAddressingMode, SamplerAddressingModeTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvSamplerAddressingMode>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvSamplerAddressingMode>>{
|
||||||
CASE(None),
|
CASE(None),
|
||||||
@ -55,7 +55,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE(Clamp),
|
CASE(Clamp),
|
||||||
CASE(Repeat),
|
CASE(Repeat),
|
||||||
CASE(RepeatMirrored),
|
CASE(RepeatMirrored),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -79,12 +79,12 @@ TEST_P(SamplerFilterModeTest, AnySamplerFilterMode) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) { SpvSamplerFilterMode##NAME, #NAME}
|
#define CASE(NAME) { SpvSamplerFilterMode##NAME, #NAME}
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinarySamplerFilterMode, SamplerFilterModeTest,
|
TextToBinarySamplerFilterMode, SamplerFilterModeTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvSamplerFilterMode>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvSamplerFilterMode>>{
|
||||||
CASE(Nearest),
|
CASE(Nearest),
|
||||||
CASE(Linear),
|
CASE(Linear),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ TEST_P(OpConstantValidTest, ValidTypes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryOpConstantValid, OpConstantValidTest,
|
TextToBinaryOpConstantValid, OpConstantValidTest,
|
||||||
::testing::ValuesIn(std::vector<ConstantTestCase>{
|
::testing::ValuesIn(std::vector<ConstantTestCase>{
|
||||||
// Check 16 bits
|
// Check 16 bits
|
||||||
@ -232,7 +232,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpTypeInt 64 1", "0x7fffffff",
|
{"OpTypeInt 64 1", "0x7fffffff",
|
||||||
Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
|
Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
|
||||||
MakeInstruction(SpvOpConstant, {1, 2, 0x7fffffffu, 0})})},
|
MakeInstruction(SpvOpConstant, {1, 2, 0x7fffffffu, 0})})},
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// A test case for checking OpConstant with invalid literals with a leading
|
// A test case for checking OpConstant with invalid literals with a leading
|
||||||
@ -255,7 +255,7 @@ TEST_P(OpConstantInvalidLeadingMinusTest, InvalidCase) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryOpConstantInvalidLeadingMinus, OpConstantInvalidLeadingMinusTest,
|
TextToBinaryOpConstantInvalidLeadingMinus, OpConstantInvalidLeadingMinusTest,
|
||||||
::testing::ValuesIn(std::vector<InvalidLeadingMinusCase>{
|
::testing::ValuesIn(std::vector<InvalidLeadingMinusCase>{
|
||||||
{"OpTypeInt 16 0", "-0"},
|
{"OpTypeInt 16 0", "-0"},
|
||||||
@ -267,7 +267,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpTypeInt 64 0", "-0"},
|
{"OpTypeInt 64 0", "-0"},
|
||||||
{"OpTypeInt 64 0", "-0x0"},
|
{"OpTypeInt 64 0", "-0x0"},
|
||||||
{"OpTypeInt 64 0", "-1"},
|
{"OpTypeInt 64 0", "-1"},
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// A test case for invalid floating point literals.
|
// A test case for invalid floating point literals.
|
||||||
@ -293,7 +293,7 @@ TEST_P(OpConstantInvalidFloatConstant, Samples) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryInvalidFloatConstant, OpConstantInvalidFloatConstant,
|
TextToBinaryInvalidFloatConstant, OpConstantInvalidFloatConstant,
|
||||||
::testing::ValuesIn(std::vector<InvalidFloatConstantCase>{
|
::testing::ValuesIn(std::vector<InvalidFloatConstantCase>{
|
||||||
{16, "abc"},
|
{16, "abc"},
|
||||||
@ -323,7 +323,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{64, "++1"},
|
{64, "++1"},
|
||||||
{32, "1e400"}, // Overflow is an error for 64-bit floats.
|
{32, "1e400"}, // Overflow is an error for 64-bit floats.
|
||||||
{32, "-1e400"},
|
{32, "-1e400"},
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
using OpConstantInvalidTypeTest =
|
using OpConstantInvalidTypeTest =
|
||||||
@ -339,7 +339,7 @@ TEST_P(OpConstantInvalidTypeTest, InvalidTypes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryOpConstantInvalidValidType, OpConstantInvalidTypeTest,
|
TextToBinaryOpConstantInvalidValidType, OpConstantInvalidTypeTest,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
{"OpTypeVoid",
|
{"OpTypeVoid",
|
||||||
@ -364,7 +364,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// At least one thing that isn't a type at all
|
// At least one thing that isn't a type at all
|
||||||
"OpNot %a %b"
|
"OpNot %a %b"
|
||||||
},
|
},
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
using OpSpecConstantValidTest =
|
using OpSpecConstantValidTest =
|
||||||
@ -381,7 +381,7 @@ TEST_P(OpSpecConstantValidTest, ValidTypes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryOpSpecConstantValid, OpSpecConstantValidTest,
|
TextToBinaryOpSpecConstantValid, OpSpecConstantValidTest,
|
||||||
::testing::ValuesIn(std::vector<ConstantTestCase>{
|
::testing::ValuesIn(std::vector<ConstantTestCase>{
|
||||||
// Check 16 bits
|
// Check 16 bits
|
||||||
@ -433,7 +433,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpTypeInt 64 1", "-42",
|
{"OpTypeInt 64 1", "-42",
|
||||||
Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
|
Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
|
||||||
MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})},
|
MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})},
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
using OpSpecConstantInvalidTypeTest =
|
using OpSpecConstantInvalidTypeTest =
|
||||||
@ -449,7 +449,7 @@ TEST_P(OpSpecConstantInvalidTypeTest, InvalidTypes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryOpSpecConstantInvalidValidType, OpSpecConstantInvalidTypeTest,
|
TextToBinaryOpSpecConstantInvalidValidType, OpSpecConstantInvalidTypeTest,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
{"OpTypeVoid",
|
{"OpTypeVoid",
|
||||||
@ -474,14 +474,14 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// At least one thing that isn't a type at all
|
// At least one thing that isn't a type at all
|
||||||
"OpNot %a %b"
|
"OpNot %a %b"
|
||||||
},
|
},
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
const int64_t kMaxUnsigned48Bit = (int64_t(1) << 48) - 1;
|
const int64_t kMaxUnsigned48Bit = (int64_t(1) << 48) - 1;
|
||||||
const int64_t kMaxSigned48Bit = (int64_t(1) << 47) - 1;
|
const int64_t kMaxSigned48Bit = (int64_t(1) << 47) - 1;
|
||||||
const int64_t kMinSigned48Bit = -kMaxSigned48Bit - 1;
|
const int64_t kMinSigned48Bit = -kMaxSigned48Bit - 1;
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpConstantRoundTrip, RoundTripTest,
|
OpConstantRoundTrip, RoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
// 16 bit
|
// 16 bit
|
||||||
@ -522,9 +522,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0\n",
|
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0\n",
|
||||||
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 1.79767e+308\n",
|
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 1.79767e+308\n",
|
||||||
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -1.79767e+308\n",
|
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -1.79767e+308\n",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpConstantHalfRoundTrip, RoundTripTest,
|
OpConstantHalfRoundTrip, RoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x0p+0\n",
|
"%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x0p+0\n",
|
||||||
@ -557,11 +557,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffp+16\n", // -nan
|
"%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffp+16\n", // -nan
|
||||||
"%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffcp+16\n", // -nan
|
"%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffcp+16\n", // -nan
|
||||||
"%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.004p+16\n", // -nan
|
"%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.004p+16\n", // -nan
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// (Clang-format really wants to break up these strings across lines.
|
// (Clang-format really wants to break up these strings across lines.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpConstantRoundTripNonFinite, RoundTripTest,
|
OpConstantRoundTripNonFinite, RoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1p+128\n", // -inf
|
"%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1p+128\n", // -inf
|
||||||
@ -588,10 +588,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.0000000000001p+1024\n", // -nan
|
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.0000000000001p+1024\n", // -nan
|
||||||
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.00003p+1024\n", // -nan
|
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.00003p+1024\n", // -nan
|
||||||
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.fffffffffffffp+1024\n", // -nan
|
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.fffffffffffffp+1024\n", // -nan
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpSpecConstantRoundTrip, RoundTripTest,
|
OpSpecConstantRoundTrip, RoundTripTest,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
// 16 bit
|
// 16 bit
|
||||||
@ -632,7 +632,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 0\n",
|
"%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 0\n",
|
||||||
"%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 1.79767e+308\n",
|
"%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 1.79767e+308\n",
|
||||||
"%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 -1.79767e+308\n",
|
"%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 -1.79767e+308\n",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
// Test OpSpecConstantOp
|
// Test OpSpecConstantOp
|
||||||
|
|
||||||
@ -662,7 +662,7 @@ TEST_P(OpSpecConstantOpTestWithIds, Assembly) {
|
|||||||
#define CASE4(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6} }
|
#define CASE4(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6} }
|
||||||
#define CASE5(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7} }
|
#define CASE5(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7} }
|
||||||
#define CASE6(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7, 8} }
|
#define CASE6(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7, 8} }
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryOpSpecConstantOp, OpSpecConstantOpTestWithIds,
|
TextToBinaryOpSpecConstantOp, OpSpecConstantOpTestWithIds,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
|
||||||
// Conversion
|
// Conversion
|
||||||
@ -738,7 +738,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE2(InBoundsPtrAccessChain),
|
CASE2(InBoundsPtrAccessChain),
|
||||||
CASE3(InBoundsPtrAccessChain),
|
CASE3(InBoundsPtrAccessChain),
|
||||||
CASE6(InBoundsPtrAccessChain),
|
CASE6(InBoundsPtrAccessChain),
|
||||||
}),);
|
}));
|
||||||
#undef CASE1
|
#undef CASE1
|
||||||
#undef CASE2
|
#undef CASE2
|
||||||
#undef CASE3
|
#undef CASE3
|
||||||
@ -768,7 +768,7 @@ TEST_P(OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers, Assembly) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define CASE(NAME) SpvOp##NAME, #NAME
|
#define CASE(NAME) SpvOp##NAME, #NAME
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryOpSpecConstantOp,
|
TextToBinaryOpSpecConstantOp,
|
||||||
OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers,
|
OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
|
||||||
@ -783,7 +783,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// composite, and then literal indices.
|
// composite, and then literal indices.
|
||||||
{CASE(CompositeInsert), {0}},
|
{CASE(CompositeInsert), {0}},
|
||||||
{CASE(CompositeInsert), {4, 3, 99, 1}},
|
{CASE(CompositeInsert), {4, 3, 99, 1}},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
using OpSpecConstantOpTestWithOneIdThenLiteralNumbers =
|
using OpSpecConstantOpTestWithOneIdThenLiteralNumbers =
|
||||||
spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<SpvOp>>>;
|
spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<SpvOp>>>;
|
||||||
@ -806,7 +806,7 @@ TEST_P(OpSpecConstantOpTestWithOneIdThenLiteralNumbers, Assembly) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define CASE(NAME) SpvOp##NAME, #NAME
|
#define CASE(NAME) SpvOp##NAME, #NAME
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryOpSpecConstantOp,
|
TextToBinaryOpSpecConstantOp,
|
||||||
OpSpecConstantOpTestWithOneIdThenLiteralNumbers,
|
OpSpecConstantOpTestWithOneIdThenLiteralNumbers,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
|
||||||
@ -814,7 +814,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// indices. Let's only test a few.
|
// indices. Let's only test a few.
|
||||||
{CASE(CompositeExtract), {0}},
|
{CASE(CompositeExtract), {0}},
|
||||||
{CASE(CompositeExtract), {0, 99, 42, 16, 17, 12, 19}},
|
{CASE(CompositeExtract), {0, 99, 42, 16, 17, 12, 19}},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
// TODO(dneto): OpConstantTrue
|
// TODO(dneto): OpConstantTrue
|
||||||
// TODO(dneto): OpConstantFalse
|
// TODO(dneto): OpConstantFalse
|
||||||
|
@ -51,12 +51,12 @@ TEST_P(OpSelectionMergeTest, AnySingleSelectionControlMask) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(VALUE,NAME) { SpvSelectionControl##VALUE, NAME}
|
#define CASE(VALUE,NAME) { SpvSelectionControl##VALUE, NAME}
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinarySelectionMerge, OpSelectionMergeTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinarySelectionMerge, OpSelectionMergeTest,
|
||||||
ValuesIn(std::vector<EnumCase<SpvSelectionControlMask>>{
|
ValuesIn(std::vector<EnumCase<SpvSelectionControlMask>>{
|
||||||
CASE(MaskNone, "None"),
|
CASE(MaskNone, "None"),
|
||||||
CASE(FlattenMask, "Flatten"),
|
CASE(FlattenMask, "Flatten"),
|
||||||
CASE(DontFlattenMask, "DontFlatten"),
|
CASE(DontFlattenMask, "DontFlatten"),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ TEST_P(OpLoopMergeTest, AnySingleLoopControlMask) {
|
|||||||
{ \
|
{ \
|
||||||
SpvLoopControl##VALUE, NAME, { PARM } \
|
SpvLoopControl##VALUE, NAME, { PARM } \
|
||||||
}
|
}
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryLoopMerge, OpLoopMergeTest,
|
TextToBinaryLoopMerge, OpLoopMergeTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCase<int>>{
|
ValuesIn(std::vector<EnumCase<int>>{
|
||||||
@ -104,9 +104,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE(UnrollMask, "Unroll"),
|
CASE(UnrollMask, "Unroll"),
|
||||||
CASE(DontUnrollMask, "DontUnroll"),
|
CASE(DontUnrollMask, "DontUnroll"),
|
||||||
// clang-format on
|
// clang-format on
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryLoopMergeV11, OpLoopMergeTest,
|
TextToBinaryLoopMergeV11, OpLoopMergeTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCase<int>>{
|
ValuesIn(std::vector<EnumCase<int>>{
|
||||||
@ -116,7 +116,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{SpvLoopControlUnrollMask|SpvLoopControlDependencyLengthMask,
|
{SpvLoopControlUnrollMask|SpvLoopControlDependencyLengthMask,
|
||||||
"DependencyLength|Unroll", {33}},
|
"DependencyLength|Unroll", {33}},
|
||||||
// clang-format on
|
// clang-format on
|
||||||
})), );
|
})));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
#undef CASE1
|
#undef CASE1
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ SwitchTestCase MakeSwitchTestCase(uint32_t integer_width,
|
|||||||
Concatenate({{2, 3}, encoded_case_value, {4}}))})}};
|
Concatenate({{2, 3}, encoded_case_value, {4}}))})}};
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryOpSwitchValid1Word, OpSwitchValidTest,
|
TextToBinaryOpSwitchValid1Word, OpSwitchValidTest,
|
||||||
ValuesIn(std::vector<SwitchTestCase>({
|
ValuesIn(std::vector<SwitchTestCase>({
|
||||||
MakeSwitchTestCase(32, 0, "42", {42}, "100", {100}),
|
MakeSwitchTestCase(32, 0, "42", {42}, "100", {100}),
|
||||||
@ -270,10 +270,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
MakeSwitchTestCase(16, 1, "0x8000", {0xffff8000}, "0x8100",
|
MakeSwitchTestCase(16, 1, "0x8000", {0xffff8000}, "0x8100",
|
||||||
{0xffff8100}),
|
{0xffff8100}),
|
||||||
MakeSwitchTestCase(16, 0, "0x8000", {0x00008000}, "0x8100", {0x8100}),
|
MakeSwitchTestCase(16, 0, "0x8000", {0x00008000}, "0x8100", {0x8100}),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// NB: The words LOW ORDER bits show up first.
|
// NB: The words LOW ORDER bits show up first.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryOpSwitchValid2Words, OpSwitchValidTest,
|
TextToBinaryOpSwitchValid2Words, OpSwitchValidTest,
|
||||||
ValuesIn(std::vector<SwitchTestCase>({
|
ValuesIn(std::vector<SwitchTestCase>({
|
||||||
MakeSwitchTestCase(33, 0, "101", {101, 0}, "500", {500, 0}),
|
MakeSwitchTestCase(33, 0, "101", {101, 0}, "500", {500, 0}),
|
||||||
@ -291,9 +291,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
MakeSwitchTestCase(63, 0, "0x500000000", {0, 5}, "12", {12, 0}),
|
MakeSwitchTestCase(63, 0, "0x500000000", {0, 5}, "12", {12, 0}),
|
||||||
MakeSwitchTestCase(64, 0, "0x600000000", {0, 6}, "12", {12, 0}),
|
MakeSwitchTestCase(64, 0, "0x600000000", {0, 6}, "12", {12, 0}),
|
||||||
MakeSwitchTestCase(64, 1, "0x700000123", {0x123, 7}, "12", {12, 0}),
|
MakeSwitchTestCase(64, 1, "0x700000123", {0x123, 7}, "12", {12, 0}),
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpSwitchRoundTripUnsignedIntegers, RoundTripTest,
|
OpSwitchRoundTripUnsignedIntegers, RoundTripTest,
|
||||||
ValuesIn(std::vector<std::string>({
|
ValuesIn(std::vector<std::string>({
|
||||||
// Unsigned 16-bit.
|
// Unsigned 16-bit.
|
||||||
@ -307,9 +307,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// Unsigned 64-bit, three non-default cases.
|
// Unsigned 64-bit, three non-default cases.
|
||||||
"%1 = OpTypeInt 64 0\n%2 = OpConstant %1 9223372036854775807\n"
|
"%1 = OpTypeInt 64 0\n%2 = OpConstant %1 9223372036854775807\n"
|
||||||
"OpSwitch %2 %3 100 %4 102 %5 9000000000000000000 %6\n",
|
"OpSwitch %2 %3 100 %4 102 %5 9000000000000000000 %6\n",
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
OpSwitchRoundTripSignedIntegers, RoundTripTest,
|
OpSwitchRoundTripSignedIntegers, RoundTripTest,
|
||||||
ValuesIn(std::vector<std::string>{
|
ValuesIn(std::vector<std::string>{
|
||||||
// Signed 16-bit, with two non-default cases
|
// Signed 16-bit, with two non-default cases
|
||||||
@ -332,7 +332,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"OpSwitch %2 %3 100 %4 7000000000 %5 -1000000000000000000 %6\n",
|
"OpSwitch %2 %3 100 %4 7000000000 %5 -1000000000000000000 %6\n",
|
||||||
"%1 = OpTypeInt 64 1\n%2 = OpConstant %1 -9223372036854775808\n"
|
"%1 = OpTypeInt 64 1\n%2 = OpConstant %1 -9223372036854775808\n"
|
||||||
"OpSwitch %2 %3 100 %4 7000000000 %5 -1000000000000000000 %6\n",
|
"OpSwitch %2 %3 100 %4 7000000000 %5 -1000000000000000000 %6\n",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
using OpSwitchInvalidTypeTestCase =
|
using OpSwitchInvalidTypeTestCase =
|
||||||
spvtest::TextToBinaryTestBase<TestWithParam<std::string>>;
|
spvtest::TextToBinaryTestBase<TestWithParam<std::string>>;
|
||||||
@ -349,7 +349,7 @@ TEST_P(OpSwitchInvalidTypeTestCase, InvalidTypes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryOpSwitchInvalidTests, OpSwitchInvalidTypeTestCase,
|
TextToBinaryOpSwitchInvalidTests, OpSwitchInvalidTypeTestCase,
|
||||||
ValuesIn(std::vector<std::string>{
|
ValuesIn(std::vector<std::string>{
|
||||||
{"OpTypeVoid",
|
{"OpTypeVoid",
|
||||||
@ -375,7 +375,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// At least one thing that isn't a type at all
|
// At least one thing that isn't a type at all
|
||||||
"OpNot %a %b"
|
"OpNot %a %b"
|
||||||
},
|
},
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// TODO(dneto): OpPhi
|
// TODO(dneto): OpPhi
|
||||||
|
@ -73,8 +73,8 @@ TEST_P(OpSourceTest, AnyLanguage) {
|
|||||||
GetParam().version})));
|
GetParam().version})));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpSourceTest,
|
||||||
::testing::ValuesIn(kLanguageCases), );
|
::testing::ValuesIn(kLanguageCases));
|
||||||
|
|
||||||
TEST_F(OpSourceTest, WrongLanguage) {
|
TEST_F(OpSourceTest, WrongLanguage) {
|
||||||
EXPECT_THAT(CompileFailure("OpSource xxyyzz 12345"),
|
EXPECT_THAT(CompileFailure("OpSource xxyyzz 12345"),
|
||||||
@ -113,9 +113,9 @@ TEST_P(OpSourceContinuedTest, AnyExtension) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO(dneto): utf-8, quoting, escaping
|
// TODO(dneto): utf-8, quoting, escaping
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceContinuedTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpSourceContinuedTest,
|
||||||
::testing::ValuesIn(std::vector<const char*>{
|
::testing::ValuesIn(std::vector<const char*>{
|
||||||
"", "foo bar this and that"}), );
|
"", "foo bar this and that"}));
|
||||||
|
|
||||||
// Test OpSourceExtension
|
// Test OpSourceExtension
|
||||||
|
|
||||||
@ -132,9 +132,9 @@ TEST_P(OpSourceExtensionTest, AnyExtension) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO(dneto): utf-8, quoting, escaping
|
// TODO(dneto): utf-8, quoting, escaping
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceExtensionTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpSourceExtensionTest,
|
||||||
::testing::ValuesIn(std::vector<const char*>{
|
::testing::ValuesIn(std::vector<const char*>{
|
||||||
"", "foo bar this and that"}), );
|
"", "foo bar this and that"}));
|
||||||
|
|
||||||
TEST_F(TextToBinaryTest, OpLine) {
|
TEST_F(TextToBinaryTest, OpLine) {
|
||||||
EXPECT_THAT(CompiledInstructions("OpLine %srcfile 42 99"),
|
EXPECT_THAT(CompiledInstructions("OpLine %srcfile 42 99"),
|
||||||
@ -158,9 +158,9 @@ TEST_P(OpStringTest, AnyString) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO(dneto): utf-8, quoting, escaping
|
// TODO(dneto): utf-8, quoting, escaping
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpStringTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpStringTest,
|
||||||
::testing::ValuesIn(std::vector<const char*>{
|
::testing::ValuesIn(std::vector<const char*>{
|
||||||
"", "foo bar this and that"}), );
|
"", "foo bar this and that"}));
|
||||||
|
|
||||||
using OpNameTest =
|
using OpNameTest =
|
||||||
spvtest::TextToBinaryTestBase<::testing::TestWithParam<const char*>>;
|
spvtest::TextToBinaryTestBase<::testing::TestWithParam<const char*>>;
|
||||||
@ -174,8 +174,8 @@ TEST_P(OpNameTest, AnyString) {
|
|||||||
|
|
||||||
// UTF-8, quoting, escaping, etc. are covered in the StringLiterals tests in
|
// UTF-8, quoting, escaping, etc. are covered in the StringLiterals tests in
|
||||||
// BinaryToText.Literal.cpp.
|
// BinaryToText.Literal.cpp.
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpNameTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpNameTest,
|
||||||
::testing::Values("", "foo bar this and that"), );
|
::testing::Values("", "foo bar this and that"));
|
||||||
|
|
||||||
using OpMemberNameTest =
|
using OpMemberNameTest =
|
||||||
spvtest::TextToBinaryTestBase<::testing::TestWithParam<const char*>>;
|
spvtest::TextToBinaryTestBase<::testing::TestWithParam<const char*>>;
|
||||||
@ -190,9 +190,9 @@ TEST_P(OpMemberNameTest, AnyString) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO(dneto): utf-8, quoting, escaping
|
// TODO(dneto): utf-8, quoting, escaping
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpMemberNameTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpMemberNameTest,
|
||||||
::testing::ValuesIn(std::vector<const char*>{
|
::testing::ValuesIn(std::vector<const char*>{
|
||||||
"", "foo bar this and that"}), );
|
"", "foo bar this and that"}));
|
||||||
|
|
||||||
// TODO(dneto): Parse failures?
|
// TODO(dneto): Parse failures?
|
||||||
|
|
||||||
@ -207,8 +207,8 @@ TEST_P(OpModuleProcessedTest, AnyString) {
|
|||||||
Eq(MakeInstruction(SpvOpModuleProcessed, MakeVector(GetParam()))));
|
Eq(MakeInstruction(SpvOpModuleProcessed, MakeVector(GetParam()))));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpModuleProcessedTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpModuleProcessedTest,
|
||||||
::testing::Values("", "foo bar this and that"), );
|
::testing::Values("", "foo bar this and that"));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
@ -49,7 +49,7 @@ TEST_P(OpEnqueueKernelGood, Sample) {
|
|||||||
GetParam().local_size_operands)));
|
GetParam().local_size_operands)));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryTest, OpEnqueueKernelGood,
|
TextToBinaryTest, OpEnqueueKernelGood,
|
||||||
::testing::ValuesIn(std::vector<KernelEnqueueCase>{
|
::testing::ValuesIn(std::vector<KernelEnqueueCase>{
|
||||||
// Provide IDs for pointer-to-local arguments for the
|
// Provide IDs for pointer-to-local arguments for the
|
||||||
@ -71,7 +71,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{13, 14, 15, 16, 17, 18, 19, 20, 21}},
|
{13, 14, 15, 16, 17, 18, 19, 20, 21}},
|
||||||
{"%l0 %l1 %l2 %l3 %l4 %l5 %l6 %l7 %l8 %l9",
|
{"%l0 %l1 %l2 %l3 %l4 %l5 %l6 %l7 %l8 %l9",
|
||||||
{13, 14, 15, 16, 17, 18, 19, 20, 21, 22}},
|
{13, 14, 15, 16, 17, 18, 19, 20, 21, 22}},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
// Test some bad parses of OpEnqueueKernel. For other cases, we're relying
|
// Test some bad parses of OpEnqueueKernel. For other cases, we're relying
|
||||||
// on the uniformity of the parsing algorithm. The following two tests, ensure
|
// on the uniformity of the parsing algorithm. The following two tests, ensure
|
||||||
|
@ -135,7 +135,7 @@ TEST_P(ExtensionRoundTripTest, Samples) {
|
|||||||
|
|
||||||
// SPV_KHR_shader_ballot
|
// SPV_KHR_shader_ballot
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_shader_ballot, ExtensionRoundTripTest,
|
SPV_KHR_shader_ballot, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -164,9 +164,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpDecorate %1 BuiltIn SubgroupLtMask\n",
|
{"OpDecorate %1 BuiltIn SubgroupLtMask\n",
|
||||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||||
SpvBuiltInSubgroupLtMaskKHR})},
|
SpvBuiltInSubgroupLtMaskKHR})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_shader_ballot_vulkan_1_1, ExtensionRoundTripTest,
|
SPV_KHR_shader_ballot_vulkan_1_1, ExtensionRoundTripTest,
|
||||||
// In SPIR-V 1.3 and Vulkan 1.1 we can drop the KHR suffix on the
|
// In SPIR-V 1.3 and Vulkan 1.1 we can drop the KHR suffix on the
|
||||||
// builtin enums.
|
// builtin enums.
|
||||||
@ -194,11 +194,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpDecorate %1 BuiltIn SubgroupLtMask\n",
|
{"OpDecorate %1 BuiltIn SubgroupLtMask\n",
|
||||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||||
SpvBuiltInSubgroupLtMask})},
|
SpvBuiltInSubgroupLtMask})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// The old builtin names (with KHR suffix) still work in the assmebler, and
|
// The old builtin names (with KHR suffix) still work in the assmebler, and
|
||||||
// map to the enums without the KHR.
|
// map to the enums without the KHR.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_shader_ballot_vulkan_1_1_alias_check, ExtensionAssemblyTest,
|
SPV_KHR_shader_ballot_vulkan_1_1_alias_check, ExtensionAssemblyTest,
|
||||||
// In SPIR-V 1.3 and Vulkan 1.1 we can drop the KHR suffix on the
|
// In SPIR-V 1.3 and Vulkan 1.1 we can drop the KHR suffix on the
|
||||||
// builtin enums.
|
// builtin enums.
|
||||||
@ -219,11 +219,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpDecorate %1 BuiltIn SubgroupLtMaskKHR\n",
|
{"OpDecorate %1 BuiltIn SubgroupLtMaskKHR\n",
|
||||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||||
SpvBuiltInSubgroupLtMask})},
|
SpvBuiltInSubgroupLtMask})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_KHR_shader_draw_parameters
|
// SPV_KHR_shader_draw_parameters
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_shader_draw_parameters, ExtensionRoundTripTest,
|
SPV_KHR_shader_draw_parameters, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -241,11 +241,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpDecorate %1 BuiltIn DrawIndex\n",
|
{"OpDecorate %1 BuiltIn DrawIndex\n",
|
||||||
MakeInstruction(SpvOpDecorate,
|
MakeInstruction(SpvOpDecorate,
|
||||||
{1, SpvDecorationBuiltIn, SpvBuiltInDrawIndex})},
|
{1, SpvDecorationBuiltIn, SpvBuiltInDrawIndex})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_KHR_subgroup_vote
|
// SPV_KHR_subgroup_vote
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_subgroup_vote, ExtensionRoundTripTest,
|
SPV_KHR_subgroup_vote, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -260,11 +260,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
MakeInstruction(SpvOpSubgroupAllKHR, {1, 2, 3})},
|
MakeInstruction(SpvOpSubgroupAllKHR, {1, 2, 3})},
|
||||||
{"%2 = OpSubgroupAllEqualKHR %1 %3\n",
|
{"%2 = OpSubgroupAllEqualKHR %1 %3\n",
|
||||||
MakeInstruction(SpvOpSubgroupAllEqualKHR, {1, 2, 3})},
|
MakeInstruction(SpvOpSubgroupAllEqualKHR, {1, 2, 3})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_KHR_16bit_storage
|
// SPV_KHR_16bit_storage
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_16bit_storage, ExtensionRoundTripTest,
|
SPV_KHR_16bit_storage, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -289,9 +289,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpCapability StorageInputOutput16\n",
|
{"OpCapability StorageInputOutput16\n",
|
||||||
MakeInstruction(SpvOpCapability,
|
MakeInstruction(SpvOpCapability,
|
||||||
{SpvCapabilityStorageInputOutput16})},
|
{SpvCapabilityStorageInputOutput16})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_16bit_storage_alias_check, ExtensionAssemblyTest,
|
SPV_KHR_16bit_storage_alias_check, ExtensionAssemblyTest,
|
||||||
Combine(ValuesIn(CommonVulkanEnvs()),
|
Combine(ValuesIn(CommonVulkanEnvs()),
|
||||||
ValuesIn(std::vector<AssemblyCase>{
|
ValuesIn(std::vector<AssemblyCase>{
|
||||||
@ -303,11 +303,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpCapability UniformAndStorageBuffer16BitAccess\n",
|
{"OpCapability UniformAndStorageBuffer16BitAccess\n",
|
||||||
MakeInstruction(SpvOpCapability,
|
MakeInstruction(SpvOpCapability,
|
||||||
{SpvCapabilityStorageUniform16})},
|
{SpvCapabilityStorageUniform16})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_KHR_device_group
|
// SPV_KHR_device_group
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_device_group, ExtensionRoundTripTest,
|
SPV_KHR_device_group, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -318,11 +318,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpDecorate %1 BuiltIn DeviceIndex\n",
|
{"OpDecorate %1 BuiltIn DeviceIndex\n",
|
||||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||||
SpvBuiltInDeviceIndex})},
|
SpvBuiltInDeviceIndex})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_KHR_8bit_storage
|
// SPV_KHR_8bit_storage
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_8bit_storage, ExtensionRoundTripTest,
|
SPV_KHR_8bit_storage, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -338,11 +338,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpCapability StoragePushConstant8\n",
|
{"OpCapability StoragePushConstant8\n",
|
||||||
MakeInstruction(SpvOpCapability,
|
MakeInstruction(SpvOpCapability,
|
||||||
{SpvCapabilityStoragePushConstant8})},
|
{SpvCapabilityStoragePushConstant8})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_KHR_multiview
|
// SPV_KHR_multiview
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_multiview, ExtensionRoundTripTest,
|
SPV_KHR_multiview, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -354,13 +354,13 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpDecorate %1 BuiltIn ViewIndex\n",
|
{"OpDecorate %1 BuiltIn ViewIndex\n",
|
||||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||||
SpvBuiltInViewIndex})},
|
SpvBuiltInViewIndex})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_AMD_shader_explicit_vertex_parameter
|
// SPV_AMD_shader_explicit_vertex_parameter
|
||||||
|
|
||||||
#define PREAMBLE \
|
#define PREAMBLE \
|
||||||
"%1 = OpExtInstImport \"SPV_AMD_shader_explicit_vertex_parameter\"\n"
|
"%1 = OpExtInstImport \"SPV_AMD_shader_explicit_vertex_parameter\"\n"
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_AMD_shader_explicit_vertex_parameter, ExtensionRoundTripTest,
|
SPV_AMD_shader_explicit_vertex_parameter, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -374,13 +374,13 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
SpvOpExtInstImport, {1},
|
SpvOpExtInstImport, {1},
|
||||||
MakeVector("SPV_AMD_shader_explicit_vertex_parameter")),
|
MakeVector("SPV_AMD_shader_explicit_vertex_parameter")),
|
||||||
MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5})})},
|
MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5})})},
|
||||||
})), );
|
})));
|
||||||
#undef PREAMBLE
|
#undef PREAMBLE
|
||||||
|
|
||||||
// SPV_AMD_shader_trinary_minmax
|
// SPV_AMD_shader_trinary_minmax
|
||||||
|
|
||||||
#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_trinary_minmax\"\n"
|
#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_trinary_minmax\"\n"
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_AMD_shader_trinary_minmax, ExtensionRoundTripTest,
|
SPV_AMD_shader_trinary_minmax, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -433,13 +433,13 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{MakeInstruction(SpvOpExtInstImport, {1},
|
{MakeInstruction(SpvOpExtInstImport, {1},
|
||||||
MakeVector("SPV_AMD_shader_trinary_minmax")),
|
MakeVector("SPV_AMD_shader_trinary_minmax")),
|
||||||
MakeInstruction(SpvOpExtInst, {2, 3, 1, 9, 4, 5, 6})})},
|
MakeInstruction(SpvOpExtInst, {2, 3, 1, 9, 4, 5, 6})})},
|
||||||
})), );
|
})));
|
||||||
#undef PREAMBLE
|
#undef PREAMBLE
|
||||||
|
|
||||||
// SPV_AMD_gcn_shader
|
// SPV_AMD_gcn_shader
|
||||||
|
|
||||||
#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_gcn_shader\"\n"
|
#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_gcn_shader\"\n"
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_AMD_gcn_shader, ExtensionRoundTripTest,
|
SPV_AMD_gcn_shader, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -458,13 +458,13 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
|
Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
|
||||||
MakeVector("SPV_AMD_gcn_shader")),
|
MakeVector("SPV_AMD_gcn_shader")),
|
||||||
MakeInstruction(SpvOpExtInst, {2, 3, 1, 3})})},
|
MakeInstruction(SpvOpExtInst, {2, 3, 1, 3})})},
|
||||||
})), );
|
})));
|
||||||
#undef PREAMBLE
|
#undef PREAMBLE
|
||||||
|
|
||||||
// SPV_AMD_shader_ballot
|
// SPV_AMD_shader_ballot
|
||||||
|
|
||||||
#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_ballot\"\n"
|
#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_ballot\"\n"
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_AMD_shader_ballot, ExtensionRoundTripTest,
|
SPV_AMD_shader_ballot, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -490,12 +490,12 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
|
Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
|
||||||
MakeVector("SPV_AMD_shader_ballot")),
|
MakeVector("SPV_AMD_shader_ballot")),
|
||||||
MakeInstruction(SpvOpExtInst, {2, 3, 1, 4, 4})})},
|
MakeInstruction(SpvOpExtInst, {2, 3, 1, 4, 4})})},
|
||||||
})), );
|
})));
|
||||||
#undef PREAMBLE
|
#undef PREAMBLE
|
||||||
|
|
||||||
// SPV_KHR_variable_pointers
|
// SPV_KHR_variable_pointers
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_variable_pointers, ExtensionRoundTripTest,
|
SPV_KHR_variable_pointers, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -508,11 +508,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpCapability VariablePointersStorageBuffer\n",
|
{"OpCapability VariablePointersStorageBuffer\n",
|
||||||
MakeInstruction(SpvOpCapability,
|
MakeInstruction(SpvOpCapability,
|
||||||
{SpvCapabilityVariablePointersStorageBuffer})},
|
{SpvCapabilityVariablePointersStorageBuffer})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_KHR_vulkan_memory_model
|
// SPV_KHR_vulkan_memory_model
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_KHR_vulkan_memory_model, ExtensionRoundTripTest,
|
SPV_KHR_vulkan_memory_model, ExtensionRoundTripTest,
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
// environments, and at least one specific environment.
|
// environments, and at least one specific environment.
|
||||||
@ -652,11 +652,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
// constant integer referenced by Id. There is no token for
|
// constant integer referenced by Id. There is no token for
|
||||||
// them, and so no assembler or disassembler support required.
|
// them, and so no assembler or disassembler support required.
|
||||||
// Similar for Scope ID.
|
// Similar for Scope ID.
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_GOOGLE_decorate_string
|
// SPV_GOOGLE_decorate_string
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_GOOGLE_decorate_string, ExtensionRoundTripTest,
|
SPV_GOOGLE_decorate_string, ExtensionRoundTripTest,
|
||||||
Combine(
|
Combine(
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
@ -672,11 +672,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
MakeInstruction(SpvOpMemberDecorateStringGOOGLE,
|
MakeInstruction(SpvOpMemberDecorateStringGOOGLE,
|
||||||
{1, 3, SpvDecorationHlslSemanticGOOGLE},
|
{1, 3, SpvDecorationHlslSemanticGOOGLE},
|
||||||
MakeVector("DEF"))},
|
MakeVector("DEF"))},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_GOOGLE_hlsl_functionality1
|
// SPV_GOOGLE_hlsl_functionality1
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_GOOGLE_hlsl_functionality1, ExtensionRoundTripTest,
|
SPV_GOOGLE_hlsl_functionality1, ExtensionRoundTripTest,
|
||||||
Combine(
|
Combine(
|
||||||
// We'll get coverage over operand tables by trying the universal
|
// We'll get coverage over operand tables by trying the universal
|
||||||
@ -689,11 +689,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpDecorateId %1 HlslCounterBufferGOOGLE %2\n",
|
{"OpDecorateId %1 HlslCounterBufferGOOGLE %2\n",
|
||||||
MakeInstruction(SpvOpDecorateId,
|
MakeInstruction(SpvOpDecorateId,
|
||||||
{1, SpvDecorationHlslCounterBufferGOOGLE, 2})},
|
{1, SpvDecorationHlslCounterBufferGOOGLE, 2})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_NV_viewport_array2
|
// SPV_NV_viewport_array2
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_NV_viewport_array2, ExtensionRoundTripTest,
|
SPV_NV_viewport_array2, ExtensionRoundTripTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||||
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3,
|
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3,
|
||||||
@ -717,11 +717,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"OpDecorate %1 BuiltIn ViewportMaskNV\n",
|
{"OpDecorate %1 BuiltIn ViewportMaskNV\n",
|
||||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||||
SpvBuiltInViewportMaskNV})},
|
SpvBuiltInViewportMaskNV})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_NV_shader_subgroup_partitioned
|
// SPV_NV_shader_subgroup_partitioned
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_NV_shader_subgroup_partitioned, ExtensionRoundTripTest,
|
SPV_NV_shader_subgroup_partitioned, ExtensionRoundTripTest,
|
||||||
Combine(
|
Combine(
|
||||||
Values(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1),
|
Values(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1),
|
||||||
@ -759,11 +759,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
SpvGroupOperationPartitionedExclusiveScanNV, 4})},
|
SpvGroupOperationPartitionedExclusiveScanNV, 4})},
|
||||||
{"%2 = OpGroupIAdd %1 %3 PartitionedExclusiveScanNV %4\n",
|
{"%2 = OpGroupIAdd %1 %3 PartitionedExclusiveScanNV %4\n",
|
||||||
MakeInstruction(SpvOpGroupIAdd, {1, 2, 3, 8, 4})},
|
MakeInstruction(SpvOpGroupIAdd, {1, 2, 3, 8, 4})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
// SPV_EXT_descriptor_indexing
|
// SPV_EXT_descriptor_indexing
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SPV_EXT_descriptor_indexing, ExtensionRoundTripTest,
|
SPV_EXT_descriptor_indexing, ExtensionRoundTripTest,
|
||||||
Combine(
|
Combine(
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||||
@ -851,7 +851,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationNonUniformEXT})},
|
MakeInstruction(SpvOpDecorate, {1, SpvDecorationNonUniformEXT})},
|
||||||
{"OpDecorate %1 NonUniformEXT\n",
|
{"OpDecorate %1 NonUniformEXT\n",
|
||||||
MakeInstruction(SpvOpDecorate, {1, 5300})},
|
MakeInstruction(SpvOpDecorate, {1, 5300})},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
@ -45,14 +45,14 @@ TEST_P(OpFunctionControlTest, AnySingleFunctionControlMask) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(VALUE,NAME) { SpvFunctionControl##VALUE, NAME }
|
#define CASE(VALUE,NAME) { SpvFunctionControl##VALUE, NAME }
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryFunctionTest, OpFunctionControlTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryFunctionTest, OpFunctionControlTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvFunctionControlMask>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvFunctionControlMask>>{
|
||||||
CASE(MaskNone, "None"),
|
CASE(MaskNone, "None"),
|
||||||
CASE(InlineMask, "Inline"),
|
CASE(InlineMask, "Inline"),
|
||||||
CASE(DontInlineMask, "DontInline"),
|
CASE(DontInlineMask, "DontInline"),
|
||||||
CASE(PureMask, "Pure"),
|
CASE(PureMask, "Pure"),
|
||||||
CASE(ConstMask, "Const"),
|
CASE(ConstMask, "Const"),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
@ -44,12 +44,12 @@ TEST_P(GroupOperationTest, AnyGroupOperation) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) { SpvGroupOperation##NAME, #NAME}
|
#define CASE(NAME) { SpvGroupOperation##NAME, #NAME}
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryGroupOperation, GroupOperationTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryGroupOperation, GroupOperationTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvGroupOperation>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvGroupOperation>>{
|
||||||
CASE(Reduce),
|
CASE(Reduce),
|
||||||
CASE(InclusiveScan),
|
CASE(InclusiveScan),
|
||||||
CASE(ExclusiveScan),
|
CASE(ExclusiveScan),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ TEST_P(ImageOperandsTest, Sample) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define MASK(NAME) SpvImageOperands##NAME##Mask
|
#define MASK(NAME) SpvImageOperands##NAME##Mask
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryImageOperandsAny, ImageOperandsTest,
|
TextToBinaryImageOperandsAny, ImageOperandsTest,
|
||||||
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
||||||
// TODO(dneto): Rev32 adds many more values, and rearranges their
|
// TODO(dneto): Rev32 adds many more values, and rearranges their
|
||||||
@ -66,10 +66,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{" ConstOffsets %5", {MASK(ConstOffsets), 5}},
|
{" ConstOffsets %5", {MASK(ConstOffsets), 5}},
|
||||||
{" Sample %5", {MASK(Sample), 5}},
|
{" Sample %5", {MASK(Sample), 5}},
|
||||||
{" MinLod %5", {MASK(MinLod), 5}},
|
{" MinLod %5", {MASK(MinLod), 5}},
|
||||||
}), );
|
}));
|
||||||
#undef MASK
|
#undef MASK
|
||||||
#define MASK(NAME) static_cast<uint32_t>(SpvImageOperands##NAME##Mask)
|
#define MASK(NAME) static_cast<uint32_t>(SpvImageOperands##NAME##Mask)
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryImageOperandsCombination, ImageOperandsTest,
|
TextToBinaryImageOperandsCombination, ImageOperandsTest,
|
||||||
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
||||||
// TODO(dneto): Rev32 adds many more values, and rearranges their
|
// TODO(dneto): Rev32 adds many more values, and rearranges their
|
||||||
@ -95,7 +95,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
" %5 %6 %7 %8 %9 %10 %11 %12",
|
" %5 %6 %7 %8 %9 %10 %11 %12",
|
||||||
{MASK(Bias) | MASK(Lod) | MASK(Grad) | MASK(ConstOffset) |
|
{MASK(Bias) | MASK(Lod) | MASK(Grad) | MASK(ConstOffset) |
|
||||||
MASK(Offset) | MASK(ConstOffsets) | MASK(Sample),
|
MASK(Offset) | MASK(ConstOffsets) | MASK(Sample),
|
||||||
5, 6, 7, 8, 9, 10, 11, 12}}}), );
|
5, 6, 7, 8, 9, 10, 11, 12}}}));
|
||||||
#undef MASK
|
#undef MASK
|
||||||
|
|
||||||
TEST_F(ImageOperandsTest, WrongOperand) {
|
TEST_F(ImageOperandsTest, WrongOperand) {
|
||||||
@ -173,24 +173,24 @@ TEST_P(ImageSparseReadImageOperandsTest, Sample) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define MASK(NAME) SpvImageOperands##NAME##Mask
|
#define MASK(NAME) SpvImageOperands##NAME##Mask
|
||||||
INSTANTIATE_TEST_CASE_P(ImageSparseReadImageOperandsAny,
|
INSTANTIATE_TEST_SUITE_P(ImageSparseReadImageOperandsAny,
|
||||||
ImageSparseReadImageOperandsTest,
|
ImageSparseReadImageOperandsTest,
|
||||||
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
||||||
// Image operands are optional.
|
// Image operands are optional.
|
||||||
{"", {}},
|
{"", {}},
|
||||||
// Test each kind, alone.
|
// Test each kind, alone.
|
||||||
{" Bias %5", {MASK(Bias), 5}},
|
{" Bias %5", {MASK(Bias), 5}},
|
||||||
{" Lod %5", {MASK(Lod), 5}},
|
{" Lod %5", {MASK(Lod), 5}},
|
||||||
{" Grad %5 %6", {MASK(Grad), 5, 6}},
|
{" Grad %5 %6", {MASK(Grad), 5, 6}},
|
||||||
{" ConstOffset %5", {MASK(ConstOffset), 5}},
|
{" ConstOffset %5", {MASK(ConstOffset), 5}},
|
||||||
{" Offset %5", {MASK(Offset), 5}},
|
{" Offset %5", {MASK(Offset), 5}},
|
||||||
{" ConstOffsets %5", {MASK(ConstOffsets), 5}},
|
{" ConstOffsets %5", {MASK(ConstOffsets), 5}},
|
||||||
{" Sample %5", {MASK(Sample), 5}},
|
{" Sample %5", {MASK(Sample), 5}},
|
||||||
{" MinLod %5", {MASK(MinLod), 5}},
|
{" MinLod %5", {MASK(MinLod), 5}},
|
||||||
}), );
|
}));
|
||||||
#undef MASK
|
#undef MASK
|
||||||
#define MASK(NAME) static_cast<uint32_t>(SpvImageOperands##NAME##Mask)
|
#define MASK(NAME) static_cast<uint32_t>(SpvImageOperands##NAME##Mask)
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ImageSparseReadImageOperandsCombination, ImageSparseReadImageOperandsTest,
|
ImageSparseReadImageOperandsCombination, ImageSparseReadImageOperandsTest,
|
||||||
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
||||||
// values.
|
// values.
|
||||||
@ -212,7 +212,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
5, 6, 7, 8, 9, 10, 11, 12}},
|
5, 6, 7, 8, 9, 10, 11, 12}},
|
||||||
// Don't try the masks reversed, since this is a round trip test,
|
// Don't try the masks reversed, since this is a round trip test,
|
||||||
// and the disassembler will sort them.
|
// and the disassembler will sort them.
|
||||||
}), );
|
}));
|
||||||
#undef MASK
|
#undef MASK
|
||||||
|
|
||||||
TEST_F(OpImageSparseReadTest, InvalidTypeOperand) {
|
TEST_F(OpImageSparseReadTest, InvalidTypeOperand) {
|
||||||
|
@ -45,14 +45,14 @@ TEST_P(MemoryAccessTest, AnySingleMemoryAccessMask) {
|
|||||||
GetParam().operands())));
|
GetParam().operands())));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryMemoryAccessTest, MemoryAccessTest,
|
TextToBinaryMemoryAccessTest, MemoryAccessTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvMemoryAccessMask>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvMemoryAccessMask>>{
|
||||||
{SpvMemoryAccessMaskNone, "None", {}},
|
{SpvMemoryAccessMaskNone, "None", {}},
|
||||||
{SpvMemoryAccessVolatileMask, "Volatile", {}},
|
{SpvMemoryAccessVolatileMask, "Volatile", {}},
|
||||||
{SpvMemoryAccessAlignedMask, "Aligned", {16}},
|
{SpvMemoryAccessAlignedMask, "Aligned", {16}},
|
||||||
{SpvMemoryAccessNontemporalMask, "Nontemporal", {}},
|
{SpvMemoryAccessNontemporalMask, "Nontemporal", {}},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(TextToBinaryTest, CombinedMemoryAccessMask) {
|
TEST_F(TextToBinaryTest, CombinedMemoryAccessMask) {
|
||||||
const std::string input = "OpStore %ptr %value Volatile|Aligned 16";
|
const std::string input = "OpStore %ptr %value Volatile|Aligned 16";
|
||||||
@ -76,7 +76,7 @@ TEST_P(StorageClassTest, AnyStorageClass) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) { SpvStorageClass##NAME, #NAME, {} }
|
#define CASE(NAME) { SpvStorageClass##NAME, #NAME, {} }
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryStorageClassTest, StorageClassTest,
|
TextToBinaryStorageClassTest, StorageClassTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvStorageClass>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvStorageClass>>{
|
||||||
CASE(UniformConstant),
|
CASE(UniformConstant),
|
||||||
@ -91,7 +91,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE(PushConstant),
|
CASE(PushConstant),
|
||||||
CASE(AtomicCounter),
|
CASE(AtomicCounter),
|
||||||
CASE(Image),
|
CASE(Image),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ TEST_P(OpMemoryModelTest, AnyMemoryModelCase) {
|
|||||||
#MEMORY \
|
#MEMORY \
|
||||||
}
|
}
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryMemoryModel, OpMemoryModelTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryMemoryModel, OpMemoryModelTest,
|
||||||
ValuesIn(std::vector<MemoryModelCase>{
|
ValuesIn(std::vector<MemoryModelCase>{
|
||||||
// These cases exercise each addressing model, and
|
// These cases exercise each addressing model, and
|
||||||
// each memory model, but not necessarily in
|
// each memory model, but not necessarily in
|
||||||
@ -78,7 +78,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryMemoryModel, OpMemoryModelTest,
|
|||||||
CASE(Logical,GLSL450),
|
CASE(Logical,GLSL450),
|
||||||
CASE(Physical32,OpenCL),
|
CASE(Physical32,OpenCL),
|
||||||
CASE(Physical64,OpenCL),
|
CASE(Physical64,OpenCL),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ TEST_P(OpEntryPointTest, AnyEntryPointCase) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) SpvExecutionModel##NAME, #NAME
|
#define CASE(NAME) SpvExecutionModel##NAME, #NAME
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryEntryPoint, OpEntryPointTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryEntryPoint, OpEntryPointTest,
|
||||||
ValuesIn(std::vector<EntryPointCase>{
|
ValuesIn(std::vector<EntryPointCase>{
|
||||||
{ CASE(Vertex), "" },
|
{ CASE(Vertex), "" },
|
||||||
{ CASE(TessellationControl), "my tess" },
|
{ CASE(TessellationControl), "my tess" },
|
||||||
@ -125,7 +125,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryEntryPoint, OpEntryPointTest,
|
|||||||
{ CASE(Fragment), "FAT32" },
|
{ CASE(Fragment), "FAT32" },
|
||||||
{ CASE(GLCompute), "cubic" },
|
{ CASE(GLCompute), "cubic" },
|
||||||
{ CASE(Kernel), "Sanders" },
|
{ CASE(Kernel), "Sanders" },
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ TEST_P(OpExecutionModeTest, AnyExecutionMode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define CASE(NAME) SpvExecutionMode##NAME, #NAME
|
#define CASE(NAME) SpvExecutionMode##NAME, #NAME
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryExecutionMode, OpExecutionModeTest,
|
TextToBinaryExecutionMode, OpExecutionModeTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCase<SpvExecutionMode>>{
|
ValuesIn(std::vector<EnumCase<SpvExecutionMode>>{
|
||||||
@ -188,16 +188,16 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{CASE(OutputTriangleStrip), {}},
|
{CASE(OutputTriangleStrip), {}},
|
||||||
{CASE(VecTypeHint), {96}},
|
{CASE(VecTypeHint), {96}},
|
||||||
{CASE(ContractionOff), {}},
|
{CASE(ContractionOff), {}},
|
||||||
})), );
|
})));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryExecutionModeV11, OpExecutionModeTest,
|
TextToBinaryExecutionModeV11, OpExecutionModeTest,
|
||||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||||
ValuesIn(std::vector<EnumCase<SpvExecutionMode>>{
|
ValuesIn(std::vector<EnumCase<SpvExecutionMode>>{
|
||||||
{CASE(Initializer)},
|
{CASE(Initializer)},
|
||||||
{CASE(Finalizer)},
|
{CASE(Finalizer)},
|
||||||
{CASE(SubgroupSize), {12}},
|
{CASE(SubgroupSize), {12}},
|
||||||
{CASE(SubgroupsPerWorkgroup), {64}}})), );
|
{CASE(SubgroupsPerWorkgroup), {64}}})));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
|
|
||||||
TEST_F(OpExecutionModeTest, WrongMode) {
|
TEST_F(OpExecutionModeTest, WrongMode) {
|
||||||
@ -224,7 +224,7 @@ TEST_P(OpCapabilityTest, AnyCapability) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) { SpvCapability##NAME, #NAME }
|
#define CASE(NAME) { SpvCapability##NAME, #NAME }
|
||||||
INSTANTIATE_TEST_CASE_P(TextToBinaryCapability, OpCapabilityTest,
|
INSTANTIATE_TEST_SUITE_P(TextToBinaryCapability, OpCapabilityTest,
|
||||||
ValuesIn(std::vector<EnumCase<SpvCapability>>{
|
ValuesIn(std::vector<EnumCase<SpvCapability>>{
|
||||||
CASE(Matrix),
|
CASE(Matrix),
|
||||||
CASE(Shader),
|
CASE(Shader),
|
||||||
@ -280,7 +280,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryCapability, OpCapabilityTest,
|
|||||||
CASE(DerivativeControl),
|
CASE(DerivativeControl),
|
||||||
CASE(InterpolationFunction),
|
CASE(InterpolationFunction),
|
||||||
CASE(TransformFeedback),
|
CASE(TransformFeedback),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ TEST_P(DimTest, AnyDim) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) {SpvDim##NAME, #NAME}
|
#define CASE(NAME) {SpvDim##NAME, #NAME}
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryDim, DimTest,
|
TextToBinaryDim, DimTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvDim>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvDim>>{
|
||||||
CASE(1D),
|
CASE(1D),
|
||||||
@ -58,7 +58,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE(Rect),
|
CASE(Rect),
|
||||||
CASE(Buffer),
|
CASE(Buffer),
|
||||||
CASE(SubpassData),
|
CASE(SubpassData),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ TEST_P(ImageFormatTest, AnyImageFormatAndNoAccessQualifier) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) {SpvImageFormat##NAME, #NAME}
|
#define CASE(NAME) {SpvImageFormat##NAME, #NAME}
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryImageFormat, ImageFormatTest,
|
TextToBinaryImageFormat, ImageFormatTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvImageFormat>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvImageFormat>>{
|
||||||
CASE(Unknown),
|
CASE(Unknown),
|
||||||
@ -127,7 +127,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
CASE(Rg8ui),
|
CASE(Rg8ui),
|
||||||
CASE(R16ui),
|
CASE(R16ui),
|
||||||
CASE(R8ui),
|
CASE(R8ui),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@ -153,13 +153,13 @@ TEST_P(ImageAccessQualifierTest, AnyAccessQualifier) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) {SpvAccessQualifier##NAME, #NAME}
|
#define CASE(NAME) {SpvAccessQualifier##NAME, #NAME}
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
AccessQualifier, ImageAccessQualifierTest,
|
AccessQualifier, ImageAccessQualifierTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvAccessQualifier>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvAccessQualifier>>{
|
||||||
CASE(ReadOnly),
|
CASE(ReadOnly),
|
||||||
CASE(WriteOnly),
|
CASE(WriteOnly),
|
||||||
CASE(ReadWrite),
|
CASE(ReadWrite),
|
||||||
}),);
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
#undef CASE
|
#undef CASE
|
||||||
|
|
||||||
@ -178,13 +178,13 @@ TEST_P(OpTypePipeTest, AnyAccessQualifier) {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define CASE(NAME) {SpvAccessQualifier##NAME, #NAME}
|
#define CASE(NAME) {SpvAccessQualifier##NAME, #NAME}
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TextToBinaryTypePipe, OpTypePipeTest,
|
TextToBinaryTypePipe, OpTypePipeTest,
|
||||||
::testing::ValuesIn(std::vector<EnumCase<SpvAccessQualifier>>{
|
::testing::ValuesIn(std::vector<EnumCase<SpvAccessQualifier>>{
|
||||||
CASE(ReadOnly),
|
CASE(ReadOnly),
|
||||||
CASE(WriteOnly),
|
CASE(WriteOnly),
|
||||||
CASE(ReadWrite),
|
CASE(ReadWrite),
|
||||||
}),);
|
}));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ TEST_P(GoodMaskParseTest, GoodMaskExpressions) {
|
|||||||
spvContextDestroy(context);
|
spvContextDestroy(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ParseMask, GoodMaskParseTest,
|
ParseMask, GoodMaskParseTest,
|
||||||
::testing::ValuesIn(std::vector<MaskCase>{
|
::testing::ValuesIn(std::vector<MaskCase>{
|
||||||
{SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 0, "None"},
|
{SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 0, "None"},
|
||||||
@ -87,7 +87,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{SPV_OPERAND_TYPE_FUNCTION_CONTROL, 4, "Pure"},
|
{SPV_OPERAND_TYPE_FUNCTION_CONTROL, 4, "Pure"},
|
||||||
{SPV_OPERAND_TYPE_FUNCTION_CONTROL, 8, "Const"},
|
{SPV_OPERAND_TYPE_FUNCTION_CONTROL, 8, "Const"},
|
||||||
{SPV_OPERAND_TYPE_FUNCTION_CONTROL, 0xd, "Inline|Const|Pure"},
|
{SPV_OPERAND_TYPE_FUNCTION_CONTROL, 0xd, "Inline|Const|Pure"},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
using BadFPFastMathMaskParseTest = ::testing::TestWithParam<const char*>;
|
using BadFPFastMathMaskParseTest = ::testing::TestWithParam<const char*>;
|
||||||
|
|
||||||
@ -102,12 +102,12 @@ TEST_P(BadFPFastMathMaskParseTest, BadMaskExpressions) {
|
|||||||
spvContextDestroy(context);
|
spvContextDestroy(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ParseMask, BadFPFastMathMaskParseTest,
|
INSTANTIATE_TEST_SUITE_P(ParseMask, BadFPFastMathMaskParseTest,
|
||||||
::testing::ValuesIn(std::vector<const char*>{
|
::testing::ValuesIn(std::vector<const char*>{
|
||||||
nullptr, "", "NotValidEnum", "|", "NotInf|",
|
nullptr, "", "NotValidEnum", "|", "NotInf|",
|
||||||
"|NotInf", "NotInf||NotNaN",
|
"|NotInf", "NotInf||NotNaN",
|
||||||
"Unroll" // A good word, but for the wrong enum
|
"Unroll" // A good word, but for the wrong enum
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(TextToBinaryTest, InvalidText) {
|
TEST_F(TextToBinaryTest, InvalidText) {
|
||||||
ASSERT_EQ(SPV_ERROR_INVALID_TEXT,
|
ASSERT_EQ(SPV_ERROR_INVALID_TEXT,
|
||||||
@ -197,7 +197,7 @@ TEST_P(TextToBinaryFloatValueTest, Samples) {
|
|||||||
{1, 2, GetParam().second})})));
|
{1, 2, GetParam().second})})));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
FloatValues, TextToBinaryFloatValueTest,
|
FloatValues, TextToBinaryFloatValueTest,
|
||||||
::testing::ValuesIn(std::vector<std::pair<std::string, uint32_t>>{
|
::testing::ValuesIn(std::vector<std::pair<std::string, uint32_t>>{
|
||||||
{"0.0", 0x00000000}, // +0
|
{"0.0", 0x00000000}, // +0
|
||||||
@ -213,7 +213,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"-2.5", 0xc0200000},
|
{"-2.5", 0xc0200000},
|
||||||
{"!0xff800000", 0xff800000}, // -inf
|
{"!0xff800000", 0xff800000}, // -inf
|
||||||
{"!0xff800001", 0xff800001}, // NaN
|
{"!0xff800001", 0xff800001}, // NaN
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
using TextToBinaryHalfValueTest = spvtest::TextToBinaryTestBase<
|
using TextToBinaryHalfValueTest = spvtest::TextToBinaryTestBase<
|
||||||
::testing::TestWithParam<std::pair<std::string, uint32_t>>>;
|
::testing::TestWithParam<std::pair<std::string, uint32_t>>>;
|
||||||
@ -227,7 +227,7 @@ TEST_P(TextToBinaryHalfValueTest, Samples) {
|
|||||||
{1, 2, GetParam().second})})));
|
{1, 2, GetParam().second})})));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
HalfValues, TextToBinaryHalfValueTest,
|
HalfValues, TextToBinaryHalfValueTest,
|
||||||
::testing::ValuesIn(std::vector<std::pair<std::string, uint32_t>>{
|
::testing::ValuesIn(std::vector<std::pair<std::string, uint32_t>>{
|
||||||
{"0.0", 0x00000000},
|
{"0.0", 0x00000000},
|
||||||
@ -245,7 +245,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
{"0x1.8p4", 0x00004e00},
|
{"0x1.8p4", 0x00004e00},
|
||||||
{"0x1.801p4", 0x00004e00},
|
{"0x1.801p4", 0x00004e00},
|
||||||
{"0x1.804p4", 0x00004e01},
|
{"0x1.804p4", 0x00004e01},
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST(CreateContext, InvalidEnvironment) {
|
TEST(CreateContext, InvalidEnvironment) {
|
||||||
spv_target_env env;
|
spv_target_env env;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -611,7 +611,7 @@ const char kVoidFVoid2[] = \
|
|||||||
" OpReturn"
|
" OpReturn"
|
||||||
" OpFunctionEnd ";
|
" OpFunctionEnd ";
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ExecutionModel, ValidateCapability,
|
INSTANTIATE_TEST_SUITE_P(ExecutionModel, ValidateCapability,
|
||||||
Combine(
|
Combine(
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
Values(
|
Values(
|
||||||
@ -639,9 +639,9 @@ std::make_pair(std::string(kOpenCLMemoryModel) +
|
|||||||
std::make_pair(std::string(kGLSL450MemoryModel) +
|
std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||||
" OpEntryPoint Kernel %func \"shader\"" +
|
" OpEntryPoint Kernel %func \"shader\"" +
|
||||||
std::string(kVoidFVoid), KernelDependencies())
|
std::string(kVoidFVoid), KernelDependencies())
|
||||||
)),);
|
)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AddressingAndMemoryModel, ValidateCapability,
|
INSTANTIATE_TEST_SUITE_P(AddressingAndMemoryModel, ValidateCapability,
|
||||||
Combine(
|
Combine(
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
Values(
|
Values(
|
||||||
@ -681,9 +681,9 @@ std::make_pair(" OpCapability Kernel"
|
|||||||
" OpMemoryModel Physical64 OpenCL"
|
" OpMemoryModel Physical64 OpenCL"
|
||||||
" OpEntryPoint Kernel %func \"compute\"" +
|
" OpEntryPoint Kernel %func \"compute\"" +
|
||||||
std::string(kVoidFVoid), AddressesDependencies())
|
std::string(kVoidFVoid), AddressesDependencies())
|
||||||
)),);
|
)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ExecutionMode, ValidateCapability,
|
INSTANTIATE_TEST_SUITE_P(ExecutionMode, ValidateCapability,
|
||||||
Combine(
|
Combine(
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
Values(
|
Values(
|
||||||
@ -836,11 +836,11 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
|||||||
std::make_pair(std::string(kGLSL450MemoryModel) +
|
std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||||
"OpEntryPoint Kernel %func \"shader\" "
|
"OpEntryPoint Kernel %func \"shader\" "
|
||||||
"OpExecutionMode %func ContractionOff" +
|
"OpExecutionMode %func ContractionOff" +
|
||||||
std::string(kVoidFVoid), KernelDependencies()))),);
|
std::string(kVoidFVoid), KernelDependencies()))));
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ExecutionModeV11, ValidateCapabilityV11,
|
ExecutionModeV11, ValidateCapabilityV11,
|
||||||
Combine(ValuesIn(AllCapabilities()),
|
Combine(ValuesIn(AllCapabilities()),
|
||||||
Values(std::make_pair(std::string(kOpenCLMemoryModel) +
|
Values(std::make_pair(std::string(kOpenCLMemoryModel) +
|
||||||
@ -853,10 +853,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"OpEntryPoint Kernel %func \"shader\" "
|
"OpEntryPoint Kernel %func \"shader\" "
|
||||||
"OpExecutionMode %func SubgroupsPerWorkgroup 65535" +
|
"OpExecutionMode %func SubgroupsPerWorkgroup 65535" +
|
||||||
std::string(kVoidFVoid),
|
std::string(kVoidFVoid),
|
||||||
std::vector<std::string>{"SubgroupDispatch"}))), );
|
std::vector<std::string>{"SubgroupDispatch"}))));
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(StorageClass, ValidateCapability,
|
INSTANTIATE_TEST_SUITE_P(StorageClass, ValidateCapability,
|
||||||
Combine(
|
Combine(
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
Values(
|
Values(
|
||||||
@ -920,9 +920,9 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
|||||||
" %ptrt = OpTypePointer Image %intt\n"
|
" %ptrt = OpTypePointer Image %intt\n"
|
||||||
" %var = OpVariable %ptrt Image\n" + std::string(kVoidFVoid),
|
" %var = OpVariable %ptrt Image\n" + std::string(kVoidFVoid),
|
||||||
AllCapabilities())
|
AllCapabilities())
|
||||||
)),);
|
)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Dim, ValidateCapability,
|
INSTANTIATE_TEST_SUITE_P(Dim, ValidateCapability,
|
||||||
Combine(
|
Combine(
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
Values(
|
Values(
|
||||||
@ -968,11 +968,11 @@ std::make_pair(" OpCapability ImageBasic" +
|
|||||||
" %voidt = OpTypeVoid"
|
" %voidt = OpTypeVoid"
|
||||||
" %imgt = OpTypeImage %voidt SubpassData 0 0 0 2 Unknown" + std::string(kVoidFVoid2),
|
" %imgt = OpTypeImage %voidt SubpassData 0 0 0 2 Unknown" + std::string(kVoidFVoid2),
|
||||||
std::vector<std::string>{"InputAttachment"})
|
std::vector<std::string>{"InputAttachment"})
|
||||||
)),);
|
)));
|
||||||
|
|
||||||
// NOTE: All Sampler Address Modes require kernel capabilities but the
|
// NOTE: All Sampler Address Modes require kernel capabilities but the
|
||||||
// OpConstantSampler requires LiteralSampler which depends on Kernel
|
// OpConstantSampler requires LiteralSampler which depends on Kernel
|
||||||
INSTANTIATE_TEST_CASE_P(SamplerAddressingMode, ValidateCapability,
|
INSTANTIATE_TEST_SUITE_P(SamplerAddressingMode, ValidateCapability,
|
||||||
Combine(
|
Combine(
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
Values(
|
Values(
|
||||||
@ -1006,7 +1006,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
|||||||
" %sampler = OpConstantSampler %samplert RepeatMirrored 1 Nearest" +
|
" %sampler = OpConstantSampler %samplert RepeatMirrored 1 Nearest" +
|
||||||
std::string(kVoidFVoid),
|
std::string(kVoidFVoid),
|
||||||
std::vector<std::string>{"LiteralSampler"})
|
std::vector<std::string>{"LiteralSampler"})
|
||||||
)),);
|
)));
|
||||||
|
|
||||||
// TODO(umar): Sampler Filter Mode
|
// TODO(umar): Sampler Filter Mode
|
||||||
// TODO(umar): Image Format
|
// TODO(umar): Image Format
|
||||||
@ -1019,7 +1019,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
|||||||
// TODO(umar): Access Qualifier
|
// TODO(umar): Access Qualifier
|
||||||
// TODO(umar): Function Parameter Attribute
|
// TODO(umar): Function Parameter Attribute
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Decoration, ValidateCapability,
|
INSTANTIATE_TEST_SUITE_P(Decoration, ValidateCapability,
|
||||||
Combine(
|
Combine(
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
Values(
|
Values(
|
||||||
@ -1231,10 +1231,10 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
|||||||
"OpDecorate %intt Alignment 4\n"
|
"OpDecorate %intt Alignment 4\n"
|
||||||
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
||||||
KernelDependencies())
|
KernelDependencies())
|
||||||
)),);
|
)));
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DecorationSpecId, ValidateCapability,
|
DecorationSpecId, ValidateCapability,
|
||||||
Combine(
|
Combine(
|
||||||
ValuesIn(AllSpirV10Capabilities()),
|
ValuesIn(AllSpirV10Capabilities()),
|
||||||
@ -1244,9 +1244,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%intt = OpTypeInt 32 0\n"
|
"%intt = OpTypeInt 32 0\n"
|
||||||
"%1 = OpSpecConstant %intt 0\n" +
|
"%1 = OpSpecConstant %intt 0\n" +
|
||||||
std::string(kVoidFVoid),
|
std::string(kVoidFVoid),
|
||||||
ShaderDependencies()))), );
|
ShaderDependencies()))));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DecorationV11, ValidateCapabilityV11,
|
DecorationV11, ValidateCapabilityV11,
|
||||||
Combine(ValuesIn(AllCapabilities()),
|
Combine(ValuesIn(AllCapabilities()),
|
||||||
Values(std::make_pair(std::string(kOpenCLMemoryModel) +
|
Values(std::make_pair(std::string(kOpenCLMemoryModel) +
|
||||||
@ -1275,10 +1275,10 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%intt = OpTypeInt 32 0 "
|
"%intt = OpTypeInt 32 0 "
|
||||||
"%1 = OpSpecConstant %intt 0") +
|
"%1 = OpSpecConstant %intt 0") +
|
||||||
std::string(kVoidFVoid),
|
std::string(kVoidFVoid),
|
||||||
ShaderDependencies()))), );
|
ShaderDependencies()))));
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapability,
|
INSTANTIATE_TEST_SUITE_P(BuiltIn, ValidateCapability,
|
||||||
Combine(
|
Combine(
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
Values(
|
Values(
|
||||||
@ -1500,13 +1500,13 @@ std::make_pair(std::string(kOpenCLMemoryModel) +
|
|||||||
"OpDecorate %intt BuiltIn InstanceIndex\n"
|
"OpDecorate %intt BuiltIn InstanceIndex\n"
|
||||||
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
||||||
ShaderDependencies())
|
ShaderDependencies())
|
||||||
)),);
|
)));
|
||||||
|
|
||||||
// Ensure that mere mention of PointSize, ClipDistance, or CullDistance as
|
// Ensure that mere mention of PointSize, ClipDistance, or CullDistance as
|
||||||
// BuiltIns does not trigger the requirement for the associated
|
// BuiltIns does not trigger the requirement for the associated
|
||||||
// capability.
|
// capability.
|
||||||
// See https://github.com/KhronosGroup/SPIRV-Tools/issues/365
|
// See https://github.com/KhronosGroup/SPIRV-Tools/issues/365
|
||||||
INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapabilityVulkan10,
|
INSTANTIATE_TEST_SUITE_P(BuiltIn, ValidateCapabilityVulkan10,
|
||||||
Combine(
|
Combine(
|
||||||
// All capabilities to try.
|
// All capabilities to try.
|
||||||
ValuesIn(AllSpirV10Capabilities()),
|
ValuesIn(AllSpirV10Capabilities()),
|
||||||
@ -1537,9 +1537,9 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
|||||||
"%f32arr4 = OpTypeArray %f32 %intt_4\n"
|
"%f32arr4 = OpTypeArray %f32 %intt_4\n"
|
||||||
"%block = OpTypeStruct %f32arr4\n" + std::string(kVoidFVoid),
|
"%block = OpTypeStruct %f32arr4\n" + std::string(kVoidFVoid),
|
||||||
AllVulkan10Capabilities())
|
AllVulkan10Capabilities())
|
||||||
)),);
|
)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapabilityOpenGL40,
|
INSTANTIATE_TEST_SUITE_P(BuiltIn, ValidateCapabilityOpenGL40,
|
||||||
Combine(
|
Combine(
|
||||||
// OpenGL 4.0 is based on SPIR-V 1.0
|
// OpenGL 4.0 is based on SPIR-V 1.0
|
||||||
ValuesIn(AllSpirV10Capabilities()),
|
ValuesIn(AllSpirV10Capabilities()),
|
||||||
@ -1559,9 +1559,9 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
|||||||
"OpDecorate %intt BuiltIn CullDistance\n"
|
"OpDecorate %intt BuiltIn CullDistance\n"
|
||||||
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
||||||
AllSpirV10Capabilities())
|
AllSpirV10Capabilities())
|
||||||
)),);
|
)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Capabilities, ValidateCapabilityWebGPU,
|
INSTANTIATE_TEST_SUITE_P(Capabilities, ValidateCapabilityWebGPU,
|
||||||
Combine(
|
Combine(
|
||||||
// All capabilities to try.
|
// All capabilities to try.
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
@ -1569,9 +1569,9 @@ INSTANTIATE_TEST_CASE_P(Capabilities, ValidateCapabilityWebGPU,
|
|||||||
std::make_pair(std::string(kVulkanMemoryModel) +
|
std::make_pair(std::string(kVulkanMemoryModel) +
|
||||||
"OpEntryPoint Vertex %func \"shader\" \n" + std::string(kVoidFVoid),
|
"OpEntryPoint Vertex %func \"shader\" \n" + std::string(kVoidFVoid),
|
||||||
AllWebGPUCapabilities())
|
AllWebGPUCapabilities())
|
||||||
)),);
|
)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Capabilities, ValidateCapabilityVulkan11,
|
INSTANTIATE_TEST_SUITE_P(Capabilities, ValidateCapabilityVulkan11,
|
||||||
Combine(
|
Combine(
|
||||||
// All capabilities to try.
|
// All capabilities to try.
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
@ -1586,7 +1586,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
|||||||
"OpDecorate %intt BuiltIn CullDistance\n"
|
"OpDecorate %intt BuiltIn CullDistance\n"
|
||||||
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
||||||
AllVulkan11Capabilities())
|
AllVulkan11Capabilities())
|
||||||
)),);
|
)));
|
||||||
|
|
||||||
// TODO(umar): Selection Control
|
// TODO(umar): Selection Control
|
||||||
// TODO(umar): Loop Control
|
// TODO(umar): Loop Control
|
||||||
@ -1598,7 +1598,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
|||||||
// TODO(umar): Kernel Enqueue Flags
|
// TODO(umar): Kernel Enqueue Flags
|
||||||
// TODO(umar): Kernel Profiling Flags
|
// TODO(umar): Kernel Profiling Flags
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateCapability,
|
INSTANTIATE_TEST_SUITE_P(MatrixOp, ValidateCapability,
|
||||||
Combine(
|
Combine(
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
Values(
|
Values(
|
||||||
@ -1607,7 +1607,7 @@ std::make_pair(std::string(kOpenCLMemoryModel) +
|
|||||||
"%f32 = OpTypeFloat 32\n"
|
"%f32 = OpTypeFloat 32\n"
|
||||||
"%vec3 = OpTypeVector %f32 3\n"
|
"%vec3 = OpTypeVector %f32 3\n"
|
||||||
"%mat33 = OpTypeMatrix %vec3 3\n" + std::string(kVoidFVoid),
|
"%mat33 = OpTypeMatrix %vec3 3\n" + std::string(kVoidFVoid),
|
||||||
MatrixDependencies()))),);
|
MatrixDependencies()))));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@ -1648,7 +1648,7 @@ OpFunctionEnd
|
|||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
TwoImageOperandsMask, ValidateCapability,
|
TwoImageOperandsMask, ValidateCapability,
|
||||||
Combine(
|
Combine(
|
||||||
ValuesIn(AllCapabilities()),
|
ValuesIn(AllCapabilities()),
|
||||||
|
@ -171,9 +171,9 @@ const char* types_consts() {
|
|||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(StructuredControlFlow, ValidateCFG,
|
INSTANTIATE_TEST_SUITE_P(StructuredControlFlow, ValidateCFG,
|
||||||
::testing::Values(SpvCapabilityShader,
|
::testing::Values(SpvCapabilityShader,
|
||||||
SpvCapabilityKernel));
|
SpvCapabilityKernel));
|
||||||
|
|
||||||
TEST_P(ValidateCFG, LoopReachableFromEntryButNeverLeadingToReturn) {
|
TEST_P(ValidateCFG, LoopReachableFromEntryButNeverLeadingToReturn) {
|
||||||
// In this case, the loop is reachable from a node without a predecessor,
|
// In this case, the loop is reachable from a node without a predecessor,
|
||||||
|
@ -84,7 +84,7 @@ TEST_P(ValidateConstantOp, Samples) {
|
|||||||
{ SPV_ENV_UNIVERSAL_1_0, kShaderPreamble kBasicTypes STR, true, "" }
|
{ SPV_ENV_UNIVERSAL_1_0, kShaderPreamble kBasicTypes STR, true, "" }
|
||||||
#define GOOD_KERNEL_10(STR) \
|
#define GOOD_KERNEL_10(STR) \
|
||||||
{ SPV_ENV_UNIVERSAL_1_0, kKernelPreamble kBasicTypes STR, true, "" }
|
{ SPV_ENV_UNIVERSAL_1_0, kKernelPreamble kBasicTypes STR, true, "" }
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
UniversalInShader, ValidateConstantOp,
|
UniversalInShader, ValidateConstantOp,
|
||||||
ValuesIn(std::vector<ConstantOpCase>{
|
ValuesIn(std::vector<ConstantOpCase>{
|
||||||
// TODO(dneto): Conversions must change width.
|
// TODO(dneto): Conversions must change width.
|
||||||
@ -141,7 +141,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%v = OpSpecConstantOp %bool SGreaterThanEqual %uint_0 %uint_0"),
|
"%v = OpSpecConstantOp %bool SGreaterThanEqual %uint_0 %uint_0"),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
UniversalInKernel, ValidateConstantOp,
|
UniversalInKernel, ValidateConstantOp,
|
||||||
ValuesIn(std::vector<ConstantOpCase>{
|
ValuesIn(std::vector<ConstantOpCase>{
|
||||||
// TODO(dneto): Conversions must change width.
|
// TODO(dneto): Conversions must change width.
|
||||||
@ -198,7 +198,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"%v = OpSpecConstantOp %bool SGreaterThanEqual %uint_0 %uint_0"),
|
"%v = OpSpecConstantOp %bool SGreaterThanEqual %uint_0 %uint_0"),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
KernelInKernel, ValidateConstantOp,
|
KernelInKernel, ValidateConstantOp,
|
||||||
ValuesIn(std::vector<ConstantOpCase>{
|
ValuesIn(std::vector<ConstantOpCase>{
|
||||||
// TODO(dneto): Conversions must change width.
|
// TODO(dneto): Conversions must change width.
|
||||||
@ -235,7 +235,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"Specialization constant operation " NAME \
|
"Specialization constant operation " NAME \
|
||||||
" requires Kernel capability" \
|
" requires Kernel capability" \
|
||||||
}
|
}
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
KernelInShader, ValidateConstantOp,
|
KernelInShader, ValidateConstantOp,
|
||||||
ValuesIn(std::vector<ConstantOpCase>{
|
ValuesIn(std::vector<ConstantOpCase>{
|
||||||
// TODO(dneto): Conversions must change width.
|
// TODO(dneto): Conversions must change width.
|
||||||
@ -280,7 +280,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"InBoundsPtrAccessChain"),
|
"InBoundsPtrAccessChain"),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
UConvertInAMD_gpu_shader_int16, ValidateConstantOp,
|
UConvertInAMD_gpu_shader_int16, ValidateConstantOp,
|
||||||
ValuesIn(std::vector<ConstantOpCase>{
|
ValuesIn(std::vector<ConstantOpCase>{
|
||||||
// SPV_AMD_gpu_shader_int16 should enable UConvert for OpSpecConstantOp
|
// SPV_AMD_gpu_shader_int16 should enable UConvert for OpSpecConstantOp
|
||||||
|
@ -493,20 +493,20 @@ TEST_P(ValidateGlslStd450SqrtLike, IntOperand) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllSqrtLike, ValidateGlslStd450SqrtLike,
|
INSTANTIATE_TEST_SUITE_P(AllSqrtLike, ValidateGlslStd450SqrtLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"Round",
|
"Round",
|
||||||
"RoundEven",
|
"RoundEven",
|
||||||
"FAbs",
|
"FAbs",
|
||||||
"Trunc",
|
"Trunc",
|
||||||
"FSign",
|
"FSign",
|
||||||
"Floor",
|
"Floor",
|
||||||
"Ceil",
|
"Ceil",
|
||||||
"Fract",
|
"Fract",
|
||||||
"Sqrt",
|
"Sqrt",
|
||||||
"InverseSqrt",
|
"InverseSqrt",
|
||||||
"Normalize",
|
"Normalize",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateGlslStd450FMinLike, Success) {
|
TEST_P(ValidateGlslStd450FMinLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -560,15 +560,15 @@ TEST_P(ValidateGlslStd450FMinLike, IntOperand2) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllFMinLike, ValidateGlslStd450FMinLike,
|
INSTANTIATE_TEST_SUITE_P(AllFMinLike, ValidateGlslStd450FMinLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"FMin",
|
"FMin",
|
||||||
"FMax",
|
"FMax",
|
||||||
"Step",
|
"Step",
|
||||||
"Reflect",
|
"Reflect",
|
||||||
"NMin",
|
"NMin",
|
||||||
"NMax",
|
"NMax",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateGlslStd450FClampLike, Success) {
|
TEST_P(ValidateGlslStd450FClampLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -635,15 +635,15 @@ TEST_P(ValidateGlslStd450FClampLike, IntOperand3) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllFClampLike, ValidateGlslStd450FClampLike,
|
INSTANTIATE_TEST_SUITE_P(AllFClampLike, ValidateGlslStd450FClampLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"FClamp",
|
"FClamp",
|
||||||
"FMix",
|
"FMix",
|
||||||
"SmoothStep",
|
"SmoothStep",
|
||||||
"Fma",
|
"Fma",
|
||||||
"FaceForward",
|
"FaceForward",
|
||||||
"NClamp",
|
"NClamp",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateGlslStd450SAbsLike, Success) {
|
TEST_P(ValidateGlslStd450SAbsLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -716,14 +716,14 @@ TEST_P(ValidateGlslStd450SAbsLike, WrongBitWidthOperand) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllSAbsLike, ValidateGlslStd450SAbsLike,
|
INSTANTIATE_TEST_SUITE_P(AllSAbsLike, ValidateGlslStd450SAbsLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"SAbs",
|
"SAbs",
|
||||||
"SSign",
|
"SSign",
|
||||||
"FindILsb",
|
"FindILsb",
|
||||||
"FindUMsb",
|
"FindUMsb",
|
||||||
"FindSMsb",
|
"FindSMsb",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(ValidateExtInst, FindUMsbNot32Bit) {
|
TEST_F(ValidateExtInst, FindUMsbNot32Bit) {
|
||||||
const std::string body = R"(
|
const std::string body = R"(
|
||||||
@ -865,13 +865,13 @@ TEST_P(ValidateGlslStd450UMinLike, WrongBitWidthOperand2) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllUMinLike, ValidateGlslStd450UMinLike,
|
INSTANTIATE_TEST_SUITE_P(AllUMinLike, ValidateGlslStd450UMinLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"UMin",
|
"UMin",
|
||||||
"SMin",
|
"SMin",
|
||||||
"UMax",
|
"UMax",
|
||||||
"SMax",
|
"SMax",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateGlslStd450UClampLike, Success) {
|
TEST_P(ValidateGlslStd450UClampLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -1028,11 +1028,11 @@ TEST_P(ValidateGlslStd450UClampLike, WrongBitWidthOperand3) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllUClampLike, ValidateGlslStd450UClampLike,
|
INSTANTIATE_TEST_SUITE_P(AllUClampLike, ValidateGlslStd450UClampLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"UClamp",
|
"UClamp",
|
||||||
"SClamp",
|
"SClamp",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateGlslStd450SinLike, Success) {
|
TEST_P(ValidateGlslStd450SinLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -1083,27 +1083,27 @@ TEST_P(ValidateGlslStd450SinLike, IntOperand) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllSinLike, ValidateGlslStd450SinLike,
|
INSTANTIATE_TEST_SUITE_P(AllSinLike, ValidateGlslStd450SinLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"Radians",
|
"Radians",
|
||||||
"Degrees",
|
"Degrees",
|
||||||
"Sin",
|
"Sin",
|
||||||
"Cos",
|
"Cos",
|
||||||
"Tan",
|
"Tan",
|
||||||
"Asin",
|
"Asin",
|
||||||
"Acos",
|
"Acos",
|
||||||
"Atan",
|
"Atan",
|
||||||
"Sinh",
|
"Sinh",
|
||||||
"Cosh",
|
"Cosh",
|
||||||
"Tanh",
|
"Tanh",
|
||||||
"Asinh",
|
"Asinh",
|
||||||
"Acosh",
|
"Acosh",
|
||||||
"Atanh",
|
"Atanh",
|
||||||
"Exp",
|
"Exp",
|
||||||
"Exp2",
|
"Exp2",
|
||||||
"Log",
|
"Log",
|
||||||
"Log2",
|
"Log2",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateGlslStd450PowLike, Success) {
|
TEST_P(ValidateGlslStd450PowLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -1168,11 +1168,11 @@ TEST_P(ValidateGlslStd450PowLike, IntOperand2) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllPowLike, ValidateGlslStd450PowLike,
|
INSTANTIATE_TEST_SUITE_P(AllPowLike, ValidateGlslStd450PowLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"Atan2",
|
"Atan2",
|
||||||
"Pow",
|
"Pow",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(ValidateExtInst, GlslStd450DeterminantSuccess) {
|
TEST_F(ValidateExtInst, GlslStd450DeterminantSuccess) {
|
||||||
const std::string body = R"(
|
const std::string body = R"(
|
||||||
@ -1795,14 +1795,14 @@ TEST_P(ValidateGlslStd450Pack, VWrongSizeVector) {
|
|||||||
EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str()));
|
EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllPack, ValidateGlslStd450Pack,
|
INSTANTIATE_TEST_SUITE_P(AllPack, ValidateGlslStd450Pack,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"PackSnorm4x8",
|
"PackSnorm4x8",
|
||||||
"PackUnorm4x8",
|
"PackUnorm4x8",
|
||||||
"PackSnorm2x16",
|
"PackSnorm2x16",
|
||||||
"PackUnorm2x16",
|
"PackUnorm2x16",
|
||||||
"PackHalf2x16",
|
"PackHalf2x16",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(ValidateExtInst, PackDouble2x32Success) {
|
TEST_F(ValidateExtInst, PackDouble2x32Success) {
|
||||||
const std::string body = R"(
|
const std::string body = R"(
|
||||||
@ -2034,14 +2034,14 @@ TEST_P(ValidateGlslStd450Unpack, ResultPWrongBitWidth) {
|
|||||||
EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str()));
|
EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllUnpack, ValidateGlslStd450Unpack,
|
INSTANTIATE_TEST_SUITE_P(AllUnpack, ValidateGlslStd450Unpack,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"UnpackSnorm4x8",
|
"UnpackSnorm4x8",
|
||||||
"UnpackUnorm4x8",
|
"UnpackUnorm4x8",
|
||||||
"UnpackSnorm2x16",
|
"UnpackSnorm2x16",
|
||||||
"UnpackUnorm2x16",
|
"UnpackUnorm2x16",
|
||||||
"UnpackHalf2x16",
|
"UnpackHalf2x16",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(ValidateExtInst, UnpackDouble2x32Success) {
|
TEST_F(ValidateExtInst, UnpackDouble2x32Success) {
|
||||||
const std::string body = R"(
|
const std::string body = R"(
|
||||||
@ -2831,7 +2831,7 @@ TEST_P(ValidateOpenCLStdSqrtLike, IntOperand) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
AllSqrtLike, ValidateOpenCLStdSqrtLike,
|
AllSqrtLike, ValidateOpenCLStdSqrtLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"acos", "acosh", "acospi", "asin",
|
"acos", "acosh", "acospi", "asin",
|
||||||
@ -2851,7 +2851,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"native_log", "native_log2", "native_log10", "native_recip",
|
"native_log", "native_log2", "native_log10", "native_recip",
|
||||||
"native_rsqrt", "native_sin", "native_sqrt", "native_tan",
|
"native_rsqrt", "native_sin", "native_sqrt", "native_tan",
|
||||||
"degrees", "radians", "sign",
|
"degrees", "radians", "sign",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateOpenCLStdFMinLike, Success) {
|
TEST_P(ValidateOpenCLStdFMinLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -2905,16 +2905,16 @@ TEST_P(ValidateOpenCLStdFMinLike, IntOperand2) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllFMinLike, ValidateOpenCLStdFMinLike,
|
INSTANTIATE_TEST_SUITE_P(AllFMinLike, ValidateOpenCLStdFMinLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"atan2", "atan2pi", "copysign",
|
"atan2", "atan2pi", "copysign",
|
||||||
"fdim", "fmax", "fmin",
|
"fdim", "fmax", "fmin",
|
||||||
"fmod", "maxmag", "minmag",
|
"fmod", "maxmag", "minmag",
|
||||||
"hypot", "nextafter", "pow",
|
"hypot", "nextafter", "pow",
|
||||||
"powr", "remainder", "half_divide",
|
"powr", "remainder", "half_divide",
|
||||||
"half_powr", "native_divide", "native_powr",
|
"half_powr", "native_divide", "native_powr",
|
||||||
"step", "fmax_common", "fmin_common",
|
"step", "fmax_common", "fmin_common",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateOpenCLStdFClampLike, Success) {
|
TEST_P(ValidateOpenCLStdFClampLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -2981,14 +2981,14 @@ TEST_P(ValidateOpenCLStdFClampLike, IntOperand3) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllFClampLike, ValidateOpenCLStdFClampLike,
|
INSTANTIATE_TEST_SUITE_P(AllFClampLike, ValidateOpenCLStdFClampLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"fma",
|
"fma",
|
||||||
"mad",
|
"mad",
|
||||||
"fclamp",
|
"fclamp",
|
||||||
"mix",
|
"mix",
|
||||||
"smoothstep",
|
"smoothstep",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateOpenCLStdSAbsLike, Success) {
|
TEST_P(ValidateOpenCLStdSAbsLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -3048,14 +3048,14 @@ TEST_P(ValidateOpenCLStdSAbsLike, U64Operand) {
|
|||||||
": expected types of all operands to be equal to Result Type"));
|
": expected types of all operands to be equal to Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllSAbsLike, ValidateOpenCLStdSAbsLike,
|
INSTANTIATE_TEST_SUITE_P(AllSAbsLike, ValidateOpenCLStdSAbsLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"s_abs",
|
"s_abs",
|
||||||
"clz",
|
"clz",
|
||||||
"ctz",
|
"ctz",
|
||||||
"popcount",
|
"popcount",
|
||||||
"u_abs",
|
"u_abs",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateOpenCLStdUMinLike, Success) {
|
TEST_P(ValidateOpenCLStdUMinLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -3147,26 +3147,26 @@ TEST_P(ValidateOpenCLStdUMinLike, U64Operand2) {
|
|||||||
": expected types of all operands to be equal to Result Type"));
|
": expected types of all operands to be equal to Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllUMinLike, ValidateOpenCLStdUMinLike,
|
INSTANTIATE_TEST_SUITE_P(AllUMinLike, ValidateOpenCLStdUMinLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"s_max",
|
"s_max",
|
||||||
"u_max",
|
"u_max",
|
||||||
"s_min",
|
"s_min",
|
||||||
"u_min",
|
"u_min",
|
||||||
"s_abs_diff",
|
"s_abs_diff",
|
||||||
"s_add_sat",
|
"s_add_sat",
|
||||||
"u_add_sat",
|
"u_add_sat",
|
||||||
"s_mul_hi",
|
"s_mul_hi",
|
||||||
"rotate",
|
"rotate",
|
||||||
"s_sub_sat",
|
"s_sub_sat",
|
||||||
"u_sub_sat",
|
"u_sub_sat",
|
||||||
"s_hadd",
|
"s_hadd",
|
||||||
"u_hadd",
|
"u_hadd",
|
||||||
"s_rhadd",
|
"s_rhadd",
|
||||||
"u_rhadd",
|
"u_rhadd",
|
||||||
"u_abs_diff",
|
"u_abs_diff",
|
||||||
"u_mul_hi",
|
"u_mul_hi",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateOpenCLStdUClampLike, Success) {
|
TEST_P(ValidateOpenCLStdUClampLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -3284,15 +3284,15 @@ TEST_P(ValidateOpenCLStdUClampLike, U64Operand3) {
|
|||||||
": expected types of all operands to be equal to Result Type"));
|
": expected types of all operands to be equal to Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllUClampLike, ValidateOpenCLStdUClampLike,
|
INSTANTIATE_TEST_SUITE_P(AllUClampLike, ValidateOpenCLStdUClampLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"s_clamp",
|
"s_clamp",
|
||||||
"u_clamp",
|
"u_clamp",
|
||||||
"s_mad_hi",
|
"s_mad_hi",
|
||||||
"u_mad_sat",
|
"u_mad_sat",
|
||||||
"s_mad_sat",
|
"s_mad_sat",
|
||||||
"u_mad_hi",
|
"u_mad_hi",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
TEST_P(ValidateOpenCLStdUMul24Like, Success) {
|
TEST_P(ValidateOpenCLStdUMul24Like, Success) {
|
||||||
@ -3398,11 +3398,11 @@ TEST_P(ValidateOpenCLStdUMul24Like, U64Operand2) {
|
|||||||
": expected types of all operands to be equal to Result Type"));
|
": expected types of all operands to be equal to Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllUMul24Like, ValidateOpenCLStdUMul24Like,
|
INSTANTIATE_TEST_SUITE_P(AllUMul24Like, ValidateOpenCLStdUMul24Like,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"s_mul24",
|
"s_mul24",
|
||||||
"u_mul24",
|
"u_mul24",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateOpenCLStdUMad24Like, Success) {
|
TEST_P(ValidateOpenCLStdUMad24Like, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -3533,11 +3533,11 @@ TEST_P(ValidateOpenCLStdUMad24Like, U64Operand3) {
|
|||||||
": expected types of all operands to be equal to Result Type"));
|
": expected types of all operands to be equal to Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllUMad24Like, ValidateOpenCLStdUMad24Like,
|
INSTANTIATE_TEST_SUITE_P(AllUMad24Like, ValidateOpenCLStdUMad24Like,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"s_mad24",
|
"s_mad24",
|
||||||
"u_mad24",
|
"u_mad24",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(ValidateExtInst, OpenCLStdCrossSuccess) {
|
TEST_F(ValidateExtInst, OpenCLStdCrossSuccess) {
|
||||||
const std::string body = R"(
|
const std::string body = R"(
|
||||||
@ -3662,11 +3662,11 @@ TEST_P(ValidateOpenCLStdLengthLike, DifferentType) {
|
|||||||
"Result Type"));
|
"Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllLengthLike, ValidateOpenCLStdLengthLike,
|
INSTANTIATE_TEST_SUITE_P(AllLengthLike, ValidateOpenCLStdLengthLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"length",
|
"length",
|
||||||
"fast_length",
|
"fast_length",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateOpenCLStdDistanceLike, Success) {
|
TEST_P(ValidateOpenCLStdDistanceLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -3751,11 +3751,11 @@ TEST_P(ValidateOpenCLStdDistanceLike, DifferentOperands) {
|
|||||||
"expected operands P0 and P1 to be of the same type"));
|
"expected operands P0 and P1 to be of the same type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllDistanceLike, ValidateOpenCLStdDistanceLike,
|
INSTANTIATE_TEST_SUITE_P(AllDistanceLike, ValidateOpenCLStdDistanceLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"distance",
|
"distance",
|
||||||
"fast_distance",
|
"fast_distance",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateOpenCLStdNormalizeLike, Success) {
|
TEST_P(ValidateOpenCLStdNormalizeLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -3811,11 +3811,11 @@ TEST_P(ValidateOpenCLStdNormalizeLike, DifferentType) {
|
|||||||
"expected operand P type to be equal to Result Type"));
|
"expected operand P type to be equal to Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllNormalizeLike, ValidateOpenCLStdNormalizeLike,
|
INSTANTIATE_TEST_SUITE_P(AllNormalizeLike, ValidateOpenCLStdNormalizeLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"normalize",
|
"normalize",
|
||||||
"fast_normalize",
|
"fast_normalize",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(ValidateExtInst, OpenCLStdBitselectSuccess) {
|
TEST_F(ValidateExtInst, OpenCLStdBitselectSuccess) {
|
||||||
const std::string body = R"(
|
const std::string body = R"(
|
||||||
@ -4208,15 +4208,15 @@ TEST_P(ValidateOpenCLStdVStoreHalfLike, PDataTypeFloat32) {
|
|||||||
": expected operand P data type to be 16-bit float scalar"));
|
": expected operand P data type to be 16-bit float scalar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllVStoreHalfLike, ValidateOpenCLStdVStoreHalfLike,
|
INSTANTIATE_TEST_SUITE_P(AllVStoreHalfLike, ValidateOpenCLStdVStoreHalfLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"vstore_half",
|
"vstore_half",
|
||||||
"vstore_half_r",
|
"vstore_half_r",
|
||||||
"vstore_halfn",
|
"vstore_halfn",
|
||||||
"vstore_halfn_r",
|
"vstore_halfn_r",
|
||||||
"vstorea_halfn",
|
"vstorea_halfn",
|
||||||
"vstorea_halfn_r",
|
"vstorea_halfn_r",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateOpenCLStdVLoadHalfLike, SuccessPhysical32) {
|
TEST_P(ValidateOpenCLStdVLoadHalfLike, SuccessPhysical32) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -4375,11 +4375,11 @@ TEST_P(ValidateOpenCLStdVLoadHalfLike, WrongN) {
|
|||||||
"components of Result Type"));
|
"components of Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllVLoadHalfLike, ValidateOpenCLStdVLoadHalfLike,
|
INSTANTIATE_TEST_SUITE_P(AllVLoadHalfLike, ValidateOpenCLStdVLoadHalfLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"vload_halfn",
|
"vload_halfn",
|
||||||
"vloada_halfn",
|
"vloada_halfn",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(ValidateExtInst, VLoadNSuccessFloatPhysical32) {
|
TEST_F(ValidateExtInst, VLoadNSuccessFloatPhysical32) {
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
@ -5299,12 +5299,12 @@ TEST_P(ValidateOpenCLStdFractLike, PointerWrongDataType) {
|
|||||||
": expected data type of the pointer to be equal to Result Type"));
|
": expected data type of the pointer to be equal to Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllFractLike, ValidateOpenCLStdFractLike,
|
INSTANTIATE_TEST_SUITE_P(AllFractLike, ValidateOpenCLStdFractLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"fract",
|
"fract",
|
||||||
"modf",
|
"modf",
|
||||||
"sincos",
|
"sincos",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(ValidateExtInst, OpenCLStdRemquoSuccess) {
|
TEST_F(ValidateExtInst, OpenCLStdRemquoSuccess) {
|
||||||
const std::string body = R"(
|
const std::string body = R"(
|
||||||
@ -5518,11 +5518,11 @@ TEST_P(ValidateOpenCLStdFrexpLike, PointerDataTypeDiffSize) {
|
|||||||
"number of components as Result Type"));
|
"number of components as Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllFrexpLike, ValidateOpenCLStdFrexpLike,
|
INSTANTIATE_TEST_SUITE_P(AllFrexpLike, ValidateOpenCLStdFrexpLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"frexp",
|
"frexp",
|
||||||
"lgamma_r",
|
"lgamma_r",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_F(ValidateExtInst, OpenCLStdIlogbSuccess) {
|
TEST_F(ValidateExtInst, OpenCLStdIlogbSuccess) {
|
||||||
const std::string body = R"(
|
const std::string body = R"(
|
||||||
@ -5716,12 +5716,12 @@ TEST_P(ValidateOpenCLStdLdexpLike, ExponentWrongSize) {
|
|||||||
"components as Result Type"));
|
"components as Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllLdexpLike, ValidateOpenCLStdLdexpLike,
|
INSTANTIATE_TEST_SUITE_P(AllLdexpLike, ValidateOpenCLStdLdexpLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"ldexp",
|
"ldexp",
|
||||||
"pown",
|
"pown",
|
||||||
"rootn",
|
"rootn",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
TEST_P(ValidateOpenCLStdUpsampleLike, Success) {
|
TEST_P(ValidateOpenCLStdUpsampleLike, Success) {
|
||||||
const std::string ext_inst_name = GetParam();
|
const std::string ext_inst_name = GetParam();
|
||||||
@ -5808,11 +5808,11 @@ TEST_P(ValidateOpenCLStdUpsampleLike, HiLoWrongBitWidth) {
|
|||||||
"be half of the bit width of components of Result Type"));
|
"be half of the bit width of components of Result Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(AllUpsampleLike, ValidateOpenCLStdUpsampleLike,
|
INSTANTIATE_TEST_SUITE_P(AllUpsampleLike, ValidateOpenCLStdUpsampleLike,
|
||||||
::testing::ValuesIn(std::vector<std::string>{
|
::testing::ValuesIn(std::vector<std::string>{
|
||||||
"u_upsample",
|
"u_upsample",
|
||||||
"s_upsample",
|
"s_upsample",
|
||||||
}), );
|
}));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace val
|
} // namespace val
|
||||||
|
@ -43,7 +43,7 @@ std::string GetErrorString(const std::string& extension) {
|
|||||||
return "Found unrecognized extension " + extension;
|
return "Found unrecognized extension " + extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ExpectSuccess, ValidateKnownExtensions,
|
ExpectSuccess, ValidateKnownExtensions,
|
||||||
Values(
|
Values(
|
||||||
// Match the order as published on the SPIR-V Registry.
|
// Match the order as published on the SPIR-V Registry.
|
||||||
@ -64,9 +64,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1",
|
"SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1",
|
||||||
"SPV_NV_shader_subgroup_partitioned", "SPV_EXT_descriptor_indexing"));
|
"SPV_NV_shader_subgroup_partitioned", "SPV_EXT_descriptor_indexing"));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(FailSilently, ValidateUnknownExtensions,
|
INSTANTIATE_TEST_SUITE_P(FailSilently, ValidateUnknownExtensions,
|
||||||
Values("ERROR_unknown_extension", "SPV_KHR_",
|
Values("ERROR_unknown_extension", "SPV_KHR_",
|
||||||
"SPV_KHR_shader_ballot_ERROR"));
|
"SPV_KHR_shader_ballot_ERROR"));
|
||||||
|
|
||||||
TEST_P(ValidateKnownExtensions, ExpectSuccess) {
|
TEST_P(ValidateKnownExtensions, ExpectSuccess) {
|
||||||
const std::string extension = GetParam();
|
const std::string extension = GetParam();
|
||||||
@ -227,8 +227,8 @@ TEST_P(ValidateAMDShaderBallotCapabilities, ExpectSuccess) {
|
|||||||
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString();
|
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString();
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ExpectSuccess, ValidateAMDShaderBallotCapabilities,
|
INSTANTIATE_TEST_SUITE_P(ExpectSuccess, ValidateAMDShaderBallotCapabilities,
|
||||||
ValuesIn(AMDShaderBallotGroupInstructions()));
|
ValuesIn(AMDShaderBallotGroupInstructions()));
|
||||||
|
|
||||||
TEST_P(ValidateAMDShaderBallotCapabilities, ExpectFailure) {
|
TEST_P(ValidateAMDShaderBallotCapabilities, ExpectFailure) {
|
||||||
// Fail because the module does not specify the SPV_AMD_shader_ballot
|
// Fail because the module does not specify the SPV_AMD_shader_ballot
|
||||||
@ -251,8 +251,8 @@ TEST_P(ValidateAMDShaderBallotCapabilities, ExpectFailure) {
|
|||||||
" requires one of these capabilities: Groups")));
|
" requires one of these capabilities: Groups")));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ExpectFailure, ValidateAMDShaderBallotCapabilities,
|
INSTANTIATE_TEST_SUITE_P(ExpectFailure, ValidateAMDShaderBallotCapabilities,
|
||||||
ValuesIn(AMDShaderBallotGroupInstructions()));
|
ValuesIn(AMDShaderBallotGroupInstructions()));
|
||||||
|
|
||||||
struct ExtIntoCoreCase {
|
struct ExtIntoCoreCase {
|
||||||
const char* ext;
|
const char* ext;
|
||||||
@ -305,7 +305,7 @@ TEST_P(ValidateExtIntoCore, DoNotAskForExtensionInLaterVersion) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
KHR_extensions, ValidateExtIntoCore,
|
KHR_extensions, ValidateExtIntoCore,
|
||||||
ValuesIn(std::vector<ExtIntoCoreCase>{
|
ValuesIn(std::vector<ExtIntoCoreCase>{
|
||||||
// SPV_KHR_shader_draw_parameters became core SPIR-V 1.3
|
// SPV_KHR_shader_draw_parameters became core SPIR-V 1.3
|
||||||
|
@ -857,8 +857,8 @@ TEST_P(OpTypeArrayLengthTest, LengthNegative) {
|
|||||||
// capability prohibits usage of signed integers, we can skip 8-bit integers
|
// capability prohibits usage of signed integers, we can skip 8-bit integers
|
||||||
// here since the purpose of these tests is to check the validity of
|
// here since the purpose of these tests is to check the validity of
|
||||||
// OpTypeArray, not OpTypeInt.
|
// OpTypeArray, not OpTypeInt.
|
||||||
INSTANTIATE_TEST_CASE_P(Widths, OpTypeArrayLengthTest,
|
INSTANTIATE_TEST_SUITE_P(Widths, OpTypeArrayLengthTest,
|
||||||
ValuesIn(std::vector<int>{16, 32, 64}));
|
ValuesIn(std::vector<int>{16, 32, 64}));
|
||||||
|
|
||||||
TEST_F(ValidateIdWithMessage, OpTypeArrayLengthNull) {
|
TEST_F(ValidateIdWithMessage, OpTypeArrayLengthNull) {
|
||||||
std::string spirv = kGLSL450MemoryModel + R"(
|
std::string spirv = kGLSL450MemoryModel + R"(
|
||||||
@ -3918,7 +3918,7 @@ OpFunctionEnd
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run tests for Access Chain Instructions.
|
// Run tests for Access Chain Instructions.
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
CheckAccessChainInstructions, AccessChainInstructionTest,
|
CheckAccessChainInstructions, AccessChainInstructionTest,
|
||||||
::testing::Values("OpAccessChain", "OpInBoundsAccessChain",
|
::testing::Values("OpAccessChain", "OpInBoundsAccessChain",
|
||||||
"OpPtrAccessChain", "OpInBoundsPtrAccessChain"));
|
"OpPtrAccessChain", "OpInBoundsPtrAccessChain"));
|
||||||
|
@ -120,7 +120,7 @@ const std::vector<std::string>& getInstructions() {
|
|||||||
static const int kRangeEnd = 1000;
|
static const int kRangeEnd = 1000;
|
||||||
pred_type All = Range<0, kRangeEnd>();
|
pred_type All = Range<0, kRangeEnd>();
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(InstructionsOrder,
|
INSTANTIATE_TEST_SUITE_P(InstructionsOrder,
|
||||||
ValidateLayout,
|
ValidateLayout,
|
||||||
::testing::Combine(::testing::Range((int)0, (int)getInstructions().size()),
|
::testing::Combine(::testing::Range((int)0, (int)getInstructions().size()),
|
||||||
// Note: Because of ID dependencies between instructions, some instructions
|
// Note: Because of ID dependencies between instructions, some instructions
|
||||||
@ -160,7 +160,7 @@ INSTANTIATE_TEST_CASE_P(InstructionsOrder,
|
|||||||
, std::make_tuple(std::string("%fLabel = OpLabel") , Equals<39> , All)
|
, std::make_tuple(std::string("%fLabel = OpLabel") , Equals<39> , All)
|
||||||
, std::make_tuple(std::string("OpNop") , Equals<40> , Range<40,kRangeEnd>())
|
, std::make_tuple(std::string("OpNop") , Equals<40> , Range<40,kRangeEnd>())
|
||||||
, std::make_tuple(std::string("OpReturn ; %func2 return") , Equals<41> , All)
|
, std::make_tuple(std::string("OpReturn ; %func2 return") , Equals<41> , All)
|
||||||
)),);
|
)));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// Creates a new vector which removes the string if the substr is found in the
|
// Creates a new vector which removes the string if the substr is found in the
|
||||||
@ -181,7 +181,7 @@ std::vector<std::string> GenerateCode(std::string substr, int order) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This test will check the logical layout of a binary by removing each
|
// This test will check the logical layout of a binary by removing each
|
||||||
// instruction in the pair of the INSTANTIATE_TEST_CASE_P call and moving it in
|
// instruction in the pair of the INSTANTIATE_TEST_SUITE_P call and moving it in
|
||||||
// the SPIRV source formed by combining the vector "instructions".
|
// the SPIRV source formed by combining the vector "instructions".
|
||||||
TEST_P(ValidateLayout, Layout) {
|
TEST_P(ValidateLayout, Layout) {
|
||||||
int order;
|
int order;
|
||||||
|
@ -99,7 +99,7 @@ TEST_P(ValidateLiteralsShader, LiteralsShaderBad) {
|
|||||||
"or sign extended when Signedness is 1"));
|
"or sign extended when Signedness is 1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
LiteralsShaderCases, ValidateLiteralsShader,
|
LiteralsShaderCases, ValidateLiteralsShader,
|
||||||
::testing::Values("%11 = OpConstant %int16 !0xFFFF0000", // Sign bit is 0
|
::testing::Values("%11 = OpConstant %int16 !0xFFFF0000", // Sign bit is 0
|
||||||
"%11 = OpConstant %int16 !0x00008000", // Sign bit is 1
|
"%11 = OpConstant %int16 !0x00008000", // Sign bit is 1
|
||||||
@ -132,7 +132,7 @@ TEST_P(ValidateLiteralsKernel, LiteralsKernelBad) {
|
|||||||
"or sign extended when Signedness is 1"));
|
"or sign extended when Signedness is 1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
LiteralsKernelCases, ValidateLiteralsKernel,
|
LiteralsKernelCases, ValidateLiteralsKernel,
|
||||||
::testing::Values("%2 = OpConstant %uint8 !0xABCDEF00",
|
::testing::Values("%2 = OpConstant %uint8 !0xABCDEF00",
|
||||||
"%2 = OpConstant %uint8 !0xABCDEFFF"));
|
"%2 = OpConstant %uint8 !0xABCDEFFF"));
|
||||||
|
@ -510,7 +510,7 @@ TEST_P(ValidateModeGeometry, ExecutionMode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
GeometryRequiredModes, ValidateModeGeometry,
|
GeometryRequiredModes, ValidateModeGeometry,
|
||||||
Combine(Combine(Values("InputPoints", ""), Values("InputLines", ""),
|
Combine(Combine(Values("InputPoints", ""), Values("InputLines", ""),
|
||||||
Values("InputLinesAdjacency", ""), Values("Triangles", ""),
|
Values("InputLinesAdjacency", ""), Values("Triangles", ""),
|
||||||
@ -584,7 +584,7 @@ TEST_P(ValidateModeExecution, ExecutionMode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidateModeGeometryOnlyGoodSpv10, ValidateModeExecution,
|
ValidateModeGeometryOnlyGoodSpv10, ValidateModeExecution,
|
||||||
Combine(Values(SPV_SUCCESS), Values(""), Values("Geometry"),
|
Combine(Values(SPV_SUCCESS), Values(""), Values("Geometry"),
|
||||||
Values("Invocations 3", "InputPoints", "InputLines",
|
Values("Invocations 3", "InputPoints", "InputLines",
|
||||||
@ -592,7 +592,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"OutputPoints", "OutputLineStrip", "OutputTriangleStrip"),
|
"OutputPoints", "OutputLineStrip", "OutputTriangleStrip"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidateModeGeometryOnlyBadSpv10, ValidateModeExecution,
|
ValidateModeGeometryOnlyBadSpv10, ValidateModeExecution,
|
||||||
Combine(Values(SPV_ERROR_INVALID_DATA),
|
Combine(Values(SPV_ERROR_INVALID_DATA),
|
||||||
Values("Execution mode can only be used with the Geometry "
|
Values("Execution mode can only be used with the Geometry "
|
||||||
@ -604,7 +604,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"OutputPoints", "OutputLineStrip", "OutputTriangleStrip"),
|
"OutputPoints", "OutputLineStrip", "OutputTriangleStrip"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidateModeTessellationOnlyGoodSpv10, ValidateModeExecution,
|
ValidateModeTessellationOnlyGoodSpv10, ValidateModeExecution,
|
||||||
Combine(Values(SPV_SUCCESS), Values(""),
|
Combine(Values(SPV_SUCCESS), Values(""),
|
||||||
Values("TessellationControl", "TessellationEvaluation"),
|
Values("TessellationControl", "TessellationEvaluation"),
|
||||||
@ -613,7 +613,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"PointMode", "Quads", "Isolines"),
|
"PointMode", "Quads", "Isolines"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidateModeTessellationOnlyBadSpv10, ValidateModeExecution,
|
ValidateModeTessellationOnlyBadSpv10, ValidateModeExecution,
|
||||||
Combine(Values(SPV_ERROR_INVALID_DATA),
|
Combine(Values(SPV_ERROR_INVALID_DATA),
|
||||||
Values("Execution mode can only be used with a tessellation "
|
Values("Execution mode can only be used with a tessellation "
|
||||||
@ -624,15 +624,15 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"PointMode", "Quads", "Isolines"),
|
"PointMode", "Quads", "Isolines"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ValidateModeGeometryAndTessellationGoodSpv10,
|
INSTANTIATE_TEST_SUITE_P(ValidateModeGeometryAndTessellationGoodSpv10,
|
||||||
ValidateModeExecution,
|
ValidateModeExecution,
|
||||||
Combine(Values(SPV_SUCCESS), Values(""),
|
Combine(Values(SPV_SUCCESS), Values(""),
|
||||||
Values("TessellationControl",
|
Values("TessellationControl",
|
||||||
"TessellationEvaluation", "Geometry"),
|
"TessellationEvaluation", "Geometry"),
|
||||||
Values("Triangles", "OutputVertices 3"),
|
Values("Triangles", "OutputVertices 3"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidateModeGeometryAndTessellationBadSpv10, ValidateModeExecution,
|
ValidateModeGeometryAndTessellationBadSpv10, ValidateModeExecution,
|
||||||
Combine(Values(SPV_ERROR_INVALID_DATA),
|
Combine(Values(SPV_ERROR_INVALID_DATA),
|
||||||
Values("Execution mode can only be used with a Geometry or "
|
Values("Execution mode can only be used with a Geometry or "
|
||||||
@ -641,7 +641,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
Values("Triangles", "OutputVertices 3"),
|
Values("Triangles", "OutputVertices 3"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidateModeFragmentOnlyGoodSpv10, ValidateModeExecution,
|
ValidateModeFragmentOnlyGoodSpv10, ValidateModeExecution,
|
||||||
Combine(Values(SPV_SUCCESS), Values(""), Values("Fragment"),
|
Combine(Values(SPV_SUCCESS), Values(""), Values("Fragment"),
|
||||||
Values("PixelCenterInteger", "OriginUpperLeft", "OriginLowerLeft",
|
Values("PixelCenterInteger", "OriginUpperLeft", "OriginLowerLeft",
|
||||||
@ -649,7 +649,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"DepthUnchanged"),
|
"DepthUnchanged"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidateModeFragmentOnlyBadSpv10, ValidateModeExecution,
|
ValidateModeFragmentOnlyBadSpv10, ValidateModeExecution,
|
||||||
Combine(Values(SPV_ERROR_INVALID_DATA),
|
Combine(Values(SPV_ERROR_INVALID_DATA),
|
||||||
Values("Execution mode can only be used with the Fragment "
|
Values("Execution mode can only be used with the Fragment "
|
||||||
@ -661,15 +661,15 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"DepthUnchanged"),
|
"DepthUnchanged"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(ValidateModeKernelOnlyGoodSpv13, ValidateModeExecution,
|
INSTANTIATE_TEST_SUITE_P(ValidateModeKernelOnlyGoodSpv13, ValidateModeExecution,
|
||||||
Combine(Values(SPV_SUCCESS), Values(""),
|
Combine(Values(SPV_SUCCESS), Values(""),
|
||||||
Values("Kernel"),
|
Values("Kernel"),
|
||||||
Values("LocalSizeHint 1 1 1", "VecTypeHint 4",
|
Values("LocalSizeHint 1 1 1", "VecTypeHint 4",
|
||||||
"ContractionOff",
|
"ContractionOff",
|
||||||
"LocalSizeHintId %int1"),
|
"LocalSizeHintId %int1"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_3)));
|
Values(SPV_ENV_UNIVERSAL_1_3)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidateModeKernelOnlyBadSpv13, ValidateModeExecution,
|
ValidateModeKernelOnlyBadSpv13, ValidateModeExecution,
|
||||||
Combine(
|
Combine(
|
||||||
Values(SPV_ERROR_INVALID_DATA),
|
Values(SPV_ERROR_INVALID_DATA),
|
||||||
@ -681,13 +681,13 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
"LocalSizeHintId %int1"),
|
"LocalSizeHintId %int1"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_3)));
|
Values(SPV_ENV_UNIVERSAL_1_3)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidateModeGLComputeAndKernelGoodSpv13, ValidateModeExecution,
|
ValidateModeGLComputeAndKernelGoodSpv13, ValidateModeExecution,
|
||||||
Combine(Values(SPV_SUCCESS), Values(""), Values("Kernel", "GLCompute"),
|
Combine(Values(SPV_SUCCESS), Values(""), Values("Kernel", "GLCompute"),
|
||||||
Values("LocalSize 1 1 1", "LocalSizeId %int1 %int1 %int1"),
|
Values("LocalSize 1 1 1", "LocalSizeId %int1 %int1 %int1"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_3)));
|
Values(SPV_ENV_UNIVERSAL_1_3)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidateModeGLComputeAndKernelBadSpv13, ValidateModeExecution,
|
ValidateModeGLComputeAndKernelBadSpv13, ValidateModeExecution,
|
||||||
Combine(Values(SPV_ERROR_INVALID_DATA),
|
Combine(Values(SPV_ERROR_INVALID_DATA),
|
||||||
Values("Execution mode can only be used with a Kernel or GLCompute "
|
Values("Execution mode can only be used with a Kernel or GLCompute "
|
||||||
@ -697,7 +697,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
Values("LocalSize 1 1 1", "LocalSizeId %int1 %int1 %int1"),
|
Values("LocalSize 1 1 1", "LocalSizeId %int1 %int1 %int1"),
|
||||||
Values(SPV_ENV_UNIVERSAL_1_3)));
|
Values(SPV_ENV_UNIVERSAL_1_3)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ValidateModeAllGoodSpv13, ValidateModeExecution,
|
ValidateModeAllGoodSpv13, ValidateModeExecution,
|
||||||
Combine(Values(SPV_SUCCESS), Values(""),
|
Combine(Values(SPV_SUCCESS), Values(""),
|
||||||
Values("Kernel", "GLCompute", "Geometry", "TessellationControl",
|
Values("Kernel", "GLCompute", "Geometry", "TessellationControl",
|
||||||
|
@ -182,63 +182,63 @@ TEST_P(GroupNonUniform, Spirv1p3) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformElect, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformElect, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformElect"),
|
Combine(Values("OpGroupNonUniformElect"),
|
||||||
Values("%bool"), ValuesIn(scopes), Values(""),
|
Values("%bool"), ValuesIn(scopes), Values(""),
|
||||||
Values("")));
|
Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformVote, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformVote, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformAll",
|
Combine(Values("OpGroupNonUniformAll",
|
||||||
"OpGroupNonUniformAny",
|
"OpGroupNonUniformAny",
|
||||||
"OpGroupNonUniformAllEqual"),
|
"OpGroupNonUniformAllEqual"),
|
||||||
Values("%bool"), ValuesIn(scopes),
|
Values("%bool"), ValuesIn(scopes),
|
||||||
Values("%true"), Values("")));
|
Values("%true"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBroadcast, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBroadcast, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformBroadcast"),
|
Combine(Values("OpGroupNonUniformBroadcast"),
|
||||||
Values("%bool"), ValuesIn(scopes),
|
Values("%bool"), ValuesIn(scopes),
|
||||||
Values("%true %u32_0"), Values("")));
|
Values("%true %u32_0"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBroadcastFirst, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBroadcastFirst, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformBroadcastFirst"),
|
Combine(Values("OpGroupNonUniformBroadcastFirst"),
|
||||||
Values("%bool"), ValuesIn(scopes),
|
Values("%bool"), ValuesIn(scopes),
|
||||||
Values("%true"), Values("")));
|
Values("%true"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallot, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallot, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformBallot"),
|
Combine(Values("OpGroupNonUniformBallot"),
|
||||||
Values("%u32vec4"), ValuesIn(scopes),
|
Values("%u32vec4"), ValuesIn(scopes),
|
||||||
Values("%true"), Values("")));
|
Values("%true"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformInverseBallot, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformInverseBallot, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformInverseBallot"),
|
Combine(Values("OpGroupNonUniformInverseBallot"),
|
||||||
Values("%bool"), ValuesIn(scopes),
|
Values("%bool"), ValuesIn(scopes),
|
||||||
Values("%u32vec4_null"), Values("")));
|
Values("%u32vec4_null"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitExtract, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitExtract, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformBallotBitExtract"),
|
Combine(Values("OpGroupNonUniformBallotBitExtract"),
|
||||||
Values("%bool"), ValuesIn(scopes),
|
Values("%bool"), ValuesIn(scopes),
|
||||||
Values("%u32vec4_null %u32_0"), Values("")));
|
Values("%u32vec4_null %u32_0"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitCount, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitCount, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
||||||
Values("%u32"), ValuesIn(scopes),
|
Values("%u32"), ValuesIn(scopes),
|
||||||
Values("Reduce %u32vec4_null"), Values("")));
|
Values("Reduce %u32vec4_null"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotFind, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotFind, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformBallotFindLSB",
|
Combine(Values("OpGroupNonUniformBallotFindLSB",
|
||||||
"OpGroupNonUniformBallotFindMSB"),
|
"OpGroupNonUniformBallotFindMSB"),
|
||||||
Values("%u32"), ValuesIn(scopes),
|
Values("%u32"), ValuesIn(scopes),
|
||||||
Values("%u32vec4_null"), Values("")));
|
Values("%u32vec4_null"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformShuffle, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformShuffle, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformShuffle",
|
Combine(Values("OpGroupNonUniformShuffle",
|
||||||
"OpGroupNonUniformShuffleXor",
|
"OpGroupNonUniformShuffleXor",
|
||||||
"OpGroupNonUniformShuffleUp",
|
"OpGroupNonUniformShuffleUp",
|
||||||
"OpGroupNonUniformShuffleDown"),
|
"OpGroupNonUniformShuffleDown"),
|
||||||
Values("%u32"), ValuesIn(scopes),
|
Values("%u32"), ValuesIn(scopes),
|
||||||
Values("%u32_0 %u32_0"), Values("")));
|
Values("%u32_0 %u32_0"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
GroupNonUniformIntegerArithmetic, GroupNonUniform,
|
GroupNonUniformIntegerArithmetic, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformIAdd", "OpGroupNonUniformIMul",
|
Combine(Values("OpGroupNonUniformIAdd", "OpGroupNonUniformIMul",
|
||||||
"OpGroupNonUniformSMin", "OpGroupNonUniformUMin",
|
"OpGroupNonUniformSMin", "OpGroupNonUniformUMin",
|
||||||
@ -248,45 +248,45 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
Values("%u32"), ValuesIn(scopes), Values("Reduce %u32_0"),
|
Values("%u32"), ValuesIn(scopes), Values("Reduce %u32_0"),
|
||||||
Values("")));
|
Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
GroupNonUniformFloatArithmetic, GroupNonUniform,
|
GroupNonUniformFloatArithmetic, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformFAdd", "OpGroupNonUniformFMul",
|
Combine(Values("OpGroupNonUniformFAdd", "OpGroupNonUniformFMul",
|
||||||
"OpGroupNonUniformFMin", "OpGroupNonUniformFMax"),
|
"OpGroupNonUniformFMin", "OpGroupNonUniformFMax"),
|
||||||
Values("%float"), ValuesIn(scopes), Values("Reduce %float_0"),
|
Values("%float"), ValuesIn(scopes), Values("Reduce %float_0"),
|
||||||
Values("")));
|
Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformLogicalArithmetic, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformLogicalArithmetic, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformLogicalAnd",
|
Combine(Values("OpGroupNonUniformLogicalAnd",
|
||||||
"OpGroupNonUniformLogicalOr",
|
"OpGroupNonUniformLogicalOr",
|
||||||
"OpGroupNonUniformLogicalXor"),
|
"OpGroupNonUniformLogicalXor"),
|
||||||
Values("%bool"), ValuesIn(scopes),
|
Values("%bool"), ValuesIn(scopes),
|
||||||
Values("Reduce %true"), Values("")));
|
Values("Reduce %true"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformQuad, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformQuad, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformQuadBroadcast",
|
Combine(Values("OpGroupNonUniformQuadBroadcast",
|
||||||
"OpGroupNonUniformQuadSwap"),
|
"OpGroupNonUniformQuadSwap"),
|
||||||
Values("%u32"), ValuesIn(scopes),
|
Values("%u32"), ValuesIn(scopes),
|
||||||
Values("%u32_0 %u32_0"), Values("")));
|
Values("%u32_0 %u32_0"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitCountScope, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitCountScope, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
||||||
Values("%u32"), ValuesIn(scopes),
|
Values("%u32"), ValuesIn(scopes),
|
||||||
Values("Reduce %u32vec4_null"), Values("")));
|
Values("Reduce %u32vec4_null"), Values("")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
GroupNonUniformBallotBitCountBadResultType, GroupNonUniform,
|
GroupNonUniformBallotBitCountBadResultType, GroupNonUniform,
|
||||||
Combine(
|
Combine(
|
||||||
Values("OpGroupNonUniformBallotBitCount"), Values("%float", "%int"),
|
Values("OpGroupNonUniformBallotBitCount"), Values("%float", "%int"),
|
||||||
Values(SpvScopeSubgroup), Values("Reduce %u32vec4_null"),
|
Values(SpvScopeSubgroup), Values("Reduce %u32vec4_null"),
|
||||||
Values("Expected Result Type to be an unsigned integer type scalar.")));
|
Values("Expected Result Type to be an unsigned integer type scalar.")));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitCountBadValue, GroupNonUniform,
|
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitCountBadValue, GroupNonUniform,
|
||||||
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
||||||
Values("%u32"), Values(SpvScopeSubgroup),
|
Values("%u32"), Values(SpvScopeSubgroup),
|
||||||
Values("Reduce %u32vec3_null", "Reduce %u32_0",
|
Values("Reduce %u32vec3_null", "Reduce %u32_0",
|
||||||
"Reduce %float_0"),
|
"Reduce %float_0"),
|
||||||
Values("Expected Value to be a vector of four "
|
Values("Expected Value to be a vector of four "
|
||||||
"components of integer type scalar")));
|
"components of integer type scalar")));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace val
|
} // namespace val
|
||||||
|
@ -823,7 +823,7 @@ std::pair<std::string, bool> cases[] = {
|
|||||||
{"OpGetKernelWorkGroupSize", kNoNDrange},
|
{"OpGetKernelWorkGroupSize", kNoNDrange},
|
||||||
{"OpGetKernelPreferredWorkGroupSizeMultiple", kNoNDrange}};
|
{"OpGetKernelPreferredWorkGroupSizeMultiple", kNoNDrange}};
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(KernelArgs, ValidateSSA, ::testing::ValuesIn(cases), );
|
INSTANTIATE_TEST_SUITE_P(KernelArgs, ValidateSSA, ::testing::ValuesIn(cases));
|
||||||
|
|
||||||
static const std::string return_instructions = R"(
|
static const std::string return_instructions = R"(
|
||||||
OpReturn
|
OpReturn
|
||||||
|
@ -137,7 +137,7 @@ TEST_P(ValidateStorage, OtherStorageInsideFunction) {
|
|||||||
"Variables must have a function[7] storage class inside of a function"));
|
"Variables must have a function[7] storage class inside of a function"));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateStorage,
|
INSTANTIATE_TEST_SUITE_P(MatrixOp, ValidateStorage,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
"Input",
|
"Input",
|
||||||
"Uniform",
|
"Uniform",
|
||||||
@ -147,7 +147,7 @@ INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateStorage,
|
|||||||
"Private",
|
"Private",
|
||||||
"PushConstant",
|
"PushConstant",
|
||||||
"AtomicCounter",
|
"AtomicCounter",
|
||||||
"Image"),);
|
"Image"));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
TEST_F(ValidateStorage, GenericVariableOutsideFunction) {
|
TEST_F(ValidateStorage, GenericVariableOutsideFunction) {
|
||||||
|
@ -108,7 +108,7 @@ TEST_P(ValidateVersion, version) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(Universal, ValidateVersion,
|
INSTANTIATE_TEST_SUITE_P(Universal, ValidateVersion,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Binary version, Target environment
|
// Binary version, Target environment
|
||||||
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_0, vulkan_spirv, true),
|
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_0, vulkan_spirv, true),
|
||||||
@ -165,7 +165,7 @@ INSTANTIATE_TEST_CASE_P(Universal, ValidateVersion,
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Vulkan, ValidateVersion,
|
INSTANTIATE_TEST_SUITE_P(Vulkan, ValidateVersion,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Binary version, Target environment
|
// Binary version, Target environment
|
||||||
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_UNIVERSAL_1_0, vulkan_spirv, true),
|
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_UNIVERSAL_1_0, vulkan_spirv, true),
|
||||||
@ -194,7 +194,7 @@ INSTANTIATE_TEST_CASE_P(Vulkan, ValidateVersion,
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(OpenCL, ValidateVersion,
|
INSTANTIATE_TEST_SUITE_P(OpenCL, ValidateVersion,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Binary version, Target environment
|
// Binary version, Target environment
|
||||||
std::make_tuple(SPV_ENV_OPENCL_2_0, SPV_ENV_UNIVERSAL_1_0, opencl_spirv, true),
|
std::make_tuple(SPV_ENV_OPENCL_2_0, SPV_ENV_UNIVERSAL_1_0, opencl_spirv, true),
|
||||||
@ -247,7 +247,7 @@ INSTANTIATE_TEST_CASE_P(OpenCL, ValidateVersion,
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(OpenCLEmbedded, ValidateVersion,
|
INSTANTIATE_TEST_SUITE_P(OpenCLEmbedded, ValidateVersion,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// Binary version, Target environment
|
// Binary version, Target environment
|
||||||
std::make_tuple(SPV_ENV_OPENCL_EMBEDDED_2_0, SPV_ENV_UNIVERSAL_1_0, opencl_spirv, true),
|
std::make_tuple(SPV_ENV_OPENCL_EMBEDDED_2_0, SPV_ENV_UNIVERSAL_1_0, opencl_spirv, true),
|
||||||
|
Loading…
Reference in New Issue
Block a user