mirror of
https://gitee.com/openharmony/third_party_spirv-tools
synced 2024-11-26 17:10:52 +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
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
BinaryEncodeString, EncodeStringTest,
|
||||
::testing::ValuesIn(std::vector<EncodeStringCase>{
|
||||
// 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.
|
||||
// SPIR-V limits strings to 65535 characters.
|
||||
{std::string(65535, 'a'), {1}},
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
} // namespace
|
||||
|
@ -561,7 +561,7 @@ TEST_P(BinaryParseWordsAndCountDiagnosticTest, WordAndCountCases) {
|
||||
EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
BinaryParseDiagnostic, BinaryParseWordsAndCountDiagnosticTest,
|
||||
::testing::ValuesIn(std::vector<WordsAndCountDiagnosticCase>{
|
||||
{nullptr, 0, "Missing module."},
|
||||
@ -575,7 +575,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"Module has incomplete header: only 3 words instead of 5"},
|
||||
{kHeaderForBound1, 4,
|
||||
"Module has incomplete header: only 4 words instead of 5"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
// 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
|
||||
@ -598,7 +598,7 @@ TEST_P(BinaryParseWordVectorDiagnosticTest, WordVectorCases) {
|
||||
EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
BinaryParseDiagnostic, BinaryParseWordVectorDiagnosticTest,
|
||||
::testing::ValuesIn(std::vector<WordVectorDiagnosticCase>{
|
||||
{Concatenate({ExpectedHeaderForBound(1), {spvOpcodeMake(0, SpvOpNop)}}),
|
||||
@ -816,7 +816,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
MakeInstruction(SpvOpConstant, {1, 2, 42}),
|
||||
}),
|
||||
"Type Id 1 is not a scalar numeric type"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
// A binary parser diagnostic case generated from an assembly text input.
|
||||
struct AssemblyDiagnosticCase {
|
||||
@ -836,7 +836,7 @@ TEST_P(BinaryParseAssemblyDiagnosticTest, AssemblyCases) {
|
||||
EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
BinaryParseDiagnostic, BinaryParseAssemblyDiagnosticTest,
|
||||
::testing::ValuesIn(std::vector<AssemblyDiagnosticCase>{
|
||||
{"%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"},
|
||||
{"OpSelectionMerge %1 !7",
|
||||
"Invalid selection control operand: 7 has invalid mask component 4"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
} // namespace
|
||||
} // namespace spvtools
|
||||
|
@ -32,7 +32,7 @@ TEST_P(RoundTripLiteralsTest, Sample) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
StringLiterals, RoundTripLiteralsTest,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"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 backslash
|
||||
"OpName %1 \"\xE4\xBA\xB2\"\n", // UTF-8
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
using RoundTripSpecialCaseLiteralsTest = spvtest::TextToBinaryTestBase<
|
||||
@ -63,13 +63,13 @@ TEST_P(RoundTripSpecialCaseLiteralsTest, Sample) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
StringLiterals, RoundTripSpecialCaseLiteralsTest,
|
||||
::testing::ValuesIn(std::vector<std::pair<std::string, std::string>>{
|
||||
{"OpName %1 \"\\foo\"\n", "OpName %1 \"foo\"\n"}, // Escape f
|
||||
{"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
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
} // namespace
|
||||
|
@ -171,7 +171,7 @@ TEST_P(BinaryToTextFail, EncodeSuccessfullyDecodeFailed) {
|
||||
Eq(GetParam().expected_error_message));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
InvalidIds, BinaryToTextFail,
|
||||
::testing::ValuesIn(std::vector<FailedDecodeCase>{
|
||||
{"", spvtest::MakeInstruction(SpvOpTypeVoid, {0}),
|
||||
@ -196,9 +196,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"%2 = OpTypeVector %1 4",
|
||||
spvtest::MakeInstruction(SpvOpConstant, {2, 3, 999}),
|
||||
"Type Id 2 is not a scalar numeric type"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
InvalidIdsCheckedDuringLiteralCaseParsing, BinaryToTextFail,
|
||||
::testing::ValuesIn(std::vector<FailedDecodeCase>{
|
||||
{"", spvtest::MakeInstruction(SpvOpSwitch, {1, 2, 3, 4}),
|
||||
@ -212,7 +212,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"%1 = OpTypeFloat 32\n%2 = OpConstant %1 1.5",
|
||||
spvtest::MakeInstruction(SpvOpSwitch, {2, 3, 4, 5}),
|
||||
"Invalid OpSwitch: selector id 2 is not a scalar integer"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
TEST_F(TextToBinaryTest, OneInstruction) {
|
||||
const std::string input = "OpSource OpenCL_C 12\n";
|
||||
@ -243,7 +243,7 @@ TEST_P(RoundTripInstructionsTest, Sample) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
NumericLiterals, RoundTripInstructionsTest,
|
||||
// This test is independent of environment, so just test the one.
|
||||
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 0x1p+1024\n", // Inf
|
||||
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024\n", // -Inf
|
||||
})), );
|
||||
})));
|
||||
// clang-format on
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
MemoryAccessMasks, RoundTripInstructionsTest,
|
||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||
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|Nontemporal\n",
|
||||
"OpStore %1 %2 Volatile|Aligned|Nontemporal 32\n",
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
FPFastMathModeMasks, RoundTripInstructionsTest,
|
||||
Combine(
|
||||
::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 NSZ|AllowRecip\n",
|
||||
"OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|Fast\n",
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
LoopControlMasks, RoundTripInstructionsTest,
|
||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||
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 DontUnroll\n",
|
||||
"OpLoopMerge %1 %2 Unroll|DontUnroll\n",
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(LoopControlMasksV11, RoundTripInstructionsTest,
|
||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_1,
|
||||
SPV_ENV_UNIVERSAL_1_2,
|
||||
SPV_ENV_UNIVERSAL_1_3),
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"OpLoopMerge %1 %2 DependencyInfinite\n",
|
||||
"OpLoopMerge %1 %2 DependencyLength 8\n",
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(LoopControlMasksV11, RoundTripInstructionsTest,
|
||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_1,
|
||||
SPV_ENV_UNIVERSAL_1_2,
|
||||
SPV_ENV_UNIVERSAL_1_3),
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"OpLoopMerge %1 %2 DependencyInfinite\n",
|
||||
"OpLoopMerge %1 %2 DependencyLength 8\n",
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SelectionControlMasks, RoundTripInstructionsTest,
|
||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||
SPV_ENV_UNIVERSAL_1_3, SPV_ENV_UNIVERSAL_1_2),
|
||||
@ -341,9 +341,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"OpSelectionMerge %1 Flatten\n",
|
||||
"OpSelectionMerge %1 DontFlatten\n",
|
||||
"OpSelectionMerge %1 Flatten|DontFlatten\n",
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
FunctionControlMasks, RoundTripInstructionsTest,
|
||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||
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 Inline|Pure|Const %3\n",
|
||||
"%2 = OpFunction %1 DontInline|Const %3\n",
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ImageMasks, RoundTripInstructionsTest,
|
||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||
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"
|
||||
" 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,
|
||||
Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
@ -389,7 +389,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"OpExecutionModeId %1 LocalSizeHintId %2\n",
|
||||
"OpDecorateId %1 AlignmentId %2\n",
|
||||
"OpDecorateId %1 MaxByteOffsetId %2\n",
|
||||
})), );
|
||||
})));
|
||||
|
||||
using MaskSorting = TextToBinaryTest;
|
||||
|
||||
@ -537,23 +537,23 @@ TEST_P(GeneratorStringTest, Sample) {
|
||||
spvTextDestroy(decoded_text);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GeneratorStrings, GeneratorStringTest,
|
||||
::testing::ValuesIn(std::vector<GeneratorStringCase>{
|
||||
{SPV_GENERATOR_KHRONOS, 12, "Khronos; 12"},
|
||||
{SPV_GENERATOR_LUNARG, 99, "LunarG; 99"},
|
||||
{SPV_GENERATOR_VALVE, 1, "Valve; 1"},
|
||||
{SPV_GENERATOR_CODEPLAY, 65535, "Codeplay; 65535"},
|
||||
{SPV_GENERATOR_NVIDIA, 19, "NVIDIA; 19"},
|
||||
{SPV_GENERATOR_ARM, 1000, "ARM; 1000"},
|
||||
{SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR, 38,
|
||||
"Khronos LLVM/SPIR-V Translator; 38"},
|
||||
{SPV_GENERATOR_KHRONOS_ASSEMBLER, 2,
|
||||
"Khronos SPIR-V Tools Assembler; 2"},
|
||||
{SPV_GENERATOR_KHRONOS_GLSLANG, 1,
|
||||
"Khronos Glslang Reference Front End; 1"},
|
||||
{1000, 18, "Unknown(1000); 18"},
|
||||
{65535, 32767, "Unknown(65535); 32767"},
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(GeneratorStrings, GeneratorStringTest,
|
||||
::testing::ValuesIn(std::vector<GeneratorStringCase>{
|
||||
{SPV_GENERATOR_KHRONOS, 12, "Khronos; 12"},
|
||||
{SPV_GENERATOR_LUNARG, 99, "LunarG; 99"},
|
||||
{SPV_GENERATOR_VALVE, 1, "Valve; 1"},
|
||||
{SPV_GENERATOR_CODEPLAY, 65535, "Codeplay; 65535"},
|
||||
{SPV_GENERATOR_NVIDIA, 19, "NVIDIA; 19"},
|
||||
{SPV_GENERATOR_ARM, 1000, "ARM; 1000"},
|
||||
{SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR, 38,
|
||||
"Khronos LLVM/SPIR-V Translator; 38"},
|
||||
{SPV_GENERATOR_KHRONOS_ASSEMBLER, 2,
|
||||
"Khronos SPIR-V Tools Assembler; 2"},
|
||||
{SPV_GENERATOR_KHRONOS_GLSLANG, 1,
|
||||
"Khronos Glslang Reference Front End; 1"},
|
||||
{1000, 18, "Unknown(1000); 18"},
|
||||
{65535, 32767, "Unknown(65535); 32767"},
|
||||
}));
|
||||
|
||||
// TODO(dneto): Test new instructions and enums in SPIR-V 1.3
|
||||
|
||||
|
@ -817,12 +817,12 @@ OpFunctionEnd
|
||||
)");
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllMarkvModels, MarkvTest,
|
||||
::testing::ValuesIn(std::vector<MarkvModelType>{
|
||||
kMarkvModelShaderLite,
|
||||
kMarkvModelShaderMid,
|
||||
kMarkvModelShaderMax,
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllMarkvModels, MarkvTest,
|
||||
::testing::ValuesIn(std::vector<MarkvModelType>{
|
||||
kMarkvModelShaderLite,
|
||||
kMarkvModelShaderMid,
|
||||
kMarkvModelShaderMax,
|
||||
}));
|
||||
|
||||
} // namespace
|
||||
} // namespace comp
|
||||
|
@ -267,24 +267,24 @@ TEST_P(CapabilitySetForEachTest, OperatorEqualsSelfAssign) {
|
||||
EXPECT_THAT(ElementsIn(assigned), Eq(GetParam().expected));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Samples, CapabilitySetForEachTest,
|
||||
ValuesIn(std::vector<ForEachCase>{
|
||||
{{}, {}},
|
||||
{{SpvCapabilityMatrix}, {SpvCapabilityMatrix}},
|
||||
{{SpvCapabilityKernel, SpvCapabilityShader},
|
||||
{SpvCapabilityShader, SpvCapabilityKernel}},
|
||||
{{static_cast<SpvCapability>(999)},
|
||||
{static_cast<SpvCapability>(999)}},
|
||||
{{static_cast<SpvCapability>(0x7fffffff)},
|
||||
{static_cast<SpvCapability>(0x7fffffff)}},
|
||||
// Mixture and out of order
|
||||
{{static_cast<SpvCapability>(0x7fffffff),
|
||||
static_cast<SpvCapability>(100),
|
||||
SpvCapabilityShader, SpvCapabilityMatrix},
|
||||
{SpvCapabilityMatrix, SpvCapabilityShader,
|
||||
static_cast<SpvCapability>(100),
|
||||
static_cast<SpvCapability>(0x7fffffff)}},
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(Samples, CapabilitySetForEachTest,
|
||||
ValuesIn(std::vector<ForEachCase>{
|
||||
{{}, {}},
|
||||
{{SpvCapabilityMatrix}, {SpvCapabilityMatrix}},
|
||||
{{SpvCapabilityKernel, SpvCapabilityShader},
|
||||
{SpvCapabilityShader, SpvCapabilityKernel}},
|
||||
{{static_cast<SpvCapability>(999)},
|
||||
{static_cast<SpvCapability>(999)}},
|
||||
{{static_cast<SpvCapability>(0x7fffffff)},
|
||||
{static_cast<SpvCapability>(0x7fffffff)}},
|
||||
// Mixture and out of order
|
||||
{{static_cast<SpvCapability>(0x7fffffff),
|
||||
static_cast<SpvCapability>(100),
|
||||
SpvCapabilityShader, SpvCapabilityMatrix},
|
||||
{SpvCapabilityMatrix, SpvCapabilityShader,
|
||||
static_cast<SpvCapability>(100),
|
||||
static_cast<SpvCapability>(0x7fffffff)}},
|
||||
}));
|
||||
|
||||
} // namespace
|
||||
} // namespace spvtools
|
||||
|
@ -64,7 +64,7 @@ TEST_P(CapabilityTest, TestCapabilityToString) {
|
||||
EXPECT_EQ(capability_str, result_str);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
AllExtensions, ExtensionTest,
|
||||
ValuesIn(std::vector<std::pair<Extension, std::string>>({
|
||||
{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"},
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(UnknownExtensions, UnknownExtensionTest,
|
||||
Values("", "SPV_KHR_", "SPV_KHR_device_group_ERROR",
|
||||
/*alphabetically before all extensions*/ "A",
|
||||
/*alphabetically after all extensions*/ "Z",
|
||||
"SPV_ERROR_random_string_hfsdklhlktherh"));
|
||||
INSTANTIATE_TEST_SUITE_P(UnknownExtensions, UnknownExtensionTest,
|
||||
Values("", "SPV_KHR_", "SPV_KHR_device_group_ERROR",
|
||||
/*alphabetically before all extensions*/ "A",
|
||||
/*alphabetically after all extensions*/ "Z",
|
||||
"SPV_ERROR_random_string_hfsdklhlktherh"));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
AllCapabilities, CapabilityTest,
|
||||
ValuesIn(std::vector<std::pair<SpvCapability, std::string>>(
|
||||
{{SpvCapabilityMatrix, "Matrix"},
|
||||
@ -189,7 +189,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"ShaderViewportIndexLayerEXT"},
|
||||
{SpvCapabilityShaderViewportMaskNV, "ShaderViewportMaskNV"},
|
||||
{SpvCapabilityShaderStereoViewNV, "ShaderStereoViewNV"},
|
||||
{SpvCapabilityPerViewAttributesNV, "PerViewAttributesNV"}})), );
|
||||
{SpvCapabilityPerViewAttributesNV, "PerViewAttributesNV"}})));
|
||||
|
||||
} // namespace
|
||||
} // namespace spvtools
|
||||
|
@ -368,30 +368,30 @@ TEST_P(ExtInstDebugInfoRoundTripTest, ParameterizedExtInst) {
|
||||
}
|
||||
|
||||
// DebugInfo 4.1 Absent Debugging Information
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugInfoNone, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_0(InfoNone), // enum value 0
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugInfoNone, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_0(InfoNone), // enum value 0
|
||||
})));
|
||||
|
||||
// DebugInfo 4.2 Compilation Unit
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugCompilationUnit,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_ILL(CompilationUnit, 100, 42),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugCompilationUnit,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_ILL(CompilationUnit, 100, 42),
|
||||
})));
|
||||
|
||||
// DebugInfo 4.3 Type instructions
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeBasic, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIE(TypeBasic, Unspecified),
|
||||
CASE_IIE(TypeBasic, Address),
|
||||
CASE_IIE(TypeBasic, Boolean),
|
||||
CASE_IIE(TypeBasic, Float),
|
||||
CASE_IIE(TypeBasic, Signed),
|
||||
CASE_IIE(TypeBasic, SignedChar),
|
||||
CASE_IIE(TypeBasic, Unsigned),
|
||||
CASE_IIE(TypeBasic, UnsignedChar),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeBasic, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIE(TypeBasic, Unspecified),
|
||||
CASE_IIE(TypeBasic, Address),
|
||||
CASE_IIE(TypeBasic, Boolean),
|
||||
CASE_IIE(TypeBasic, Float),
|
||||
CASE_IIE(TypeBasic, Signed),
|
||||
CASE_IIE(TypeBasic, SignedChar),
|
||||
CASE_IIE(TypeBasic, Unsigned),
|
||||
CASE_IIE(TypeBasic, UnsignedChar),
|
||||
})));
|
||||
|
||||
// The FlagIsPublic is value is (1 << 0) | (1 << 2) which is the same
|
||||
// as the bitwise-OR of FlagIsProtected and FlagIsPrivate.
|
||||
@ -417,7 +417,7 @@ TEST_F(ExtInstDebugInfoRoundTripTestExplicit, FlagIsPublic) {
|
||||
EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(expected)) << input;
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DebugInfoDebugTypePointer, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
|
||||
@ -463,49 +463,50 @@ INSTANTIATE_TEST_CASE_P(
|
||||
uint32_t(DebugInfoFlagIndirectVariable) |
|
||||
uint32_t(DebugInfoFlagIsOptimized)),
|
||||
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeQualifier,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IE(TypeQualifier, ConstType),
|
||||
CASE_IE(TypeQualifier, VolatileType),
|
||||
CASE_IE(TypeQualifier, RestrictType),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeQualifier,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IE(TypeQualifier, ConstType),
|
||||
CASE_IE(TypeQualifier, VolatileType),
|
||||
CASE_IE(TypeQualifier, RestrictType),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeArray, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_II(TypeArray),
|
||||
CASE_III(TypeArray),
|
||||
CASE_IIII(TypeArray),
|
||||
CASE_IIIII(TypeArray),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeArray, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_II(TypeArray),
|
||||
CASE_III(TypeArray),
|
||||
CASE_IIII(TypeArray),
|
||||
CASE_IIIII(TypeArray),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeVector, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IL(TypeVector, 2),
|
||||
CASE_IL(TypeVector, 3),
|
||||
CASE_IL(TypeVector, 4),
|
||||
CASE_IL(TypeVector, 16),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeVector,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IL(TypeVector, 2),
|
||||
CASE_IL(TypeVector, 3),
|
||||
CASE_IL(TypeVector, 4),
|
||||
CASE_IL(TypeVector, 16),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypedef, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILLI(Typedef, 12, 13),
|
||||
CASE_IIILLI(Typedef, 14, 99),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypedef, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILLI(Typedef, 12, 13),
|
||||
CASE_IIILLI(Typedef, 14, 99),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeFunction,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_I(TypeFunction),
|
||||
CASE_II(TypeFunction),
|
||||
CASE_III(TypeFunction),
|
||||
CASE_IIII(TypeFunction),
|
||||
CASE_IIIII(TypeFunction),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeFunction,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_I(TypeFunction),
|
||||
CASE_II(TypeFunction),
|
||||
CASE_III(TypeFunction),
|
||||
CASE_IIII(TypeFunction),
|
||||
CASE_IIIII(TypeFunction),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DebugInfoDebugTypeEnum, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILLIIFII(
|
||||
@ -518,9 +519,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
uint32_t(DebugInfoFlagStaticMember)),
|
||||
CASE_IIILLIIFIIIIII(TypeEnum, 99, 1, "FlagStaticMember",
|
||||
uint32_t(DebugInfoFlagStaticMember)),
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DebugInfoDebugTypeComposite, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IEILLIIF(
|
||||
@ -545,22 +546,22 @@ INSTANTIATE_TEST_CASE_P(
|
||||
uint32_t(DebugInfoFlagIsPrivate)),
|
||||
CASE_IEILLIIFIIII(TypeComposite, Class, 9, 10, "FlagIsPrivate",
|
||||
uint32_t(DebugInfoFlagIsPrivate)),
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeMember, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILLIIIF(TypeMember, 12, 13, "FlagIsPrivate",
|
||||
uint32_t(DebugInfoFlagIsPrivate)),
|
||||
CASE_IIILLIIIF(TypeMember, 99, 100,
|
||||
"FlagIsPrivate|FlagFwdDecl",
|
||||
uint32_t(DebugInfoFlagIsPrivate) |
|
||||
uint32_t(DebugInfoFlagFwdDecl)),
|
||||
// Add the optional Id argument.
|
||||
CASE_IIILLIIIFI(TypeMember, 12, 13, "FlagIsPrivate",
|
||||
uint32_t(DebugInfoFlagIsPrivate)),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DebugInfoDebugTypeMember, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILLIIIF(TypeMember, 12, 13, "FlagIsPrivate",
|
||||
uint32_t(DebugInfoFlagIsPrivate)),
|
||||
CASE_IIILLIIIF(TypeMember, 99, 100, "FlagIsPrivate|FlagFwdDecl",
|
||||
uint32_t(DebugInfoFlagIsPrivate) |
|
||||
uint32_t(DebugInfoFlagFwdDecl)),
|
||||
// Add the optional Id argument.
|
||||
CASE_IIILLIIIFI(TypeMember, 12, 13, "FlagIsPrivate",
|
||||
uint32_t(DebugInfoFlagIsPrivate)),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DebugInfoDebugTypeInheritance, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIIIF(TypeInheritance, "FlagIsPrivate",
|
||||
@ -568,53 +569,53 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE_IIIIF(TypeInheritance, "FlagIsPrivate|FlagFwdDecl",
|
||||
uint32_t(DebugInfoFlagIsPrivate) |
|
||||
uint32_t(DebugInfoFlagFwdDecl)),
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypePtrToMember,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_II(TypePtrToMember),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypePtrToMember,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_II(TypePtrToMember),
|
||||
})));
|
||||
|
||||
// DebugInfo 4.4 Templates
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplate,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_II(TypeTemplate),
|
||||
CASE_III(TypeTemplate),
|
||||
CASE_IIII(TypeTemplate),
|
||||
CASE_IIIII(TypeTemplate),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplate,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_II(TypeTemplate),
|
||||
CASE_III(TypeTemplate),
|
||||
CASE_IIII(TypeTemplate),
|
||||
CASE_IIIII(TypeTemplate),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateParameter,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIIILL(TypeTemplateParameter, 1, 2),
|
||||
CASE_IIIILL(TypeTemplateParameter, 99, 102),
|
||||
CASE_IIIILL(TypeTemplateParameter, 10, 7),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplateParameter,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIIILL(TypeTemplateParameter, 1, 2),
|
||||
CASE_IIIILL(TypeTemplateParameter, 99, 102),
|
||||
CASE_IIIILL(TypeTemplateParameter, 10, 7),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateTemplateParameter,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILL(TypeTemplateTemplateParameter, 1, 2),
|
||||
CASE_IIILL(TypeTemplateTemplateParameter, 99, 102),
|
||||
CASE_IIILL(TypeTemplateTemplateParameter, 10, 7),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplateTemplateParameter,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILL(TypeTemplateTemplateParameter, 1, 2),
|
||||
CASE_IIILL(TypeTemplateTemplateParameter, 99, 102),
|
||||
CASE_IIILL(TypeTemplateTemplateParameter, 10, 7),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateParameterPack,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IILLI(TypeTemplateParameterPack, 1, 2),
|
||||
CASE_IILLII(TypeTemplateParameterPack, 99, 102),
|
||||
CASE_IILLIII(TypeTemplateParameterPack, 10, 7),
|
||||
CASE_IILLIIII(TypeTemplateParameterPack, 10, 7),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplateParameterPack,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IILLI(TypeTemplateParameterPack, 1, 2),
|
||||
CASE_IILLII(TypeTemplateParameterPack, 99, 102),
|
||||
CASE_IILLIII(TypeTemplateParameterPack, 10, 7),
|
||||
CASE_IILLIIII(TypeTemplateParameterPack, 10, 7),
|
||||
})));
|
||||
|
||||
// DebugInfo 4.5 Global Variables
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DebugInfoDebugGlobalVariable, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILLIIIF(GlobalVariable, 1, 2, "FlagIsOptimized",
|
||||
@ -625,20 +626,20 @@ INSTANTIATE_TEST_CASE_P(
|
||||
uint32_t(DebugInfoFlagIsOptimized)),
|
||||
CASE_IIILLIIIFI(GlobalVariable, 42, 43, "FlagIsOptimized",
|
||||
uint32_t(DebugInfoFlagIsOptimized)),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// DebugInfo 4.6 Functions
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DebugInfoDebugFunctionDeclaration, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILLIIF(FunctionDeclaration, 1, 2, "FlagIsOptimized",
|
||||
uint32_t(DebugInfoFlagIsOptimized)),
|
||||
CASE_IIILLIIF(FunctionDeclaration, 42, 43, "FlagFwdDecl",
|
||||
uint32_t(DebugInfoFlagFwdDecl)),
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DebugInfoDebugFunction, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILLIIFLI(Function, 1, 2, "FlagIsOptimized",
|
||||
@ -650,65 +651,65 @@ INSTANTIATE_TEST_CASE_P(
|
||||
uint32_t(DebugInfoFlagIsOptimized), 3),
|
||||
CASE_IIILLIIFLII(Function, 42, 43, "FlagFwdDecl",
|
||||
uint32_t(DebugInfoFlagFwdDecl), 44),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// DebugInfo 4.7 Local Information
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugLexicalBlock,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_ILLII(LexicalBlock, 1, 2),
|
||||
CASE_ILLII(LexicalBlock, 42, 43),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugLexicalBlock,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_ILLII(LexicalBlock, 1, 2),
|
||||
CASE_ILLII(LexicalBlock, 42, 43),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugLexicalBlockDiscriminator,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_ILI(LexicalBlockDiscriminator, 1),
|
||||
CASE_ILI(LexicalBlockDiscriminator, 42),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugLexicalBlockDiscriminator,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_ILI(LexicalBlockDiscriminator, 1),
|
||||
CASE_ILI(LexicalBlockDiscriminator, 42),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugScope, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_I(Scope),
|
||||
CASE_II(Scope),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugScope, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_I(Scope),
|
||||
CASE_II(Scope),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugNoScope, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_0(NoScope),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugNoScope, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_0(NoScope),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugInlinedAt, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_LII(InlinedAt, 1),
|
||||
CASE_LII(InlinedAt, 42),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugInlinedAt, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_LII(InlinedAt, 1),
|
||||
CASE_LII(InlinedAt, 42),
|
||||
})));
|
||||
|
||||
// DebugInfo 4.8 Local Variables
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugLocalVariable,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILLI(LocalVariable, 1, 2),
|
||||
CASE_IIILLI(LocalVariable, 42, 43),
|
||||
CASE_IIILLIL(LocalVariable, 1, 2, 3),
|
||||
CASE_IIILLIL(LocalVariable, 42, 43, 44),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugLocalVariable,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_IIILLI(LocalVariable, 1, 2),
|
||||
CASE_IIILLI(LocalVariable, 42, 43),
|
||||
CASE_IIILLIL(LocalVariable, 1, 2, 3),
|
||||
CASE_IIILLIL(LocalVariable, 42, 43, 44),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugInlinedVariable,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_II(InlinedVariable),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugInlinedVariable,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_II(InlinedVariable),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugDeclare,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_III(Declare),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugDebugDeclare,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_III(Declare),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DebugInfoDebugDebugValue, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_III(Value),
|
||||
@ -717,53 +718,54 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE_IIIIII(Value),
|
||||
// Test up to 4 id parameters. We can always try more.
|
||||
CASE_IIIIIII(Value),
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugOperation,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_E(Operation, Deref),
|
||||
CASE_E(Operation, Plus),
|
||||
CASE_E(Operation, Minus),
|
||||
CASE_EL(Operation, PlusUconst, 1),
|
||||
CASE_EL(Operation, PlusUconst, 42),
|
||||
CASE_ELL(Operation, BitPiece, 1, 2),
|
||||
CASE_ELL(Operation, BitPiece, 4, 5),
|
||||
CASE_E(Operation, Swap),
|
||||
CASE_E(Operation, Xderef),
|
||||
CASE_E(Operation, StackValue),
|
||||
CASE_EL(Operation, Constu, 1),
|
||||
CASE_EL(Operation, Constu, 42),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugDebugOperation,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_E(Operation, Deref),
|
||||
CASE_E(Operation, Plus),
|
||||
CASE_E(Operation, Minus),
|
||||
CASE_EL(Operation, PlusUconst, 1),
|
||||
CASE_EL(Operation, PlusUconst, 42),
|
||||
CASE_ELL(Operation, BitPiece, 1, 2),
|
||||
CASE_ELL(Operation, BitPiece, 4, 5),
|
||||
CASE_E(Operation, Swap),
|
||||
CASE_E(Operation, Xderef),
|
||||
CASE_E(Operation, StackValue),
|
||||
CASE_EL(Operation, Constu, 1),
|
||||
CASE_EL(Operation, Constu, 42),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugExpression,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_0(Expression),
|
||||
CASE_I(Expression),
|
||||
CASE_II(Expression),
|
||||
CASE_III(Expression),
|
||||
CASE_IIII(Expression),
|
||||
CASE_IIIII(Expression),
|
||||
CASE_IIIIII(Expression),
|
||||
CASE_IIIIIII(Expression),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugDebugExpression,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_0(Expression),
|
||||
CASE_I(Expression),
|
||||
CASE_II(Expression),
|
||||
CASE_III(Expression),
|
||||
CASE_IIII(Expression),
|
||||
CASE_IIIII(Expression),
|
||||
CASE_IIIIII(Expression),
|
||||
CASE_IIIIIII(Expression),
|
||||
})));
|
||||
|
||||
// DebugInfo 4.9 Macros
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugMacroDef, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_ILI(MacroDef, 1),
|
||||
CASE_ILI(MacroDef, 42),
|
||||
CASE_ILII(MacroDef, 1),
|
||||
CASE_ILII(MacroDef, 42),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugMacroDef, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_ILI(MacroDef, 1),
|
||||
CASE_ILI(MacroDef, 42),
|
||||
CASE_ILII(MacroDef, 1),
|
||||
CASE_ILII(MacroDef, 42),
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugInfoDebugMacroUndef, ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_ILI(MacroUndef, 1),
|
||||
CASE_ILI(MacroUndef, 42),
|
||||
})), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugInfoDebugMacroUndef,
|
||||
ExtInstDebugInfoRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE_ILI(MacroUndef, 1),
|
||||
CASE_ILI(MacroUndef, 42),
|
||||
})));
|
||||
|
||||
#undef CASE_0
|
||||
#undef CASE_ILL
|
||||
|
@ -106,7 +106,7 @@ OpFunctionEnd
|
||||
spvContextDestroy(context);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ExtInstParameters, ExtInstGLSLstd450RoundTripTest,
|
||||
::testing::ValuesIn(std::vector<ExtInstContext>({
|
||||
// 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}},
|
||||
{"NMax", "%5 %5", 80, 7, {5, 5}},
|
||||
{"NClamp", "%5 %5 %5", 81, 8, {5, 5, 5}},
|
||||
})), );
|
||||
})));
|
||||
|
||||
} // namespace
|
||||
} // namespace spvtools
|
||||
|
@ -90,7 +90,7 @@ TEST_P(ExtInstOpenCLStdRoundTripTest, ParameterizedExtInst) {
|
||||
|
||||
// clang-format off
|
||||
// OpenCL.std: 2.1 Math extended instructions
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpenCLMath, ExtInstOpenCLStdRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
// 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_sqrt, native_sqrt),
|
||||
CASE1(Native_tan, native_tan), // enum value 94
|
||||
})),);
|
||||
})));
|
||||
|
||||
// OpenCL.std: 2.1 Integer instructions
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpenCLInteger, ExtInstOpenCLStdRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE1(SAbs, s_abs), // enum value 141
|
||||
@ -230,10 +230,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE2(UAbs_diff, u_abs_diff),
|
||||
CASE2(UMul_hi, u_mul_hi),
|
||||
CASE3(UMad_hi, u_mad_hi), // enum value 204
|
||||
})),);
|
||||
})));
|
||||
|
||||
// OpenCL.std: 2.3 Common instrucitons
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpenCLCommon, ExtInstOpenCLStdRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE3(FClamp, fclamp), // enum value 95
|
||||
@ -245,10 +245,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE2(Step, step),
|
||||
CASE3(Smoothstep, smoothstep),
|
||||
CASE1(Sign, sign), // enum value 103
|
||||
})),);
|
||||
})));
|
||||
|
||||
// OpenCL.std: 2.4 Geometric instructions
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpenCLGeometric, ExtInstOpenCLStdRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE2(Cross, cross), // enum value 104
|
||||
@ -258,18 +258,18 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE2(Fast_distance, fast_distance),
|
||||
CASE1(Fast_length, fast_length),
|
||||
CASE1(Fast_normalize, fast_normalize), // enum value 110
|
||||
})),);
|
||||
})));
|
||||
|
||||
// OpenCL.std: 2.5 Relational instructions
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpenCLRelational, ExtInstOpenCLStdRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE3(Bitselect, bitselect), // enum value 186
|
||||
CASE3(Select, select), // enum value 187
|
||||
})),);
|
||||
})));
|
||||
|
||||
// OpenCL.std: 2.6 Vector data load and store instructions
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpenCLVectorLoadStore, ExtInstOpenCLStdRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
// 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, RTP),
|
||||
CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTN),
|
||||
})),);
|
||||
})));
|
||||
|
||||
// OpenCL.std: 2.7 Miscellaneous vector instructions
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpenCLMiscellaneousVector, ExtInstOpenCLStdRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE2(Shuffle, shuffle),
|
||||
CASE3(Shuffle2, shuffle2),
|
||||
})),);
|
||||
})));
|
||||
|
||||
// OpenCL.std: 2.8 Miscellaneous instructions
|
||||
|
||||
#define PREFIX uint32_t(OpenCLLIB::Entrypoints::Printf), "printf"
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpenCLMiscPrintf, ExtInstOpenCLStdRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
// 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}},
|
||||
{PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14",
|
||||
{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}},
|
||||
})),);
|
||||
})));
|
||||
#undef PREFIX
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpenCLMiscPrefetch, ExtInstOpenCLStdRoundTripTest,
|
||||
::testing::ValuesIn(std::vector<InstructionCase>({
|
||||
CASE2(Prefetch, prefetch),
|
||||
})),);
|
||||
})));
|
||||
|
||||
// OpenCL.std: 2.9.1 Image encoding
|
||||
// No new instructions defined in this section.
|
||||
|
@ -34,7 +34,7 @@ TEST_P(GeneratorMagicNumberTest, Single) {
|
||||
GetParam().name());
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Registered, GeneratorMagicNumberTest,
|
||||
::testing::ValuesIn(std::vector<EnumCase<spv_generator_t>>{
|
||||
{SPV_GENERATOR_KHRONOS, "Khronos"},
|
||||
@ -47,16 +47,16 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"Khronos LLVM/SPIR-V Translator"},
|
||||
{SPV_GENERATOR_KHRONOS_ASSEMBLER, "Khronos SPIR-V Tools Assembler"},
|
||||
{SPV_GENERATOR_KHRONOS_GLSLANG, "Khronos Glslang Reference Front End"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Unregistered, GeneratorMagicNumberTest,
|
||||
::testing::ValuesIn(std::vector<EnumCase<spv_generator_t>>{
|
||||
// We read registered entries from the SPIR-V XML Registry file
|
||||
// which can change over time.
|
||||
{spv_generator_t(1000), "Unknown"},
|
||||
{spv_generator_t(9999), "Unknown"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
} // namespace
|
||||
} // namespace spvtools
|
||||
|
@ -81,7 +81,7 @@ TEST_P(HexDoubleTest, DecodeCorrectly) {
|
||||
EXPECT_THAT(Decode<double>(GetParam().second), Eq(GetParam().first));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float32Tests, HexFloatTest,
|
||||
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
|
||||
{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)),
|
||||
"0x1.8p-128"},
|
||||
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float32NanTests, HexFloatTest,
|
||||
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
|
||||
// Various NAN and INF cases
|
||||
@ -149,9 +149,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{uint32_t(0x7f800c00), "0x1.0018p+128"}, // +nan
|
||||
{uint32_t(0x7F80F000), "0x1.01ep+128"}, // +nan
|
||||
{uint32_t(0x7FFFFFFF), "0x1.fffffep+128"}, // +nan
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float64Tests, HexDoubleTest,
|
||||
::testing::ValuesIn(
|
||||
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),
|
||||
"0x1.8p-1024"},
|
||||
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float64NanTests, HexDoubleTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
std::pair<FloatProxy<double>, std::string>>({
|
||||
@ -241,7 +241,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{uint64_t(0x7FF0000000000001LL), "0x1.0000000000001p+1024"}, // -nan
|
||||
{uint64_t(0x7FF0000300000000LL), "0x1.00003p+1024"}, // -nan
|
||||
{uint64_t(0x7FFFFFFFFFFFFFFFLL), "0x1.fffffffffffffp+1024"}, // -nan
|
||||
})), );
|
||||
})));
|
||||
|
||||
// Tests that encoding a value and decoding it again restores
|
||||
// the same value.
|
||||
@ -263,14 +263,14 @@ TEST_P(RoundTripDoubleTest, CanStoreAccurately) {
|
||||
EXPECT_THAT(GetParam(), Eq(res.getAsFloat()));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float32StoreTests, RoundTripFloatTest,
|
||||
::testing::ValuesIn(std::vector<float>(
|
||||
{// Value requiring more than 6 digits of precision to be
|
||||
// represented accurately.
|
||||
3.0000002f})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float64StoreTests, RoundTripDoubleTest,
|
||||
::testing::ValuesIn(std::vector<double>(
|
||||
{// 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));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float32DecodeTests, DecodeHexFloatTest,
|
||||
::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
|
||||
{"0x0p+000", 0.f},
|
||||
@ -320,9 +320,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"0xFFp+0", 255.f},
|
||||
{"0x0.8p+0", 0.5f},
|
||||
{"0x0.4p+0", 0.25f},
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float32DecodeInfTests, DecodeHexFloatTest,
|
||||
::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
|
||||
// inf cases
|
||||
@ -330,9 +330,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"0x32p+127", uint32_t(0x7F800000)}, // inf
|
||||
{"0x32p+500", uint32_t(0x7F800000)}, // inf
|
||||
{"-0x32p+127", uint32_t(0xFF800000)}, // -inf
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float64DecodeTests, DecodeHexDoubleTest,
|
||||
::testing::ValuesIn(
|
||||
std::vector<std::pair<std::string, FloatProxy<double>>>({
|
||||
@ -353,9 +353,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"0xFFp+0", 255.},
|
||||
{"0x0.8p+0", 0.5},
|
||||
{"0x0.4p+0", 0.25},
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float64DecodeInfTests, DecodeHexDoubleTest,
|
||||
::testing::ValuesIn(
|
||||
std::vector<std::pair<std::string, FloatProxy<double>>>({
|
||||
@ -364,7 +364,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"0x32p+1023", uint64_t(0x7FF0000000000000)}, // inf
|
||||
{"0x32p+5000", uint64_t(0x7FF0000000000000)}, // inf
|
||||
{"-0x32p+1023", uint64_t(0xFFF0000000000000)}, // -inf
|
||||
})), );
|
||||
})));
|
||||
|
||||
TEST(FloatProxy, ValidConversion) {
|
||||
EXPECT_THAT(FloatProxy<float>(1.f).getAsFloat(), Eq(1.0f));
|
||||
@ -503,7 +503,7 @@ TEST_P(FloatProxyDoubleTest, EncodeCorrectly) {
|
||||
Eq(GetParam().second));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float32Tests, FloatProxyFloatTest,
|
||||
::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
|
||||
// Zero
|
||||
@ -533,9 +533,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
|
||||
{std::numeric_limits<float>::infinity(), "0x1p+128"},
|
||||
{-std::numeric_limits<float>::infinity(), "-0x1p+128"},
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float64Tests, FloatProxyDoubleTest,
|
||||
::testing::ValuesIn(
|
||||
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"},
|
||||
|
||||
})), );
|
||||
})));
|
||||
|
||||
// double is used so that unbiased_exponent can be used with the output
|
||||
// of ldexp directly.
|
||||
@ -792,7 +792,7 @@ TEST_P(HexFloatRoundTest, RoundDownToFP16) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatRoundTest,
|
||||
INSTANTIATE_TEST_SUITE_P(F32ToF16, HexFloatRoundTest,
|
||||
::testing::ValuesIn(std::vector<RoundSignificandCase>(
|
||||
{
|
||||
{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}), -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},
|
||||
})),);
|
||||
})));
|
||||
// clang-format on
|
||||
|
||||
struct UpCastSignificandCase {
|
||||
@ -872,7 +872,7 @@ TEST_P(HexFloatRoundUpSignificandTest, Widening) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
F16toF32, HexFloatRoundUpSignificandTest,
|
||||
// 0xFC00 of the source 16-bit hex value cover the sign and the exponent.
|
||||
// They are ignored for this test.
|
||||
@ -881,7 +881,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{0x0F00, 0x600000},
|
||||
{0x0F01, 0x602000},
|
||||
{0x0FFF, 0x7FE000},
|
||||
})), );
|
||||
})));
|
||||
|
||||
struct DownCastTest {
|
||||
float source_float;
|
||||
@ -923,7 +923,7 @@ TEST_P(HexFloatFP32To16Tests, NarrowingCasts) {
|
||||
const uint16_t positive_infinity = 0x7C00;
|
||||
const uint16_t negative_infinity = 0xFC00;
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
F32ToF16, HexFloatFP32To16Tests,
|
||||
::testing::ValuesIn(std::vector<DownCastTest>({
|
||||
// Exactly representable as half.
|
||||
@ -1014,7 +1014,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
RD::kToNearestEven}},
|
||||
|
||||
// Nans are below because we cannot test for equality.
|
||||
})), );
|
||||
})));
|
||||
|
||||
struct UpCastCase {
|
||||
uint16_t source_half;
|
||||
@ -1043,7 +1043,7 @@ TEST_P(HexFloatFP16To32Tests, WideningCasts) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
F16ToF32, HexFloatFP16To32Tests,
|
||||
::testing::ValuesIn(std::vector<UpCastCase>({
|
||||
{0x0000, 0.f},
|
||||
@ -1064,7 +1064,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// inf
|
||||
{0x7C00, std::numeric_limits<float>::infinity()},
|
||||
{0xFC00, -std::numeric_limits<float>::infinity()},
|
||||
})), );
|
||||
})));
|
||||
|
||||
TEST(HexFloatOperationTests, NanTests) {
|
||||
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};
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
FloatParse, ParseNormalFloatTest,
|
||||
::testing::ValuesIn(std::vector<FloatParseCase<float>>{
|
||||
// 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
|
||||
// that represents an original case of "--1e40" which
|
||||
// is invalid.
|
||||
}), );
|
||||
}));
|
||||
|
||||
using ParseNormalFloat16Test =
|
||||
::testing::TestWithParam<FloatParseCase<Float16>>;
|
||||
@ -1188,7 +1188,7 @@ TEST_P(ParseNormalFloat16Test, Samples) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float16Parse, ParseNormalFloat16Test,
|
||||
::testing::ValuesIn(std::vector<FloatParseCase<Float16>>{
|
||||
// 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>("+0.0", true, uint16_t{0}),
|
||||
BadFloatParseCase<Float16>("+2.0", true, uint16_t{0}),
|
||||
}), );
|
||||
}));
|
||||
|
||||
// A test case for detecting infinities.
|
||||
template <typename T>
|
||||
@ -1235,7 +1235,7 @@ TEST_P(FloatProxyParseOverflowFloatTest, Sample) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
FloatOverflow, FloatProxyParseOverflowFloatTest,
|
||||
::testing::ValuesIn(std::vector<OverflowParseCase<float>>({
|
||||
{"0", true, 0.0f},
|
||||
@ -1247,7 +1247,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"-1e40", false, -FLT_MAX},
|
||||
{"1e400", false, FLT_MAX},
|
||||
{"-1e400", false, -FLT_MAX},
|
||||
})), );
|
||||
})));
|
||||
|
||||
using FloatProxyParseOverflowDoubleTest =
|
||||
::testing::TestWithParam<OverflowParseCase<double>>;
|
||||
@ -1262,7 +1262,7 @@ TEST_P(FloatProxyParseOverflowDoubleTest, Sample) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DoubleOverflow, FloatProxyParseOverflowDoubleTest,
|
||||
::testing::ValuesIn(std::vector<OverflowParseCase<double>>({
|
||||
{"0", true, 0.0},
|
||||
@ -1274,7 +1274,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"-1e40", true, -1e40},
|
||||
{"1e400", false, DBL_MAX},
|
||||
{"-1e400", false, -DBL_MAX},
|
||||
})), );
|
||||
})));
|
||||
|
||||
using FloatProxyParseOverflowFloat16Test =
|
||||
::testing::TestWithParam<OverflowParseCase<uint16_t>>;
|
||||
@ -1291,7 +1291,7 @@ TEST_P(FloatProxyParseOverflowFloat16Test, Sample) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Float16Overflow, FloatProxyParseOverflowFloat16Test,
|
||||
::testing::ValuesIn(std::vector<OverflowParseCase<uint16_t>>({
|
||||
{"0", true, uint16_t{0}},
|
||||
@ -1305,7 +1305,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"-1e38", false, uint16_t{0xfbff}},
|
||||
{"-1e40", false, uint16_t{0xfbff}},
|
||||
{"-1e400", false, uint16_t{0xfbff}},
|
||||
})), );
|
||||
})));
|
||||
|
||||
TEST(FloatProxy, Max) {
|
||||
EXPECT_THAT(FloatProxy<Float16>::max().getAsFloat().get_value(),
|
||||
|
@ -54,31 +54,31 @@ TEST_P(FriendlyNameTest, SingleMapping) {
|
||||
<< " for id " << GetParam().id;
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ScalarType, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%1 = OpTypeVoid", 1, "void"},
|
||||
{"%1 = OpTypeBool", 1, "bool"},
|
||||
{"%1 = OpTypeInt 8 0", 1, "uchar"},
|
||||
{"%1 = OpTypeInt 8 1", 1, "char"},
|
||||
{"%1 = OpTypeInt 16 0", 1, "ushort"},
|
||||
{"%1 = OpTypeInt 16 1", 1, "short"},
|
||||
{"%1 = OpTypeInt 32 0", 1, "uint"},
|
||||
{"%1 = OpTypeInt 32 1", 1, "int"},
|
||||
{"%1 = OpTypeInt 64 0", 1, "ulong"},
|
||||
{"%1 = OpTypeInt 64 1", 1, "long"},
|
||||
{"%1 = OpTypeInt 1 0", 1, "u1"},
|
||||
{"%1 = OpTypeInt 1 1", 1, "i1"},
|
||||
{"%1 = OpTypeInt 33 0", 1, "u33"},
|
||||
{"%1 = OpTypeInt 33 1", 1, "i33"},
|
||||
INSTANTIATE_TEST_SUITE_P(ScalarType, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%1 = OpTypeVoid", 1, "void"},
|
||||
{"%1 = OpTypeBool", 1, "bool"},
|
||||
{"%1 = OpTypeInt 8 0", 1, "uchar"},
|
||||
{"%1 = OpTypeInt 8 1", 1, "char"},
|
||||
{"%1 = OpTypeInt 16 0", 1, "ushort"},
|
||||
{"%1 = OpTypeInt 16 1", 1, "short"},
|
||||
{"%1 = OpTypeInt 32 0", 1, "uint"},
|
||||
{"%1 = OpTypeInt 32 1", 1, "int"},
|
||||
{"%1 = OpTypeInt 64 0", 1, "ulong"},
|
||||
{"%1 = OpTypeInt 64 1", 1, "long"},
|
||||
{"%1 = OpTypeInt 1 0", 1, "u1"},
|
||||
{"%1 = OpTypeInt 1 1", 1, "i1"},
|
||||
{"%1 = OpTypeInt 33 0", 1, "u33"},
|
||||
{"%1 = OpTypeInt 33 1", 1, "i33"},
|
||||
|
||||
{"%1 = OpTypeFloat 16", 1, "half"},
|
||||
{"%1 = OpTypeFloat 32", 1, "float"},
|
||||
{"%1 = OpTypeFloat 64", 1, "double"},
|
||||
{"%1 = OpTypeFloat 10", 1, "fp10"},
|
||||
{"%1 = OpTypeFloat 55", 1, "fp55"},
|
||||
}), );
|
||||
{"%1 = OpTypeFloat 16", 1, "half"},
|
||||
{"%1 = OpTypeFloat 32", 1, "float"},
|
||||
{"%1 = OpTypeFloat 64", 1, "double"},
|
||||
{"%1 = OpTypeFloat 10", 1, "fp10"},
|
||||
{"%1 = OpTypeFloat 55", 1, "fp55"},
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
VectorType, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%1 = OpTypeBool %2 = OpTypeVector %1 1", 2, "v1bool"},
|
||||
@ -97,9 +97,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// OpName overrides the element name.
|
||||
{"OpName %1 \"time\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2", 2,
|
||||
"v2time"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
MatrixType, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%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 "
|
||||
"= OpTypeMatrix %2 4",
|
||||
3, "mat4lat_long"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpName, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"OpName %1 \"abcdefg\"", 1, "abcdefg"},
|
||||
@ -146,38 +146,38 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// OpName can override other inferences. We assume valid instruction
|
||||
// ordering, where OpName precedes type definitions.
|
||||
{"OpName %1 \"myfloat\" %1 = OpTypeFloat 32", 1, "myfloat"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
UniquenessHeuristic, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 1, "void"},
|
||||
{"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 2, "void_0"},
|
||||
{"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 3, "void_1"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Arrays, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"OpName %2 \"FortyTwo\" %1 = OpTypeFloat 32 "
|
||||
"%2 = OpConstant %1 42 %3 = OpTypeArray %1 %2",
|
||||
3, "_arr_float_FortyTwo"},
|
||||
{"%1 = OpTypeInt 32 0 "
|
||||
"%2 = OpTypeRuntimeArray %1",
|
||||
2, "_runtimearr_uint"},
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(Arrays, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"OpName %2 \"FortyTwo\" %1 = OpTypeFloat 32 "
|
||||
"%2 = OpConstant %1 42 %3 = OpTypeArray %1 %2",
|
||||
3, "_arr_float_FortyTwo"},
|
||||
{"%1 = OpTypeInt 32 0 "
|
||||
"%2 = OpTypeRuntimeArray %1",
|
||||
2, "_runtimearr_uint"},
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Structs, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%1 = OpTypeBool "
|
||||
"%2 = OpTypeStruct %1 %1 %1",
|
||||
2, "_struct_2"},
|
||||
{"%1 = OpTypeBool "
|
||||
"%2 = OpTypeStruct %1 %1 %1 "
|
||||
"%3 = OpTypeStruct %2 %2",
|
||||
3, "_struct_3"},
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(Structs, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%1 = OpTypeBool "
|
||||
"%2 = OpTypeStruct %1 %1 %1",
|
||||
2, "_struct_2"},
|
||||
{"%1 = OpTypeBool "
|
||||
"%2 = OpTypeStruct %1 %1 %1 "
|
||||
"%3 = OpTypeStruct %2 %2",
|
||||
3, "_struct_3"},
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Pointer, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%1 = OpTypeFloat 32 %2 = OpTypePointer Workgroup %1", 2,
|
||||
@ -189,22 +189,22 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"%1 = OpTypeBool OpTypeForwardPointer %2 Private %2 = OpTypePointer "
|
||||
"Private %1",
|
||||
2, "_ptr_Private_bool"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ExoticTypes, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%1 = OpTypeEvent", 1, "Event"},
|
||||
{"%1 = OpTypeDeviceEvent", 1, "DeviceEvent"},
|
||||
{"%1 = OpTypeReserveId", 1, "ReserveId"},
|
||||
{"%1 = OpTypeQueue", 1, "Queue"},
|
||||
{"%1 = OpTypeOpaque \"hello world!\"", 1,
|
||||
"Opaque_hello_world_"},
|
||||
{"%1 = OpTypePipe ReadOnly", 1, "PipeReadOnly"},
|
||||
{"%1 = OpTypePipe WriteOnly", 1, "PipeWriteOnly"},
|
||||
{"%1 = OpTypePipe ReadWrite", 1, "PipeReadWrite"},
|
||||
{"%1 = OpTypePipeStorage", 1, "PipeStorage"},
|
||||
{"%1 = OpTypeNamedBarrier", 1, "NamedBarrier"},
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(ExoticTypes, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%1 = OpTypeEvent", 1, "Event"},
|
||||
{"%1 = OpTypeDeviceEvent", 1, "DeviceEvent"},
|
||||
{"%1 = OpTypeReserveId", 1, "ReserveId"},
|
||||
{"%1 = OpTypeQueue", 1, "Queue"},
|
||||
{"%1 = OpTypeOpaque \"hello world!\"", 1,
|
||||
"Opaque_hello_world_"},
|
||||
{"%1 = OpTypePipe ReadOnly", 1, "PipeReadOnly"},
|
||||
{"%1 = OpTypePipe WriteOnly", 1, "PipeWriteOnly"},
|
||||
{"%1 = OpTypePipe ReadWrite", 1, "PipeReadWrite"},
|
||||
{"%1 = OpTypePipeStorage", 1, "PipeStorage"},
|
||||
{"%1 = OpTypeNamedBarrier", 1, "NamedBarrier"},
|
||||
}));
|
||||
|
||||
// Makes a test case for a BuiltIn variable declaration.
|
||||
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);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
BuiltIns, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
BuiltInGLCase("Position"),
|
||||
@ -275,15 +275,15 @@ INSTANTIATE_TEST_CASE_P(
|
||||
BuiltInCase("SubgroupGtMaskKHR"),
|
||||
BuiltInCase("SubgroupLeMaskKHR"),
|
||||
BuiltInCase("SubgroupLtMaskKHR"),
|
||||
}), );
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DebugNameOverridesBuiltin, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"OpName %1 \"foo\" OpDecorate %1 BuiltIn WorkDim "
|
||||
"%1 = OpVariable %2 Input",
|
||||
1, "foo"}}), );
|
||||
INSTANTIATE_TEST_SUITE_P(DebugNameOverridesBuiltin, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"OpName %1 \"foo\" OpDecorate %1 BuiltIn WorkDim "
|
||||
"%1 = OpVariable %2 Input",
|
||||
1, "foo"}}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SimpleIntegralConstants, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%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 1 %2 = OpConstant %1 10", 2, "i33_10"},
|
||||
{"%1 = OpTypeInt 33 1 %2 = OpConstant %1 -19", 2, "i33_n19"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SimpleFloatConstants, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ff4p+16", 2,
|
||||
@ -334,14 +334,14 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"double_0x1p_1024"}, // Inf
|
||||
{"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024", 2,
|
||||
"double_n0x1p_1024"}, // -Inf
|
||||
}), );
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
BooleanConstants, FriendlyNameTest,
|
||||
::testing::ValuesIn(std::vector<NameIdCase>{
|
||||
{"%1 = OpTypeBool\n%2 = OpConstantTrue %1", 2, "true"},
|
||||
{"%1 = OpTypeBool\n%2 = OpConstantFalse %1", 2, "false"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
} // namespace
|
||||
} // namespace spvtools
|
||||
|
@ -65,7 +65,7 @@ TEST_P(IdValidityTest, IdTypes) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidAndInvalidIds, IdValidityTest,
|
||||
::testing::ValuesIn(std::vector<IdCheckCase>(
|
||||
{{"%1", true}, {"%2abc", true}, {"%3Def", true},
|
||||
@ -81,7 +81,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"%foo_@_bar", false}, {"%", false},
|
||||
|
||||
{"5", false}, {"32", false}, {"foo", false},
|
||||
{"a%bar", false}})), );
|
||||
{"a%bar", false}})));
|
||||
|
||||
} // namespace
|
||||
} // namespace spvtools
|
||||
|
@ -42,7 +42,7 @@ TEST_P(OpcodeTableCapabilitiesTest, TableEntryMatchesExpectedCapabilities) {
|
||||
ElementsIn(CapabilitySet(entry->numCapabilities, entry->capabilities)));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TableRowTest, OpcodeTableCapabilitiesTest,
|
||||
// Spot-check a few opcodes.
|
||||
::testing::Values(
|
||||
@ -72,7 +72,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CapabilitySet{SpvCapabilityNamedBarrier}},
|
||||
ExpectedOpCodeCapabilities{
|
||||
SpvOpGetKernelMaxNumSubgroups,
|
||||
CapabilitySet{SpvCapabilitySubgroupDispatch}}), );
|
||||
CapabilitySet{SpvCapabilitySubgroupDispatch}}));
|
||||
|
||||
} // namespace
|
||||
} // namespace spvtools
|
||||
|
@ -32,8 +32,8 @@ TEST_P(GetTargetOpcodeTableGetTest, InvalidPointerTable) {
|
||||
ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOpcodeTableGet(nullptr, GetParam()));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(OpcodeTableGet, GetTargetOpcodeTableGetTest,
|
||||
ValuesIn(spvtest::AllTargetEnvironments()));
|
||||
INSTANTIATE_TEST_SUITE_P(OpcodeTableGet, GetTargetOpcodeTableGetTest,
|
||||
ValuesIn(spvtest::AllTargetEnvironments()));
|
||||
|
||||
} // namespace
|
||||
} // namespace spvtools
|
||||
|
@ -91,7 +91,7 @@ TEST_P(EnumCapabilityTest, Sample) {
|
||||
}
|
||||
|
||||
// See SPIR-V Section 3.3 Execution Model
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ExecutionModel, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -104,30 +104,30 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE1(EXECUTION_MODEL, ExecutionModelFragment, Shader),
|
||||
CASE1(EXECUTION_MODEL, ExecutionModelGLCompute, Shader),
|
||||
CASE1(EXECUTION_MODEL, ExecutionModelKernel, Kernel),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.4 Addressing Model
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
AddressingModel, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
CASE0(ADDRESSING_MODEL, AddressingModelLogical),
|
||||
CASE1(ADDRESSING_MODEL, AddressingModelPhysical32, Addresses),
|
||||
CASE1(ADDRESSING_MODEL, AddressingModelPhysical64, Addresses),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.5 Memory Model
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
MemoryModel, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
CASE1(MEMORY_MODEL, MemoryModelSimple, Shader),
|
||||
CASE1(MEMORY_MODEL, MemoryModelGLSL450, Shader),
|
||||
CASE1(MEMORY_MODEL, MemoryModelOpenCL, Kernel),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.6 Execution Mode
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ExecutionMode, EnumCapabilityTest,
|
||||
Combine(
|
||||
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, ExecutionModeVecTypeHint, Kernel),
|
||||
CASE1(EXECUTION_MODE, ExecutionModeContractionOff, Kernel),
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ExecutionModeV11, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -180,10 +180,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE1(EXECUTION_MODE, ExecutionModeSubgroupSize,
|
||||
SubgroupDispatch),
|
||||
CASE1(EXECUTION_MODE, ExecutionModeSubgroupsPerWorkgroup,
|
||||
SubgroupDispatch)})), );
|
||||
SubgroupDispatch)})));
|
||||
|
||||
// See SPIR-V Section 3.7 Storage Class
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
StorageClass, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -199,10 +199,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE1(STORAGE_CLASS, StorageClassPushConstant, Shader),
|
||||
CASE1(STORAGE_CLASS, StorageClassAtomicCounter, AtomicStorage),
|
||||
CASE0(STORAGE_CLASS, StorageClassImage),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.8 Dim
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Dim, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -213,10 +213,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE2(DIMENSIONALITY, DimRect, SampledRect, ImageRect),
|
||||
CASE2(DIMENSIONALITY, DimBuffer, SampledBuffer, ImageBuffer),
|
||||
CASE1(DIMENSIONALITY, DimSubpassData, InputAttachment),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.9 Sampler Addressing Mode
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SamplerAddressingMode, EnumCapabilityTest,
|
||||
Combine(
|
||||
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, SamplerAddressingModeRepeatMirrored,
|
||||
Kernel),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.10 Sampler Filter Mode
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SamplerFilterMode, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeNearest, Kernel),
|
||||
CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeLinear, Kernel),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.11 Image Format
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ImageFormat, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -286,10 +286,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16ui, StorageImageExtendedFormats),
|
||||
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8ui, StorageImageExtendedFormats),
|
||||
// clang-format on
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.12 Image Channel Order
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ImageChannelOrder, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -314,10 +314,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBA, Kernel),
|
||||
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersBGRA, Kernel),
|
||||
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderABGR, Kernel),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.13 Image Channel Data Type
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ImageChannelDataType, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -340,10 +340,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt24, Kernel),
|
||||
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010_2, Kernel),
|
||||
// clang-format on
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.14 Image Operands
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ImageOperands, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -358,10 +358,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE0(OPTIONAL_IMAGE, ImageOperandsSampleMask),
|
||||
CASE1(OPTIONAL_IMAGE, ImageOperandsMinLodMask, MinLod),
|
||||
// clang-format on
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.15 FP Fast Math Mode
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
FPFastMathMode, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -371,29 +371,29 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE1(FP_FAST_MATH_MODE, FPFastMathModeNSZMask, Kernel),
|
||||
CASE1(FP_FAST_MATH_MODE, FPFastMathModeAllowRecipMask, Kernel),
|
||||
CASE1(FP_FAST_MATH_MODE, FPFastMathModeFastMask, Kernel),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.17 Linkage Type
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
LinkageType, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
CASE1(LINKAGE_TYPE, LinkageTypeExport, Linkage),
|
||||
CASE1(LINKAGE_TYPE, LinkageTypeImport, Linkage),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.18 Access Qualifier
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
AccessQualifier, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
CASE1(ACCESS_QUALIFIER, AccessQualifierReadOnly, Kernel),
|
||||
CASE1(ACCESS_QUALIFIER, AccessQualifierWriteOnly, Kernel),
|
||||
CASE1(ACCESS_QUALIFIER, AccessQualifierReadWrite, Kernel),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.19 Function Parameter Attribute
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
FunctionParameterAttribute, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -407,10 +407,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoWrite, Kernel),
|
||||
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoReadWrite, Kernel),
|
||||
// clang-format on
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.20 Decoration
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Decoration, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -460,25 +460,25 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE1(DECORATION, DecorationInputAttachmentIndex,
|
||||
InputAttachment),
|
||||
CASE1(DECORATION, DecorationAlignment, Kernel),
|
||||
})), );
|
||||
})));
|
||||
|
||||
#if 0
|
||||
// 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),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{CASE1(
|
||||
DECORATION, DecorationSpecId, Shader)})), );
|
||||
DECORATION, DecorationSpecId, Shader)})));
|
||||
#endif
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DecorationV11, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
CASE2(DECORATION, DecorationSpecId, Shader, Kernel),
|
||||
CASE1(DECORATION, DecorationMaxByteOffset, Addresses)})), );
|
||||
CASE1(DECORATION, DecorationMaxByteOffset, Addresses)})));
|
||||
|
||||
// See SPIR-V Section 3.21 BuiltIn
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
BuiltIn, EnumCapabilityTest,
|
||||
Combine(
|
||||
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, BuiltInInstanceIndex, Shader),
|
||||
// clang-format on
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.22 Selection Control
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SelectionControl, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
CASE0(SELECTION_CONTROL, SelectionControlMaskNone),
|
||||
CASE0(SELECTION_CONTROL, SelectionControlFlattenMask),
|
||||
CASE0(SELECTION_CONTROL, SelectionControlDontFlattenMask),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.23 Loop Control
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
LoopControl, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
CASE0(LOOP_CONTROL, LoopControlMaskNone),
|
||||
CASE0(LOOP_CONTROL, LoopControlUnrollMask),
|
||||
CASE0(LOOP_CONTROL, LoopControlDontUnrollMask),
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
LoopControlV11, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
CASE0(LOOP_CONTROL, LoopControlDependencyInfiniteMask),
|
||||
CASE0(LOOP_CONTROL, LoopControlDependencyLengthMask),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.24 Function Control
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
FunctionControl, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -570,10 +570,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE0(FUNCTION_CONTROL, FunctionControlDontInlineMask),
|
||||
CASE0(FUNCTION_CONTROL, FunctionControlPureMask),
|
||||
CASE0(FUNCTION_CONTROL, FunctionControlConstMask),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.25 Memory Semantics <id>
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
MemorySemantics, EnumCapabilityTest,
|
||||
Combine(
|
||||
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
@ -592,10 +592,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsAtomicCounterMemoryMask,
|
||||
AtomicStorage), // Bug 15234
|
||||
CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsImageMemoryMask),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.26 Memory Access
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
MemoryAccess, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -603,10 +603,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessVolatileMask),
|
||||
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessAlignedMask),
|
||||
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessNontemporalMask),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.27 Scope <id>
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Scope, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||
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, ScopeInvocation),
|
||||
CASE1(SCOPE_ID, ScopeQueueFamilyKHR, VulkanMemoryModelKHR),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.28 Group Operation
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
GroupOperation, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -630,10 +630,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
GroupNonUniformArithmetic, GroupNonUniformBallot),
|
||||
CASE3(GROUP_OPERATION, GroupOperationExclusiveScan, Kernel,
|
||||
GroupNonUniformArithmetic, GroupNonUniformBallot),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.29 Kernel Enqueue Flags
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
KernelEnqueueFlags, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
@ -641,20 +641,20 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitKernel, Kernel),
|
||||
CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitWorkGroup,
|
||||
Kernel),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.30 Kernel Profiling Info
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
KernelProfilingInfo, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
CASE0(KERNEL_PROFILING_INFO, KernelProfilingInfoMaskNone),
|
||||
CASE1(KERNEL_PROFILING_INFO, KernelProfilingInfoCmdExecTimeMask,
|
||||
Kernel),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// See SPIR-V Section 3.31 Capability
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
CapabilityDependsOn, EnumCapabilityTest,
|
||||
Combine(
|
||||
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, CapabilityMultiViewport, Geometry),
|
||||
// clang-format on
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
CapabilityDependsOnV11, EnumCapabilityTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCapabilityCase>{
|
||||
CASE1(CAPABILITY, CapabilitySubgroupDispatch, DeviceEnqueue),
|
||||
CASE1(CAPABILITY, CapabilityNamedBarrier, Kernel),
|
||||
CASE1(CAPABILITY, CapabilityPipeStorage, Pipes),
|
||||
})), );
|
||||
})));
|
||||
|
||||
#undef CASE0
|
||||
#undef CASE1
|
||||
|
@ -84,7 +84,7 @@ TEST_P(MaskExpansionTest, Sample) {
|
||||
#define PREFIX1 \
|
||||
SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE, \
|
||||
SPV_OPERAND_TYPE_ID
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OperandPattern, MaskExpansionTest,
|
||||
::testing::ValuesIn(std::vector<MaskExpansionCase>{
|
||||
// No bits means no change.
|
||||
@ -111,7 +111,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
SpvMemoryAccessVolatileMask | SpvMemoryAccessAlignedMask,
|
||||
{PREFIX1},
|
||||
{PREFIX1, SPV_OPERAND_TYPE_LITERAL_INTEGER}},
|
||||
}), );
|
||||
}));
|
||||
#undef PREFIX0
|
||||
#undef PREFIX1
|
||||
|
||||
@ -137,9 +137,9 @@ TEST_P(MatchableOperandExpansionTest, MatchableOperandsDontExpand) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(MatchableOperandExpansion,
|
||||
MatchableOperandExpansionTest,
|
||||
::testing::ValuesIn(allOperandTypes()), );
|
||||
INSTANTIATE_TEST_SUITE_P(MatchableOperandExpansion,
|
||||
MatchableOperandExpansionTest,
|
||||
::testing::ValuesIn(allOperandTypes()));
|
||||
|
||||
using VariableOperandExpansionTest =
|
||||
::testing::TestWithParam<spv_operand_type_t>;
|
||||
@ -157,9 +157,9 @@ TEST_P(VariableOperandExpansionTest, NonMatchableOperandsExpand) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(NonMatchableOperandExpansion,
|
||||
VariableOperandExpansionTest,
|
||||
::testing::ValuesIn(allOperandTypes()), );
|
||||
INSTANTIATE_TEST_SUITE_P(NonMatchableOperandExpansion,
|
||||
VariableOperandExpansionTest,
|
||||
::testing::ValuesIn(allOperandTypes()));
|
||||
|
||||
TEST(AlternatePatternFollowingImmediate, Empty) {
|
||||
EXPECT_THAT(spvAlternatePatternFollowingImmediate({}),
|
||||
|
@ -33,10 +33,10 @@ TEST_P(GetTargetTest, InvalidPointerTable) {
|
||||
ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOperandTableGet(nullptr, GetParam()));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(OperandTableGet, GetTargetTest,
|
||||
ValuesIn(std::vector<spv_target_env>{
|
||||
SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||
SPV_ENV_VULKAN_1_0}), );
|
||||
INSTANTIATE_TEST_SUITE_P(OperandTableGet, GetTargetTest,
|
||||
ValuesIn(std::vector<spv_target_env>{
|
||||
SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||
SPV_ENV_VULKAN_1_0}));
|
||||
|
||||
TEST(OperandString, AllAreDefinedExceptVariable) {
|
||||
// None has no string, so don't test it.
|
||||
|
@ -4254,7 +4254,7 @@ TEST_P(AggressiveEliminateDeadConstantTest, Custom) {
|
||||
SinglePassRunAndMatch<AggressiveDCEPass>(assembly_with_dead_const, false);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ScalarTypeConstants, AggressiveEliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -4346,7 +4346,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
VectorTypeConstants, AggressiveEliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -4473,7 +4473,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
StructTypeConstants, AggressiveEliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -4644,7 +4644,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ScalarTypeSpecConstants, AggressiveEliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -4697,7 +4697,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
VectorTypeSpecConstants, AggressiveEliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -4819,7 +4819,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SpecConstantOp, AggressiveEliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -5001,7 +5001,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
LongDefUseChain, AggressiveEliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
|
@ -206,7 +206,7 @@ TEST_P(ParseDefUseTest, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TestCase, ParseDefUseTest,
|
||||
::testing::ValuesIn(std::vector<ParseDefUseCase>{
|
||||
{"", {{}, {}}}, // no instruction
|
||||
@ -629,7 +629,7 @@ TEST_P(ReplaceUseTest, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TestCase, ReplaceUseTest,
|
||||
::testing::ValuesIn(std::vector<ReplaceUseCase>{
|
||||
{ // no use, no replace request
|
||||
@ -981,7 +981,7 @@ TEST_P(KillDefTest, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TestCase, KillDefTest,
|
||||
::testing::ValuesIn(std::vector<KillDefCase>{
|
||||
{ // no def, no use, no kill
|
||||
@ -1343,7 +1343,7 @@ TEST_P(AnalyzeInstDefUseTest, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TestCase, AnalyzeInstDefUseTest,
|
||||
::testing::ValuesIn(std::vector<AnalyzeInstDefUseTestCase>{
|
||||
{ // A type declaring instruction.
|
||||
@ -1464,7 +1464,7 @@ TEST_P(KillInstTest, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TestCase, KillInstTest,
|
||||
::testing::ValuesIn(std::vector<KillInstTestCase>{
|
||||
// Kill id defining instructions.
|
||||
@ -1588,7 +1588,7 @@ TEST_P(GetAnnotationsTest, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TestCase, GetAnnotationsTest,
|
||||
::testing::ValuesIn(std::vector<GetAnnotationsTestCase>{
|
||||
// empty
|
||||
|
@ -197,7 +197,7 @@ TEST_P(EliminateDeadConstantTest, Custom) {
|
||||
assembly_with_dead_const, expected, /* skip_nop = */ true);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ScalarTypeConstants, EliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -265,7 +265,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
VectorTypeConstants, EliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -358,7 +358,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
StructTypeConstants, EliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -485,7 +485,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ScalarTypeSpecConstants, EliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -522,7 +522,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
VectorTypeSpecConstants, EliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -617,7 +617,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SpecConstantOp, EliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
@ -768,7 +768,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// clang-format on
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
LongDefUseChain, EliminateDeadConstantTest,
|
||||
::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
|
||||
// clang-format off
|
||||
|
@ -81,158 +81,158 @@ TEST_P(FlattenDecorationTest, TransformsDecorations) {
|
||||
SinglePassRunAndCheck<FlattenDecorationPass>(before, after, false, true);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(NoUses, FlattenDecorationTest,
|
||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||
// No OpDecorationGroup
|
||||
{"", ""},
|
||||
INSTANTIATE_TEST_SUITE_P(NoUses, FlattenDecorationTest,
|
||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||
// No OpDecorationGroup
|
||||
{"", ""},
|
||||
|
||||
// OpDecorationGroup without any uses, and
|
||||
// no OpName.
|
||||
{"%group = OpDecorationGroup\n", ""},
|
||||
// OpDecorationGroup without any uses, and
|
||||
// no OpName.
|
||||
{"%group = OpDecorationGroup\n", ""},
|
||||
|
||||
// OpDecorationGroup without any uses, and
|
||||
// with OpName targeting it. Proves you must
|
||||
// remove the names as well.
|
||||
{"OpName %group \"group\"\n"
|
||||
"%group = OpDecorationGroup\n",
|
||||
""},
|
||||
// OpDecorationGroup without any uses, and
|
||||
// with OpName targeting it. Proves you must
|
||||
// remove the names as well.
|
||||
{"OpName %group \"group\"\n"
|
||||
"%group = OpDecorationGroup\n",
|
||||
""},
|
||||
|
||||
// OpDecorationGroup with decorations that
|
||||
// target it, but no uses in OpGroupDecorate
|
||||
// or OpGroupMemberDecorate instructions.
|
||||
{"OpDecorate %group Flat\n"
|
||||
"OpDecorate %group NoPerspective\n"
|
||||
"%group = OpDecorationGroup\n",
|
||||
""},
|
||||
}), );
|
||||
// OpDecorationGroup with decorations that
|
||||
// target it, but no uses in OpGroupDecorate
|
||||
// or OpGroupMemberDecorate instructions.
|
||||
{"OpDecorate %group Flat\n"
|
||||
"OpDecorate %group NoPerspective\n"
|
||||
"%group = OpDecorationGroup\n",
|
||||
""},
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(OpGroupDecorate, FlattenDecorationTest,
|
||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||
// One OpGroupDecorate
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpDecorate %group NoPerspective\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupDecorate %group %hue %saturation\n",
|
||||
"OpDecorate %hue Flat\n"
|
||||
"OpDecorate %saturation Flat\n"
|
||||
"OpDecorate %hue NoPerspective\n"
|
||||
"OpDecorate %saturation NoPerspective\n"},
|
||||
// Multiple OpGroupDecorate
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpDecorate %group NoPerspective\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupDecorate %group %hue %value\n"
|
||||
"OpGroupDecorate %group %saturation\n",
|
||||
"OpDecorate %hue Flat\n"
|
||||
"OpDecorate %value Flat\n"
|
||||
"OpDecorate %saturation Flat\n"
|
||||
"OpDecorate %hue NoPerspective\n"
|
||||
"OpDecorate %value NoPerspective\n"
|
||||
"OpDecorate %saturation NoPerspective\n"},
|
||||
// Two group decorations, interleaved
|
||||
{"OpName %group0 \"group0\"\n"
|
||||
"OpName %group1 \"group1\"\n"
|
||||
"OpDecorate %group0 Flat\n"
|
||||
"OpDecorate %group1 NoPerspective\n"
|
||||
"%group0 = OpDecorationGroup\n"
|
||||
"%group1 = OpDecorationGroup\n"
|
||||
"OpGroupDecorate %group0 %hue %value\n"
|
||||
"OpGroupDecorate %group1 %saturation\n",
|
||||
"OpDecorate %hue Flat\n"
|
||||
"OpDecorate %value Flat\n"
|
||||
"OpDecorate %saturation NoPerspective\n"},
|
||||
// Decoration with operands
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Location 42\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupDecorate %group %hue %saturation\n",
|
||||
"OpDecorate %hue Location 42\n"
|
||||
"OpDecorate %saturation Location 42\n"},
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(OpGroupDecorate, FlattenDecorationTest,
|
||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||
// One OpGroupDecorate
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpDecorate %group NoPerspective\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupDecorate %group %hue %saturation\n",
|
||||
"OpDecorate %hue Flat\n"
|
||||
"OpDecorate %saturation Flat\n"
|
||||
"OpDecorate %hue NoPerspective\n"
|
||||
"OpDecorate %saturation NoPerspective\n"},
|
||||
// Multiple OpGroupDecorate
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpDecorate %group NoPerspective\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupDecorate %group %hue %value\n"
|
||||
"OpGroupDecorate %group %saturation\n",
|
||||
"OpDecorate %hue Flat\n"
|
||||
"OpDecorate %value Flat\n"
|
||||
"OpDecorate %saturation Flat\n"
|
||||
"OpDecorate %hue NoPerspective\n"
|
||||
"OpDecorate %value NoPerspective\n"
|
||||
"OpDecorate %saturation NoPerspective\n"},
|
||||
// Two group decorations, interleaved
|
||||
{"OpName %group0 \"group0\"\n"
|
||||
"OpName %group1 \"group1\"\n"
|
||||
"OpDecorate %group0 Flat\n"
|
||||
"OpDecorate %group1 NoPerspective\n"
|
||||
"%group0 = OpDecorationGroup\n"
|
||||
"%group1 = OpDecorationGroup\n"
|
||||
"OpGroupDecorate %group0 %hue %value\n"
|
||||
"OpGroupDecorate %group1 %saturation\n",
|
||||
"OpDecorate %hue Flat\n"
|
||||
"OpDecorate %value Flat\n"
|
||||
"OpDecorate %saturation NoPerspective\n"},
|
||||
// Decoration with operands
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Location 42\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupDecorate %group %hue %saturation\n",
|
||||
"OpDecorate %hue Location 42\n"
|
||||
"OpDecorate %saturation Location 42\n"},
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(OpGroupMemberDecorate, FlattenDecorationTest,
|
||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||
// One OpGroupMemberDecorate
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpDecorate %group Offset 16\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupMemberDecorate %group %Point 1\n",
|
||||
"OpMemberDecorate %Point 1 Flat\n"
|
||||
"OpMemberDecorate %Point 1 Offset 16\n"},
|
||||
// Multiple OpGroupMemberDecorate using the same
|
||||
// decoration group.
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpDecorate %group NoPerspective\n"
|
||||
"OpDecorate %group Offset 8\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupMemberDecorate %group %Point 2\n"
|
||||
"OpGroupMemberDecorate %group %Camera 1\n",
|
||||
"OpMemberDecorate %Point 2 Flat\n"
|
||||
"OpMemberDecorate %Camera 1 Flat\n"
|
||||
"OpMemberDecorate %Point 2 NoPerspective\n"
|
||||
"OpMemberDecorate %Camera 1 NoPerspective\n"
|
||||
"OpMemberDecorate %Point 2 Offset 8\n"
|
||||
"OpMemberDecorate %Camera 1 Offset 8\n"},
|
||||
// Two groups of member decorations, interleaved.
|
||||
// Decoration is with and without operands.
|
||||
{"OpName %group0 \"group0\"\n"
|
||||
"OpName %group1 \"group1\"\n"
|
||||
"OpDecorate %group0 Flat\n"
|
||||
"OpDecorate %group0 Offset 8\n"
|
||||
"OpDecorate %group1 NoPerspective\n"
|
||||
"OpDecorate %group1 Offset 16\n"
|
||||
"%group0 = OpDecorationGroup\n"
|
||||
"%group1 = OpDecorationGroup\n"
|
||||
"OpGroupMemberDecorate %group0 %Point 0\n"
|
||||
"OpGroupMemberDecorate %group1 %Point 2\n",
|
||||
"OpMemberDecorate %Point 0 Flat\n"
|
||||
"OpMemberDecorate %Point 0 Offset 8\n"
|
||||
"OpMemberDecorate %Point 2 NoPerspective\n"
|
||||
"OpMemberDecorate %Point 2 Offset 16\n"},
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(OpGroupMemberDecorate, FlattenDecorationTest,
|
||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||
// One OpGroupMemberDecorate
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpDecorate %group Offset 16\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupMemberDecorate %group %Point 1\n",
|
||||
"OpMemberDecorate %Point 1 Flat\n"
|
||||
"OpMemberDecorate %Point 1 Offset 16\n"},
|
||||
// Multiple OpGroupMemberDecorate using the same
|
||||
// decoration group.
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpDecorate %group NoPerspective\n"
|
||||
"OpDecorate %group Offset 8\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupMemberDecorate %group %Point 2\n"
|
||||
"OpGroupMemberDecorate %group %Camera 1\n",
|
||||
"OpMemberDecorate %Point 2 Flat\n"
|
||||
"OpMemberDecorate %Camera 1 Flat\n"
|
||||
"OpMemberDecorate %Point 2 NoPerspective\n"
|
||||
"OpMemberDecorate %Camera 1 NoPerspective\n"
|
||||
"OpMemberDecorate %Point 2 Offset 8\n"
|
||||
"OpMemberDecorate %Camera 1 Offset 8\n"},
|
||||
// Two groups of member decorations, interleaved.
|
||||
// Decoration is with and without operands.
|
||||
{"OpName %group0 \"group0\"\n"
|
||||
"OpName %group1 \"group1\"\n"
|
||||
"OpDecorate %group0 Flat\n"
|
||||
"OpDecorate %group0 Offset 8\n"
|
||||
"OpDecorate %group1 NoPerspective\n"
|
||||
"OpDecorate %group1 Offset 16\n"
|
||||
"%group0 = OpDecorationGroup\n"
|
||||
"%group1 = OpDecorationGroup\n"
|
||||
"OpGroupMemberDecorate %group0 %Point 0\n"
|
||||
"OpGroupMemberDecorate %group1 %Point 2\n",
|
||||
"OpMemberDecorate %Point 0 Flat\n"
|
||||
"OpMemberDecorate %Point 0 Offset 8\n"
|
||||
"OpMemberDecorate %Point 2 NoPerspective\n"
|
||||
"OpMemberDecorate %Point 2 Offset 16\n"},
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(UnrelatedDecorations, FlattenDecorationTest,
|
||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||
// A non-group non-member decoration is untouched.
|
||||
{"OpDecorate %hue Centroid\n"
|
||||
"OpDecorate %saturation Flat\n",
|
||||
"OpDecorate %hue Centroid\n"
|
||||
"OpDecorate %saturation Flat\n"},
|
||||
// A non-group member decoration is untouched.
|
||||
{"OpMemberDecorate %Point 0 Offset 0\n"
|
||||
"OpMemberDecorate %Point 1 Offset 4\n"
|
||||
"OpMemberDecorate %Point 1 Flat\n",
|
||||
"OpMemberDecorate %Point 0 Offset 0\n"
|
||||
"OpMemberDecorate %Point 1 Offset 4\n"
|
||||
"OpMemberDecorate %Point 1 Flat\n"},
|
||||
// A non-group non-member decoration survives any
|
||||
// replacement of group decorations.
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpDecorate %hue Centroid\n"
|
||||
"OpDecorate %group NoPerspective\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupDecorate %group %hue %saturation\n",
|
||||
"OpDecorate %hue Flat\n"
|
||||
"OpDecorate %saturation Flat\n"
|
||||
"OpDecorate %hue Centroid\n"
|
||||
"OpDecorate %hue NoPerspective\n"
|
||||
"OpDecorate %saturation NoPerspective\n"},
|
||||
// A non-group member decoration survives any
|
||||
// replacement of group decorations.
|
||||
{"OpDecorate %group Offset 0\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpMemberDecorate %Point 1 Offset 4\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupMemberDecorate %group %Point 0\n",
|
||||
"OpMemberDecorate %Point 0 Offset 0\n"
|
||||
"OpMemberDecorate %Point 0 Flat\n"
|
||||
"OpMemberDecorate %Point 1 Offset 4\n"},
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(UnrelatedDecorations, FlattenDecorationTest,
|
||||
::testing::ValuesIn(std::vector<FlattenDecorationCase>{
|
||||
// A non-group non-member decoration is untouched.
|
||||
{"OpDecorate %hue Centroid\n"
|
||||
"OpDecorate %saturation Flat\n",
|
||||
"OpDecorate %hue Centroid\n"
|
||||
"OpDecorate %saturation Flat\n"},
|
||||
// A non-group member decoration is untouched.
|
||||
{"OpMemberDecorate %Point 0 Offset 0\n"
|
||||
"OpMemberDecorate %Point 1 Offset 4\n"
|
||||
"OpMemberDecorate %Point 1 Flat\n",
|
||||
"OpMemberDecorate %Point 0 Offset 0\n"
|
||||
"OpMemberDecorate %Point 1 Offset 4\n"
|
||||
"OpMemberDecorate %Point 1 Flat\n"},
|
||||
// A non-group non-member decoration survives any
|
||||
// replacement of group decorations.
|
||||
{"OpName %group \"group\"\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpDecorate %hue Centroid\n"
|
||||
"OpDecorate %group NoPerspective\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupDecorate %group %hue %saturation\n",
|
||||
"OpDecorate %hue Flat\n"
|
||||
"OpDecorate %saturation Flat\n"
|
||||
"OpDecorate %hue Centroid\n"
|
||||
"OpDecorate %hue NoPerspective\n"
|
||||
"OpDecorate %saturation NoPerspective\n"},
|
||||
// A non-group member decoration survives any
|
||||
// replacement of group decorations.
|
||||
{"OpDecorate %group Offset 0\n"
|
||||
"OpDecorate %group Flat\n"
|
||||
"OpMemberDecorate %Point 1 Offset 4\n"
|
||||
"%group = OpDecorationGroup\n"
|
||||
"OpGroupMemberDecorate %group %Point 0\n",
|
||||
"OpMemberDecorate %Point 0 Offset 0\n"
|
||||
"OpMemberDecorate %Point 0 Flat\n"
|
||||
"OpMemberDecorate %Point 1 Offset 4\n"},
|
||||
}));
|
||||
|
||||
} // namespace
|
||||
} // namespace opt
|
||||
|
@ -224,7 +224,7 @@ TEST_P(FoldSpecConstantOpAndCompositePassTest, ParamTestCase) {
|
||||
|
||||
// Tests that OpSpecConstantComposite opcodes are replace with
|
||||
// OpConstantComposite correctly.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Composite, FoldSpecConstantOpAndCompositePassTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||
@ -330,7 +330,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
})));
|
||||
|
||||
// Tests for operations that resulting in different types.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Cast, FoldSpecConstantOpAndCompositePassTest,
|
||||
::testing::ValuesIn(
|
||||
std::vector<FoldSpecConstantOpAndCompositePassTestCase>({
|
||||
@ -567,7 +567,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
|
||||
// Tests about boolean scalar logical operations and comparison operations with
|
||||
// scalar int/uint type.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Logical, FoldSpecConstantOpAndCompositePassTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||
@ -636,7 +636,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
})));
|
||||
|
||||
// Tests about arithmetic operations for scalar int and uint types.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ScalarArithmetic, FoldSpecConstantOpAndCompositePassTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||
@ -821,7 +821,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
})));
|
||||
|
||||
// Tests about arithmetic operations for vector int and uint types.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
VectorArithmetic, FoldSpecConstantOpAndCompositePassTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||
@ -1043,7 +1043,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
})));
|
||||
|
||||
// Tests for SpecConstantOp CompositeExtract instruction
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
CompositeExtract, FoldSpecConstantOpAndCompositePassTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||
@ -1217,7 +1217,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
})));
|
||||
|
||||
// Tests the swizzle operations for spec const vectors.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
VectorShuffle, FoldSpecConstantOpAndCompositePassTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||
@ -1310,7 +1310,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
})));
|
||||
|
||||
// Test with long use-def chain.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
LongDefUseChain, FoldSpecConstantOpAndCompositePassTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
FoldSpecConstantOpAndCompositePassTestCase>({
|
||||
|
@ -265,7 +265,7 @@ const std::string& HeaderWithNaN() {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(TestCase, IntegerInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TestCase, IntegerInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold 0*n
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -590,7 +590,7 @@ TEST_P(IntVectorInstructionFoldingTest, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(TestCase, IntVectorInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TestCase, IntVectorInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold 0*n
|
||||
InstructionFoldingCase<std::vector<uint32_t>>(
|
||||
@ -667,7 +667,7 @@ TEST_P(BooleanInstructionFoldingTest, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(TestCase, BooleanInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TestCase, BooleanInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold true || n
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -871,7 +871,7 @@ INSTANTIATE_TEST_CASE_P(TestCase, BooleanInstructionFoldingTest,
|
||||
2, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(FClampAndCmpLHS, BooleanInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(FClampAndCmpLHS, BooleanInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold 0.0 > clamp(n, 0.0, 1.0)
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -1051,7 +1051,7 @@ INSTANTIATE_TEST_CASE_P(FClampAndCmpLHS, BooleanInstructionFoldingTest,
|
||||
2, false)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(FClampAndCmpRHS, BooleanInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(FClampAndCmpRHS, BooleanInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold clamp(n, 0.0, 1.0) > 1.0
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -1281,7 +1281,7 @@ TEST_P(FloatInstructionFoldingTest, Case) {
|
||||
// specification.
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(FloatConstantFoldingTest, FloatInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(FloatConstantFoldingTest, FloatInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Fold 2.0 - 1.0
|
||||
InstructionFoldingCase<float>(
|
||||
@ -1424,7 +1424,7 @@ TEST_P(DoubleInstructionFoldingTest, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(DoubleConstantFoldingTest, DoubleInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(DoubleConstantFoldingTest, DoubleInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Fold 2.0 - 1.0
|
||||
InstructionFoldingCase<double>(
|
||||
@ -1534,7 +1534,7 @@ INSTANTIATE_TEST_CASE_P(DoubleConstantFoldingTest, DoubleInstructionFoldingTest,
|
||||
// clang-format on
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(DoubleOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(DoubleOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold 1.0 == 2.0
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -1666,7 +1666,7 @@ INSTANTIATE_TEST_CASE_P(DoubleOrderedCompareConstantFoldingTest, BooleanInstruct
|
||||
2, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DoubleUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(DoubleUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold 1.0 == 2.0
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -1798,7 +1798,7 @@ INSTANTIATE_TEST_CASE_P(DoubleUnorderedCompareConstantFoldingTest, BooleanInstru
|
||||
2, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(FloatOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(FloatOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold 1.0 == 2.0
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -1930,7 +1930,7 @@ INSTANTIATE_TEST_CASE_P(FloatOrderedCompareConstantFoldingTest, BooleanInstructi
|
||||
2, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(FloatUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(FloatUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold 1.0 == 2.0
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -2062,7 +2062,7 @@ INSTANTIATE_TEST_CASE_P(FloatUnorderedCompareConstantFoldingTest, BooleanInstruc
|
||||
2, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DoubleNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(DoubleNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold NaN == 0 (ord)
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -2098,7 +2098,7 @@ INSTANTIATE_TEST_CASE_P(DoubleNaNCompareConstantFoldingTest, BooleanInstructionF
|
||||
2, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(FloatNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(FloatNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold NaN == 0 (ord)
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -2180,7 +2180,7 @@ TEST_P(IntegerInstructionFoldingTestWithMap, Case) {
|
||||
}
|
||||
}
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(TestCase, IntegerInstructionFoldingTestWithMap,
|
||||
INSTANTIATE_TEST_SUITE_P(TestCase, IntegerInstructionFoldingTestWithMap,
|
||||
::testing::Values(
|
||||
// Test case 0: fold %3 = 0; %3 * n
|
||||
InstructionFoldingCaseWithMap<uint32_t>(
|
||||
@ -2230,7 +2230,7 @@ TEST_P(BooleanInstructionFoldingTestWithMap, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(TestCase, BooleanInstructionFoldingTestWithMap,
|
||||
INSTANTIATE_TEST_SUITE_P(TestCase, BooleanInstructionFoldingTestWithMap,
|
||||
::testing::Values(
|
||||
// Test case 0: fold %3 = true; %3 || n
|
||||
InstructionFoldingCaseWithMap<bool>(
|
||||
@ -2280,7 +2280,7 @@ TEST_P(GeneralInstructionFoldingTest, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(IntegerArithmeticTestCases, GeneralInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(IntegerArithmeticTestCases, GeneralInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Don't fold n * m
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -2740,7 +2740,7 @@ INSTANTIATE_TEST_CASE_P(IntegerArithmeticTestCases, GeneralInstructionFoldingTes
|
||||
2, 3)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(CompositeExtractFoldingTest, GeneralInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(CompositeExtractFoldingTest, GeneralInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold Insert feeding extract
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -2888,7 +2888,7 @@ INSTANTIATE_TEST_CASE_P(CompositeExtractFoldingTest, GeneralInstructionFoldingTe
|
||||
4, INT_7_ID)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(CompositeConstructFoldingTest, GeneralInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(CompositeConstructFoldingTest, GeneralInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold Extracts feeding construct
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -2951,7 +2951,7 @@ INSTANTIATE_TEST_CASE_P(CompositeConstructFoldingTest, GeneralInstructionFolding
|
||||
2, VEC2_0_ID)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(PhiFoldingTest, GeneralInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(PhiFoldingTest, GeneralInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Fold phi with the same values for all edges.
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -2993,7 +2993,7 @@ INSTANTIATE_TEST_CASE_P(PhiFoldingTest, GeneralInstructionFoldingTest,
|
||||
2, 0)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(FloatRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(FloatRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Don't fold n + 1.0
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -3211,7 +3211,7 @@ INSTANTIATE_TEST_CASE_P(FloatRedundantFoldingTest, GeneralInstructionFoldingTest
|
||||
2, 0)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DoubleRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(DoubleRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Don't fold n + 1.0
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -3371,7 +3371,7 @@ INSTANTIATE_TEST_CASE_P(DoubleRedundantFoldingTest, GeneralInstructionFoldingTes
|
||||
2, 4)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(FloatVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(FloatVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Don't fold a * vec4(0.0, 0.0, 0.0, 1.0)
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -3405,7 +3405,7 @@ INSTANTIATE_TEST_CASE_P(FloatVectorRedundantFoldingTest, GeneralInstructionFoldi
|
||||
2, 3)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DoubleVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(DoubleVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Don't fold a * vec4(0.0, 0.0, 0.0, 1.0)
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -3439,7 +3439,7 @@ INSTANTIATE_TEST_CASE_P(DoubleVectorRedundantFoldingTest, GeneralInstructionFold
|
||||
2, 3)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(IntegerRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(IntegerRedundantFoldingTest, GeneralInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Don't fold n + 1
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -3523,7 +3523,7 @@ INSTANTIATE_TEST_CASE_P(IntegerRedundantFoldingTest, GeneralInstructionFoldingTe
|
||||
2, 3)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ClampAndCmpLHS, GeneralInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(ClampAndCmpLHS, GeneralInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Don't Fold 0.0 < clamp(-1, 1)
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -3659,7 +3659,7 @@ INSTANTIATE_TEST_CASE_P(ClampAndCmpLHS, GeneralInstructionFoldingTest,
|
||||
2, 0)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ClampAndCmpRHS, GeneralInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(ClampAndCmpRHS, GeneralInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Don't Fold clamp(-1, 1) < 0.0
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -3795,7 +3795,7 @@ INSTANTIATE_TEST_CASE_P(ClampAndCmpRHS, GeneralInstructionFoldingTest,
|
||||
2, 0)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(FToIConstantFoldingTest, IntegerInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(FToIConstantFoldingTest, IntegerInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Fold int(3.0)
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -3815,7 +3815,7 @@ INSTANTIATE_TEST_CASE_P(FToIConstantFoldingTest, IntegerInstructionFoldingTest,
|
||||
2, 3)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(IToFConstantFoldingTest, FloatInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(IToFConstantFoldingTest, FloatInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Fold float(3)
|
||||
InstructionFoldingCase<float>(
|
||||
@ -3870,7 +3870,7 @@ TEST_P(ToNegateFoldingTest, Case) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(FloatRedundantSubFoldingTest, ToNegateFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(FloatRedundantSubFoldingTest, ToNegateFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Don't fold 1.0 - n
|
||||
InstructionFoldingCase<uint32_t>(
|
||||
@ -3914,7 +3914,7 @@ INSTANTIATE_TEST_CASE_P(FloatRedundantSubFoldingTest, ToNegateFoldingTest,
|
||||
2, 3)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DoubleRedundantSubFoldingTest, ToNegateFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(DoubleRedundantSubFoldingTest, ToNegateFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Don't fold 1.0 - n
|
||||
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(
|
||||
// Test case 0: Fold 0 + n (change sign)
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -4011,7 +4011,7 @@ INSTANTIATE_TEST_CASE_P(RedundantIntegerMatching, MatchingInstructionFoldingTest
|
||||
2, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(MergeNegateTest, MatchingInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(MergeNegateTest, MatchingInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold consecutive fnegate
|
||||
// -(-x) = x
|
||||
@ -4348,7 +4348,7 @@ INSTANTIATE_TEST_CASE_P(MergeNegateTest, MatchingInstructionFoldingTest,
|
||||
2, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ReciprocalFDivTest, MatchingInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(ReciprocalFDivTest, MatchingInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: scalar reicprocal
|
||||
// x / 0.5 = x * 2.0
|
||||
@ -4429,7 +4429,7 @@ INSTANTIATE_TEST_CASE_P(ReciprocalFDivTest, MatchingInstructionFoldingTest,
|
||||
3, false)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(MergeMulTest, MatchingInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(MergeMulTest, MatchingInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: fold consecutive fmuls
|
||||
// (x * 3.0) * 2.0 = x * 6.0
|
||||
@ -4845,7 +4845,7 @@ INSTANTIATE_TEST_CASE_P(MergeMulTest, MatchingInstructionFoldingTest,
|
||||
5, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(MergeDivTest, MatchingInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(MergeDivTest, MatchingInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: merge consecutive fdiv
|
||||
// 4.0 / (2.0 / x) = 2.0 * x
|
||||
@ -5091,7 +5091,7 @@ INSTANTIATE_TEST_CASE_P(MergeDivTest, MatchingInstructionFoldingTest,
|
||||
5, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(MergeAddTest, MatchingInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(MergeAddTest, MatchingInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: merge add of negate
|
||||
// (-x) + 2 = 2 - x
|
||||
@ -5299,7 +5299,7 @@ INSTANTIATE_TEST_CASE_P(MergeAddTest, MatchingInstructionFoldingTest,
|
||||
4, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(MergeSubTest, MatchingInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(MergeSubTest, MatchingInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: merge sub of negate
|
||||
// (-x) - 2 = -2 - x
|
||||
@ -5524,7 +5524,7 @@ INSTANTIATE_TEST_CASE_P(MergeSubTest, MatchingInstructionFoldingTest,
|
||||
4, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SelectFoldingTest, MatchingInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(SelectFoldingTest, MatchingInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Fold select with the same values for both sides
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -5632,7 +5632,7 @@ INSTANTIATE_TEST_CASE_P(SelectFoldingTest, MatchingInstructionFoldingTest,
|
||||
4, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(CompositeExtractMatchingTest, MatchingInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(CompositeExtractMatchingTest, MatchingInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Extracting from result of consecutive shuffles of differing
|
||||
// size.
|
||||
@ -5775,7 +5775,7 @@ INSTANTIATE_TEST_CASE_P(CompositeExtractMatchingTest, MatchingInstructionFolding
|
||||
4, true)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DotProductMatchingTest, MatchingInstructionFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(DotProductMatchingTest, MatchingInstructionFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Using OpDot to extract last element.
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -5891,7 +5891,7 @@ TEST_P(MatchingInstructionWithNoResultFoldingTest, Case) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(StoreMatchingTest, MatchingInstructionWithNoResultFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(StoreMatchingTest, MatchingInstructionWithNoResultFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Remove store of undef.
|
||||
InstructionFoldingCase<bool>(
|
||||
@ -5920,7 +5920,7 @@ INSTANTIATE_TEST_CASE_P(StoreMatchingTest, MatchingInstructionWithNoResultFoldin
|
||||
0 /* OpStore */, false)
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(VectorShuffleMatchingTest, MatchingInstructionWithNoResultFoldingTest,
|
||||
INSTANTIATE_TEST_SUITE_P(VectorShuffleMatchingTest, MatchingInstructionWithNoResultFoldingTest,
|
||||
::testing::Values(
|
||||
// Test case 0: Basic test 1
|
||||
InstructionFoldingCase<bool>(
|
||||
|
@ -47,7 +47,7 @@ TEST_P(FreezeSpecConstantValueTypeTest, PrimaryType) {
|
||||
}
|
||||
|
||||
// Test each primary type.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
PrimaryTypeSpecConst, FreezeSpecConstantValueTypeTest,
|
||||
::testing::ValuesIn(std::vector<FreezeSpecConstantValueTypeTestCase>({
|
||||
// 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,
|
||||
::testing::ValuesIn(std::vector<DefaultValuesStringParsingTestCase>{
|
||||
// 0. empty map
|
||||
@ -93,7 +93,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"100:1.5e-13", true, SpecIdToValueStrMap{{100, "1.5e-13"}}},
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
InvalidString, DefaultValuesStringParsingTest,
|
||||
::testing::ValuesIn(std::vector<DefaultValuesStringParsingTestCase>{
|
||||
// 0. missing default value
|
||||
@ -148,7 +148,7 @@ TEST_P(SetSpecConstantDefaultValueInStringFormParamTest, TestCase) {
|
||||
tc.code, tc.expected, /* skip_nop = */ false, tc.default_values);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidCases, SetSpecConstantDefaultValueInStringFormParamTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
SetSpecConstantDefaultValueInStringFormTestCase>{
|
||||
@ -445,7 +445,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
},
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
InvalidCases, SetSpecConstantDefaultValueInStringFormParamTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
SetSpecConstantDefaultValueInStringFormTestCase>{
|
||||
@ -610,7 +610,7 @@ TEST_P(SetSpecConstantDefaultValueInBitPatternFormParamTest, TestCase) {
|
||||
tc.code, tc.expected, /* skip_nop = */ false, tc.default_values);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
SetSpecConstantDefaultValueInBitPatternFormTestCase>{
|
||||
@ -937,7 +937,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
},
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
InvalidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest,
|
||||
::testing::ValuesIn(std::vector<
|
||||
SetSpecConstantDefaultValueInBitPatternFormTestCase>{
|
||||
|
@ -89,7 +89,7 @@ TEST_P(StripDebugInfoTest, Kind) {
|
||||
|
||||
// Test each possible non-line debug instruction.
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SingleKindDebugInst, StripDebugInfoTest,
|
||||
::testing::ValuesIn(std::vector<const char*>({
|
||||
"OpSourceContinued \"I'm a happy shader! Yay! ;)\"",
|
||||
|
@ -354,8 +354,14 @@ TEST_P(UnifyFrontEndConstantParamTest, TestCase) {
|
||||
Check(expected_builder, test_builder);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Case, UnifyFrontEndConstantParamTest,
|
||||
::testing::ValuesIn(std::vector<UnifyConstantTestCase>({
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Case, UnifyFrontEndConstantParamTest,
|
||||
::
|
||||
testing::
|
||||
ValuesIn(
|
||||
std::
|
||||
vector<UnifyConstantTestCase>(
|
||||
{
|
||||
// clang-format off
|
||||
// basic tests for scalar constants
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ TEST_P(FindAndReplaceTest, SubstringReplacement) {
|
||||
<< " expected string: " << GetParam().expected_str;
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SubstringReplacement, FindAndReplaceTest,
|
||||
::testing::ValuesIn(std::vector<SubstringReplacementTestCase>({
|
||||
// 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));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllTargetEnvs, TargetEnvTest,
|
||||
ValuesIn(spvtest::AllTargetEnvironments()));
|
||||
INSTANTIATE_TEST_SUITE_P(AllTargetEnvs, TargetEnvTest,
|
||||
ValuesIn(spvtest::AllTargetEnvironments()));
|
||||
|
||||
TEST(GetContextTest, InvalidTargetEnvProducesNull) {
|
||||
// Use a value beyond the last valid enum value.
|
||||
@ -70,7 +70,7 @@ TEST_P(TargetParseTest, InvalidTargetEnvProducesNull) {
|
||||
EXPECT_THAT(env, Eq(GetParam().env));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TargetParsing, TargetParseTest,
|
||||
ValuesIn(std::vector<ParseCase>{
|
||||
{"spv1.0", true, SPV_ENV_UNIVERSAL_1_0},
|
||||
|
@ -106,7 +106,7 @@ TEST_P(GoodStringTest, GoodStrings) {
|
||||
EXPECT_EQ(std::get<1>(GetParam()), l.str);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextLiteral, GoodStringTest,
|
||||
::testing::ValuesIn(std::vector<std::pair<const char*, const char*>>{
|
||||
{R"("-")", "-"},
|
||||
@ -121,7 +121,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"\"\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"}}));
|
||||
|
||||
TEST(TextLiteral, StringTooLong) {
|
||||
spv_literal_t l;
|
||||
@ -230,7 +230,7 @@ TextLiteralCase Make_Bad_Unsigned(uint32_t bitwidth, const char* text) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DecimalIntegers, IntegerTest,
|
||||
::testing::ValuesIn(std::vector<TextLiteralCase>{
|
||||
// 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__Signed(64, "-9223372036854775808", {0x00000000, 0x80000000}),
|
||||
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
using IntegerLeadingMinusTest =
|
||||
@ -290,7 +290,7 @@ TEST_P(IntegerLeadingMinusTest, CantHaveLeadingMinusOnUnsigned) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DecimalAndHexIntegers, IntegerLeadingMinusTest,
|
||||
::testing::ValuesIn(std::vector<TextLiteralCase>{
|
||||
// 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, "-0x0"),
|
||||
Make_Bad_Unsigned(64, "-0x1"),
|
||||
}),);
|
||||
}));
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
HexIntegers, IntegerTest,
|
||||
::testing::ValuesIn(std::vector<TextLiteralCase>{
|
||||
// Check 0x and 0X prefices.
|
||||
@ -370,7 +370,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
Make_Ok__Signed(64, "0x8000000000000000", {0x00000000, 0x80000000}),
|
||||
Make_Ok__Unsigned(64, "0x7fffffffffffffff", {0xffffffff, 0x7fffffff}),
|
||||
Make_Ok__Unsigned(64, "0x8000000000000000", {0x00000000, 0x80000000}),
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
TEST(OverflowIntegerParse, Decimal) {
|
||||
|
@ -61,7 +61,7 @@ TEST_P(OpDecorateSimpleTest, AnySimpleDecoration) {
|
||||
}
|
||||
|
||||
#define CASE(NAME) SpvDecoration##NAME, #NAME
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryDecorateSimple, OpDecorateSimpleTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCase<SpvDecoration>>{
|
||||
@ -106,12 +106,12 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{CASE(NoContraction), {}},
|
||||
{CASE(InputAttachmentIndex), {102}},
|
||||
{CASE(Alignment), {16}},
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateSimpleV11, OpDecorateSimpleTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||
Values(EnumCase<SpvDecoration>{
|
||||
CASE(MaxByteOffset), {128}})), );
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateSimpleV11, OpDecorateSimpleTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||
Values(EnumCase<SpvDecoration>{
|
||||
CASE(MaxByteOffset), {128}})));
|
||||
#undef CASE
|
||||
|
||||
TEST_F(OpDecorateSimpleTest, WrongDecoration) {
|
||||
@ -164,7 +164,7 @@ TEST_P(OpDecorateEnumTest, AnyEnumDecoration) {
|
||||
// clang-format off
|
||||
#define CASE(NAME) \
|
||||
{ SpvBuiltIn##NAME, #NAME, SpvDecorationBuiltIn, "BuiltIn" }
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest,
|
||||
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
||||
CASE(Position),
|
||||
CASE(PointSize),
|
||||
@ -209,7 +209,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest,
|
||||
CASE(SubgroupLocalInvocationId),
|
||||
CASE(VertexIndex),
|
||||
CASE(InstanceIndex),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -222,7 +222,7 @@ TEST_F(OpDecorateEnumTest, WrongBuiltIn) {
|
||||
// clang-format off
|
||||
#define CASE(NAME) \
|
||||
{ SpvFunctionParameterAttribute##NAME, #NAME, SpvDecorationFuncParamAttr, "FuncParamAttr" }
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest,
|
||||
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
||||
CASE(Zext),
|
||||
CASE(Sext),
|
||||
@ -232,7 +232,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest,
|
||||
CASE(NoCapture),
|
||||
CASE(NoWrite),
|
||||
CASE(NoReadWrite),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -245,13 +245,13 @@ TEST_F(OpDecorateEnumTest, WrongFuncParamAttr) {
|
||||
// clang-format off
|
||||
#define CASE(NAME) \
|
||||
{ SpvFPRoundingMode##NAME, #NAME, SpvDecorationFPRoundingMode, "FPRoundingMode" }
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPRoundingMode, OpDecorateEnumTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateFPRoundingMode, OpDecorateEnumTest,
|
||||
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
||||
CASE(RTE),
|
||||
CASE(RTZ),
|
||||
CASE(RTP),
|
||||
CASE(RTN),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -268,7 +268,7 @@ TEST_F(OpDecorateEnumTest, WrongFPRoundingMode) {
|
||||
// clang-format off
|
||||
#define CASE(ENUM,NAME) \
|
||||
{ SpvFPFastMathMode##ENUM, #NAME, SpvDecorationFPFastMathMode, "FPFastMathMode" }
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest,
|
||||
::testing::ValuesIn(std::vector<DecorateEnumCase>{
|
||||
CASE(MaskNone, None),
|
||||
CASE(NotNaNMask, NotNaN),
|
||||
@ -276,7 +276,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest,
|
||||
CASE(NSZMask, NSZ),
|
||||
CASE(AllowRecipMask, AllowRecip),
|
||||
CASE(FastMask, Fast),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -329,13 +329,13 @@ TEST_P(OpDecorateLinkageTest, AnyLinkageDecoration) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(ENUM) SpvLinkageType##ENUM, #ENUM
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateLinkage, OpDecorateLinkageTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateLinkage, OpDecorateLinkageTest,
|
||||
::testing::ValuesIn(std::vector<DecorateLinkageCase>{
|
||||
{ CASE(Import), "a" },
|
||||
{ CASE(Export), "foo" },
|
||||
{ CASE(Import), "some kind of long name with spaces etc." },
|
||||
// TODO(dneto): utf-8, escaping, quoting cases.
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -423,7 +423,7 @@ TEST_P(OpMemberDecorateSimpleTest, AnySimpleDecoration) {
|
||||
}
|
||||
|
||||
#define CASE(NAME) SpvDecoration##NAME, #NAME
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryDecorateSimple, OpMemberDecorateSimpleTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCase<SpvDecoration>>{
|
||||
@ -468,12 +468,12 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{CASE(NoContraction), {}},
|
||||
{CASE(InputAttachmentIndex), {102}},
|
||||
{CASE(Alignment), {16}},
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryDecorateSimpleV11, OpMemberDecorateSimpleTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||
Values(EnumCase<SpvDecoration>{CASE(MaxByteOffset), {128}})), );
|
||||
Values(EnumCase<SpvDecoration>{CASE(MaxByteOffset), {128}})));
|
||||
#undef CASE
|
||||
|
||||
TEST_F(OpMemberDecorateSimpleTest, WrongDecoration) {
|
||||
|
@ -47,7 +47,7 @@ TEST_P(SamplerAddressingModeTest, AnySamplerAddressingMode) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(NAME) { SpvSamplerAddressingMode##NAME, #NAME }
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinarySamplerAddressingMode, SamplerAddressingModeTest,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvSamplerAddressingMode>>{
|
||||
CASE(None),
|
||||
@ -55,7 +55,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE(Clamp),
|
||||
CASE(Repeat),
|
||||
CASE(RepeatMirrored),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -79,12 +79,12 @@ TEST_P(SamplerFilterModeTest, AnySamplerFilterMode) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(NAME) { SpvSamplerFilterMode##NAME, #NAME}
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinarySamplerFilterMode, SamplerFilterModeTest,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvSamplerFilterMode>>{
|
||||
CASE(Nearest),
|
||||
CASE(Linear),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -114,7 +114,7 @@ TEST_P(OpConstantValidTest, ValidTypes) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryOpConstantValid, OpConstantValidTest,
|
||||
::testing::ValuesIn(std::vector<ConstantTestCase>{
|
||||
// Check 16 bits
|
||||
@ -232,7 +232,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpTypeInt 64 1", "0x7fffffff",
|
||||
Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
|
||||
MakeInstruction(SpvOpConstant, {1, 2, 0x7fffffffu, 0})})},
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
// A test case for checking OpConstant with invalid literals with a leading
|
||||
@ -255,7 +255,7 @@ TEST_P(OpConstantInvalidLeadingMinusTest, InvalidCase) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryOpConstantInvalidLeadingMinus, OpConstantInvalidLeadingMinusTest,
|
||||
::testing::ValuesIn(std::vector<InvalidLeadingMinusCase>{
|
||||
{"OpTypeInt 16 0", "-0"},
|
||||
@ -267,7 +267,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpTypeInt 64 0", "-0"},
|
||||
{"OpTypeInt 64 0", "-0x0"},
|
||||
{"OpTypeInt 64 0", "-1"},
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
// A test case for invalid floating point literals.
|
||||
@ -293,7 +293,7 @@ TEST_P(OpConstantInvalidFloatConstant, Samples) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryInvalidFloatConstant, OpConstantInvalidFloatConstant,
|
||||
::testing::ValuesIn(std::vector<InvalidFloatConstantCase>{
|
||||
{16, "abc"},
|
||||
@ -323,7 +323,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{64, "++1"},
|
||||
{32, "1e400"}, // Overflow is an error for 64-bit floats.
|
||||
{32, "-1e400"},
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
using OpConstantInvalidTypeTest =
|
||||
@ -339,7 +339,7 @@ TEST_P(OpConstantInvalidTypeTest, InvalidTypes) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryOpConstantInvalidValidType, OpConstantInvalidTypeTest,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
{"OpTypeVoid",
|
||||
@ -364,7 +364,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// At least one thing that isn't a type at all
|
||||
"OpNot %a %b"
|
||||
},
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
using OpSpecConstantValidTest =
|
||||
@ -381,7 +381,7 @@ TEST_P(OpSpecConstantValidTest, ValidTypes) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryOpSpecConstantValid, OpSpecConstantValidTest,
|
||||
::testing::ValuesIn(std::vector<ConstantTestCase>{
|
||||
// Check 16 bits
|
||||
@ -433,7 +433,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpTypeInt 64 1", "-42",
|
||||
Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
|
||||
MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})},
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
using OpSpecConstantInvalidTypeTest =
|
||||
@ -449,7 +449,7 @@ TEST_P(OpSpecConstantInvalidTypeTest, InvalidTypes) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryOpSpecConstantInvalidValidType, OpSpecConstantInvalidTypeTest,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
{"OpTypeVoid",
|
||||
@ -474,14 +474,14 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// At least one thing that isn't a type at all
|
||||
"OpNot %a %b"
|
||||
},
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
const int64_t kMaxUnsigned48Bit = (int64_t(1) << 48) - 1;
|
||||
const int64_t kMaxSigned48Bit = (int64_t(1) << 47) - 1;
|
||||
const int64_t kMinSigned48Bit = -kMaxSigned48Bit - 1;
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpConstantRoundTrip, RoundTripTest,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
// 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 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,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"%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.ffcp+16\n", // -nan
|
||||
"%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.004p+16\n", // -nan
|
||||
}), );
|
||||
}));
|
||||
|
||||
// clang-format off
|
||||
// (Clang-format really wants to break up these strings across lines.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpConstantRoundTripNonFinite, RoundTripTest,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"%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.00003p+1024\n", // -nan
|
||||
"%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.fffffffffffffp+1024\n", // -nan
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpSpecConstantRoundTrip, RoundTripTest,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
// 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 1.79767e+308\n",
|
||||
"%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 -1.79767e+308\n",
|
||||
}), );
|
||||
}));
|
||||
|
||||
// Test OpSpecConstantOp
|
||||
|
||||
@ -662,7 +662,7 @@ TEST_P(OpSpecConstantOpTestWithIds, Assembly) {
|
||||
#define CASE4(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6} }
|
||||
#define CASE5(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7} }
|
||||
#define CASE6(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7, 8} }
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryOpSpecConstantOp, OpSpecConstantOpTestWithIds,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
|
||||
// Conversion
|
||||
@ -738,7 +738,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE2(InBoundsPtrAccessChain),
|
||||
CASE3(InBoundsPtrAccessChain),
|
||||
CASE6(InBoundsPtrAccessChain),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE1
|
||||
#undef CASE2
|
||||
#undef CASE3
|
||||
@ -768,7 +768,7 @@ TEST_P(OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers, Assembly) {
|
||||
}
|
||||
|
||||
#define CASE(NAME) SpvOp##NAME, #NAME
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryOpSpecConstantOp,
|
||||
OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
|
||||
@ -783,7 +783,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// composite, and then literal indices.
|
||||
{CASE(CompositeInsert), {0}},
|
||||
{CASE(CompositeInsert), {4, 3, 99, 1}},
|
||||
}), );
|
||||
}));
|
||||
|
||||
using OpSpecConstantOpTestWithOneIdThenLiteralNumbers =
|
||||
spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<SpvOp>>>;
|
||||
@ -806,7 +806,7 @@ TEST_P(OpSpecConstantOpTestWithOneIdThenLiteralNumbers, Assembly) {
|
||||
}
|
||||
|
||||
#define CASE(NAME) SpvOp##NAME, #NAME
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryOpSpecConstantOp,
|
||||
OpSpecConstantOpTestWithOneIdThenLiteralNumbers,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
|
||||
@ -814,7 +814,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// indices. Let's only test a few.
|
||||
{CASE(CompositeExtract), {0}},
|
||||
{CASE(CompositeExtract), {0, 99, 42, 16, 17, 12, 19}},
|
||||
}), );
|
||||
}));
|
||||
|
||||
// TODO(dneto): OpConstantTrue
|
||||
// TODO(dneto): OpConstantFalse
|
||||
|
@ -51,12 +51,12 @@ TEST_P(OpSelectionMergeTest, AnySingleSelectionControlMask) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(VALUE,NAME) { SpvSelectionControl##VALUE, NAME}
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinarySelectionMerge, OpSelectionMergeTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinarySelectionMerge, OpSelectionMergeTest,
|
||||
ValuesIn(std::vector<EnumCase<SpvSelectionControlMask>>{
|
||||
CASE(MaskNone, "None"),
|
||||
CASE(FlattenMask, "Flatten"),
|
||||
CASE(DontFlattenMask, "DontFlatten"),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -95,7 +95,7 @@ TEST_P(OpLoopMergeTest, AnySingleLoopControlMask) {
|
||||
{ \
|
||||
SpvLoopControl##VALUE, NAME, { PARM } \
|
||||
}
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryLoopMerge, OpLoopMergeTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCase<int>>{
|
||||
@ -104,9 +104,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE(UnrollMask, "Unroll"),
|
||||
CASE(DontUnrollMask, "DontUnroll"),
|
||||
// clang-format on
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryLoopMergeV11, OpLoopMergeTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCase<int>>{
|
||||
@ -116,7 +116,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{SpvLoopControlUnrollMask|SpvLoopControlDependencyLengthMask,
|
||||
"DependencyLength|Unroll", {33}},
|
||||
// clang-format on
|
||||
})), );
|
||||
})));
|
||||
#undef CASE
|
||||
#undef CASE1
|
||||
|
||||
@ -251,7 +251,7 @@ SwitchTestCase MakeSwitchTestCase(uint32_t integer_width,
|
||||
Concatenate({{2, 3}, encoded_case_value, {4}}))})}};
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryOpSwitchValid1Word, OpSwitchValidTest,
|
||||
ValuesIn(std::vector<SwitchTestCase>({
|
||||
MakeSwitchTestCase(32, 0, "42", {42}, "100", {100}),
|
||||
@ -270,10 +270,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
MakeSwitchTestCase(16, 1, "0x8000", {0xffff8000}, "0x8100",
|
||||
{0xffff8100}),
|
||||
MakeSwitchTestCase(16, 0, "0x8000", {0x00008000}, "0x8100", {0x8100}),
|
||||
})), );
|
||||
})));
|
||||
|
||||
// NB: The words LOW ORDER bits show up first.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryOpSwitchValid2Words, OpSwitchValidTest,
|
||||
ValuesIn(std::vector<SwitchTestCase>({
|
||||
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(64, 0, "0x600000000", {0, 6}, "12", {12, 0}),
|
||||
MakeSwitchTestCase(64, 1, "0x700000123", {0x123, 7}, "12", {12, 0}),
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpSwitchRoundTripUnsignedIntegers, RoundTripTest,
|
||||
ValuesIn(std::vector<std::string>({
|
||||
// Unsigned 16-bit.
|
||||
@ -307,9 +307,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// Unsigned 64-bit, three non-default cases.
|
||||
"%1 = OpTypeInt 64 0\n%2 = OpConstant %1 9223372036854775807\n"
|
||||
"OpSwitch %2 %3 100 %4 102 %5 9000000000000000000 %6\n",
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
OpSwitchRoundTripSignedIntegers, RoundTripTest,
|
||||
ValuesIn(std::vector<std::string>{
|
||||
// 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",
|
||||
"%1 = OpTypeInt 64 1\n%2 = OpConstant %1 -9223372036854775808\n"
|
||||
"OpSwitch %2 %3 100 %4 7000000000 %5 -1000000000000000000 %6\n",
|
||||
}), );
|
||||
}));
|
||||
|
||||
using OpSwitchInvalidTypeTestCase =
|
||||
spvtest::TextToBinaryTestBase<TestWithParam<std::string>>;
|
||||
@ -349,7 +349,7 @@ TEST_P(OpSwitchInvalidTypeTestCase, InvalidTypes) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryOpSwitchInvalidTests, OpSwitchInvalidTypeTestCase,
|
||||
ValuesIn(std::vector<std::string>{
|
||||
{"OpTypeVoid",
|
||||
@ -375,7 +375,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// At least one thing that isn't a type at all
|
||||
"OpNot %a %b"
|
||||
},
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
|
||||
// TODO(dneto): OpPhi
|
||||
|
@ -73,8 +73,8 @@ TEST_P(OpSourceTest, AnyLanguage) {
|
||||
GetParam().version})));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceTest,
|
||||
::testing::ValuesIn(kLanguageCases), );
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpSourceTest,
|
||||
::testing::ValuesIn(kLanguageCases));
|
||||
|
||||
TEST_F(OpSourceTest, WrongLanguage) {
|
||||
EXPECT_THAT(CompileFailure("OpSource xxyyzz 12345"),
|
||||
@ -113,9 +113,9 @@ TEST_P(OpSourceContinuedTest, AnyExtension) {
|
||||
}
|
||||
|
||||
// TODO(dneto): utf-8, quoting, escaping
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceContinuedTest,
|
||||
::testing::ValuesIn(std::vector<const char*>{
|
||||
"", "foo bar this and that"}), );
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpSourceContinuedTest,
|
||||
::testing::ValuesIn(std::vector<const char*>{
|
||||
"", "foo bar this and that"}));
|
||||
|
||||
// Test OpSourceExtension
|
||||
|
||||
@ -132,9 +132,9 @@ TEST_P(OpSourceExtensionTest, AnyExtension) {
|
||||
}
|
||||
|
||||
// TODO(dneto): utf-8, quoting, escaping
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceExtensionTest,
|
||||
::testing::ValuesIn(std::vector<const char*>{
|
||||
"", "foo bar this and that"}), );
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpSourceExtensionTest,
|
||||
::testing::ValuesIn(std::vector<const char*>{
|
||||
"", "foo bar this and that"}));
|
||||
|
||||
TEST_F(TextToBinaryTest, OpLine) {
|
||||
EXPECT_THAT(CompiledInstructions("OpLine %srcfile 42 99"),
|
||||
@ -158,9 +158,9 @@ TEST_P(OpStringTest, AnyString) {
|
||||
}
|
||||
|
||||
// TODO(dneto): utf-8, quoting, escaping
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpStringTest,
|
||||
::testing::ValuesIn(std::vector<const char*>{
|
||||
"", "foo bar this and that"}), );
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpStringTest,
|
||||
::testing::ValuesIn(std::vector<const char*>{
|
||||
"", "foo bar this and that"}));
|
||||
|
||||
using OpNameTest =
|
||||
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
|
||||
// BinaryToText.Literal.cpp.
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpNameTest,
|
||||
::testing::Values("", "foo bar this and that"), );
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpNameTest,
|
||||
::testing::Values("", "foo bar this and that"));
|
||||
|
||||
using OpMemberNameTest =
|
||||
spvtest::TextToBinaryTestBase<::testing::TestWithParam<const char*>>;
|
||||
@ -190,9 +190,9 @@ TEST_P(OpMemberNameTest, AnyString) {
|
||||
}
|
||||
|
||||
// TODO(dneto): utf-8, quoting, escaping
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpMemberNameTest,
|
||||
::testing::ValuesIn(std::vector<const char*>{
|
||||
"", "foo bar this and that"}), );
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpMemberNameTest,
|
||||
::testing::ValuesIn(std::vector<const char*>{
|
||||
"", "foo bar this and that"}));
|
||||
|
||||
// TODO(dneto): Parse failures?
|
||||
|
||||
@ -207,8 +207,8 @@ TEST_P(OpModuleProcessedTest, AnyString) {
|
||||
Eq(MakeInstruction(SpvOpModuleProcessed, MakeVector(GetParam()))));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpModuleProcessedTest,
|
||||
::testing::Values("", "foo bar this and that"), );
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpModuleProcessedTest,
|
||||
::testing::Values("", "foo bar this and that"));
|
||||
|
||||
} // namespace
|
||||
} // namespace spvtools
|
||||
|
@ -49,7 +49,7 @@ TEST_P(OpEnqueueKernelGood, Sample) {
|
||||
GetParam().local_size_operands)));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryTest, OpEnqueueKernelGood,
|
||||
::testing::ValuesIn(std::vector<KernelEnqueueCase>{
|
||||
// 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}},
|
||||
{"%l0 %l1 %l2 %l3 %l4 %l5 %l6 %l7 %l8 %l9",
|
||||
{13, 14, 15, 16, 17, 18, 19, 20, 21, 22}},
|
||||
}), );
|
||||
}));
|
||||
|
||||
// Test some bad parses of OpEnqueueKernel. For other cases, we're relying
|
||||
// on the uniformity of the parsing algorithm. The following two tests, ensure
|
||||
|
@ -135,7 +135,7 @@ TEST_P(ExtensionRoundTripTest, Samples) {
|
||||
|
||||
// SPV_KHR_shader_ballot
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_KHR_shader_ballot, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -164,9 +164,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpDecorate %1 BuiltIn SubgroupLtMask\n",
|
||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||
SpvBuiltInSubgroupLtMaskKHR})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
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
|
||||
// builtin enums.
|
||||
@ -194,11 +194,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpDecorate %1 BuiltIn SubgroupLtMask\n",
|
||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||
SpvBuiltInSubgroupLtMask})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// The old builtin names (with KHR suffix) still work in the assmebler, and
|
||||
// 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,
|
||||
// In SPIR-V 1.3 and Vulkan 1.1 we can drop the KHR suffix on the
|
||||
// builtin enums.
|
||||
@ -219,11 +219,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpDecorate %1 BuiltIn SubgroupLtMaskKHR\n",
|
||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||
SpvBuiltInSubgroupLtMask})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_KHR_shader_draw_parameters
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_KHR_shader_draw_parameters, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -241,11 +241,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpDecorate %1 BuiltIn DrawIndex\n",
|
||||
MakeInstruction(SpvOpDecorate,
|
||||
{1, SpvDecorationBuiltIn, SpvBuiltInDrawIndex})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_KHR_subgroup_vote
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_KHR_subgroup_vote, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -260,11 +260,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
MakeInstruction(SpvOpSubgroupAllKHR, {1, 2, 3})},
|
||||
{"%2 = OpSubgroupAllEqualKHR %1 %3\n",
|
||||
MakeInstruction(SpvOpSubgroupAllEqualKHR, {1, 2, 3})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_KHR_16bit_storage
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_KHR_16bit_storage, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -289,9 +289,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpCapability StorageInputOutput16\n",
|
||||
MakeInstruction(SpvOpCapability,
|
||||
{SpvCapabilityStorageInputOutput16})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_KHR_16bit_storage_alias_check, ExtensionAssemblyTest,
|
||||
Combine(ValuesIn(CommonVulkanEnvs()),
|
||||
ValuesIn(std::vector<AssemblyCase>{
|
||||
@ -303,11 +303,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpCapability UniformAndStorageBuffer16BitAccess\n",
|
||||
MakeInstruction(SpvOpCapability,
|
||||
{SpvCapabilityStorageUniform16})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_KHR_device_group
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_KHR_device_group, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -318,11 +318,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpDecorate %1 BuiltIn DeviceIndex\n",
|
||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||
SpvBuiltInDeviceIndex})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_KHR_8bit_storage
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_KHR_8bit_storage, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -338,11 +338,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpCapability StoragePushConstant8\n",
|
||||
MakeInstruction(SpvOpCapability,
|
||||
{SpvCapabilityStoragePushConstant8})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_KHR_multiview
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_KHR_multiview, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -354,13 +354,13 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpDecorate %1 BuiltIn ViewIndex\n",
|
||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||
SpvBuiltInViewIndex})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_AMD_shader_explicit_vertex_parameter
|
||||
|
||||
#define PREAMBLE \
|
||||
"%1 = OpExtInstImport \"SPV_AMD_shader_explicit_vertex_parameter\"\n"
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_AMD_shader_explicit_vertex_parameter, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -374,13 +374,13 @@ INSTANTIATE_TEST_CASE_P(
|
||||
SpvOpExtInstImport, {1},
|
||||
MakeVector("SPV_AMD_shader_explicit_vertex_parameter")),
|
||||
MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5})})},
|
||||
})), );
|
||||
})));
|
||||
#undef PREAMBLE
|
||||
|
||||
// SPV_AMD_shader_trinary_minmax
|
||||
|
||||
#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_trinary_minmax\"\n"
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_AMD_shader_trinary_minmax, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -433,13 +433,13 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{MakeInstruction(SpvOpExtInstImport, {1},
|
||||
MakeVector("SPV_AMD_shader_trinary_minmax")),
|
||||
MakeInstruction(SpvOpExtInst, {2, 3, 1, 9, 4, 5, 6})})},
|
||||
})), );
|
||||
})));
|
||||
#undef PREAMBLE
|
||||
|
||||
// SPV_AMD_gcn_shader
|
||||
|
||||
#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_gcn_shader\"\n"
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_AMD_gcn_shader, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -458,13 +458,13 @@ INSTANTIATE_TEST_CASE_P(
|
||||
Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
|
||||
MakeVector("SPV_AMD_gcn_shader")),
|
||||
MakeInstruction(SpvOpExtInst, {2, 3, 1, 3})})},
|
||||
})), );
|
||||
})));
|
||||
#undef PREAMBLE
|
||||
|
||||
// SPV_AMD_shader_ballot
|
||||
|
||||
#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_ballot\"\n"
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_AMD_shader_ballot, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -490,12 +490,12 @@ INSTANTIATE_TEST_CASE_P(
|
||||
Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
|
||||
MakeVector("SPV_AMD_shader_ballot")),
|
||||
MakeInstruction(SpvOpExtInst, {2, 3, 1, 4, 4})})},
|
||||
})), );
|
||||
})));
|
||||
#undef PREAMBLE
|
||||
|
||||
// SPV_KHR_variable_pointers
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_KHR_variable_pointers, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// environments, and at least one specific environment.
|
||||
@ -508,11 +508,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpCapability VariablePointersStorageBuffer\n",
|
||||
MakeInstruction(SpvOpCapability,
|
||||
{SpvCapabilityVariablePointersStorageBuffer})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_KHR_vulkan_memory_model
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_KHR_vulkan_memory_model, ExtensionRoundTripTest,
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
// 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
|
||||
// them, and so no assembler or disassembler support required.
|
||||
// Similar for Scope ID.
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_GOOGLE_decorate_string
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_GOOGLE_decorate_string, ExtensionRoundTripTest,
|
||||
Combine(
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
@ -672,11 +672,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
MakeInstruction(SpvOpMemberDecorateStringGOOGLE,
|
||||
{1, 3, SpvDecorationHlslSemanticGOOGLE},
|
||||
MakeVector("DEF"))},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_GOOGLE_hlsl_functionality1
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_GOOGLE_hlsl_functionality1, ExtensionRoundTripTest,
|
||||
Combine(
|
||||
// We'll get coverage over operand tables by trying the universal
|
||||
@ -689,11 +689,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpDecorateId %1 HlslCounterBufferGOOGLE %2\n",
|
||||
MakeInstruction(SpvOpDecorateId,
|
||||
{1, SpvDecorationHlslCounterBufferGOOGLE, 2})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_NV_viewport_array2
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_NV_viewport_array2, ExtensionRoundTripTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3,
|
||||
@ -717,11 +717,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"OpDecorate %1 BuiltIn ViewportMaskNV\n",
|
||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
|
||||
SpvBuiltInViewportMaskNV})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_NV_shader_subgroup_partitioned
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_NV_shader_subgroup_partitioned, ExtensionRoundTripTest,
|
||||
Combine(
|
||||
Values(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1),
|
||||
@ -759,11 +759,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
SpvGroupOperationPartitionedExclusiveScanNV, 4})},
|
||||
{"%2 = OpGroupIAdd %1 %3 PartitionedExclusiveScanNV %4\n",
|
||||
MakeInstruction(SpvOpGroupIAdd, {1, 2, 3, 8, 4})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
// SPV_EXT_descriptor_indexing
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SPV_EXT_descriptor_indexing, ExtensionRoundTripTest,
|
||||
Combine(
|
||||
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
||||
@ -851,7 +851,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
MakeInstruction(SpvOpDecorate, {1, SpvDecorationNonUniformEXT})},
|
||||
{"OpDecorate %1 NonUniformEXT\n",
|
||||
MakeInstruction(SpvOpDecorate, {1, 5300})},
|
||||
})), );
|
||||
})));
|
||||
|
||||
} // namespace
|
||||
} // namespace spvtools
|
||||
|
@ -45,14 +45,14 @@ TEST_P(OpFunctionControlTest, AnySingleFunctionControlMask) {
|
||||
|
||||
// clang-format off
|
||||
#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>>{
|
||||
CASE(MaskNone, "None"),
|
||||
CASE(InlineMask, "Inline"),
|
||||
CASE(DontInlineMask, "DontInline"),
|
||||
CASE(PureMask, "Pure"),
|
||||
CASE(ConstMask, "Const"),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
|
@ -44,12 +44,12 @@ TEST_P(GroupOperationTest, AnyGroupOperation) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(NAME) { SpvGroupOperation##NAME, #NAME}
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryGroupOperation, GroupOperationTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryGroupOperation, GroupOperationTest,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvGroupOperation>>{
|
||||
CASE(Reduce),
|
||||
CASE(InclusiveScan),
|
||||
CASE(ExclusiveScan),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
|
@ -50,7 +50,7 @@ TEST_P(ImageOperandsTest, Sample) {
|
||||
}
|
||||
|
||||
#define MASK(NAME) SpvImageOperands##NAME##Mask
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryImageOperandsAny, ImageOperandsTest,
|
||||
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
||||
// TODO(dneto): Rev32 adds many more values, and rearranges their
|
||||
@ -66,10 +66,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{" ConstOffsets %5", {MASK(ConstOffsets), 5}},
|
||||
{" Sample %5", {MASK(Sample), 5}},
|
||||
{" MinLod %5", {MASK(MinLod), 5}},
|
||||
}), );
|
||||
}));
|
||||
#undef MASK
|
||||
#define MASK(NAME) static_cast<uint32_t>(SpvImageOperands##NAME##Mask)
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryImageOperandsCombination, ImageOperandsTest,
|
||||
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
||||
// 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",
|
||||
{MASK(Bias) | MASK(Lod) | MASK(Grad) | MASK(ConstOffset) |
|
||||
MASK(Offset) | MASK(ConstOffsets) | MASK(Sample),
|
||||
5, 6, 7, 8, 9, 10, 11, 12}}}), );
|
||||
5, 6, 7, 8, 9, 10, 11, 12}}}));
|
||||
#undef MASK
|
||||
|
||||
TEST_F(ImageOperandsTest, WrongOperand) {
|
||||
@ -173,24 +173,24 @@ TEST_P(ImageSparseReadImageOperandsTest, Sample) {
|
||||
}
|
||||
|
||||
#define MASK(NAME) SpvImageOperands##NAME##Mask
|
||||
INSTANTIATE_TEST_CASE_P(ImageSparseReadImageOperandsAny,
|
||||
ImageSparseReadImageOperandsTest,
|
||||
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
||||
// Image operands are optional.
|
||||
{"", {}},
|
||||
// Test each kind, alone.
|
||||
{" Bias %5", {MASK(Bias), 5}},
|
||||
{" Lod %5", {MASK(Lod), 5}},
|
||||
{" Grad %5 %6", {MASK(Grad), 5, 6}},
|
||||
{" ConstOffset %5", {MASK(ConstOffset), 5}},
|
||||
{" Offset %5", {MASK(Offset), 5}},
|
||||
{" ConstOffsets %5", {MASK(ConstOffsets), 5}},
|
||||
{" Sample %5", {MASK(Sample), 5}},
|
||||
{" MinLod %5", {MASK(MinLod), 5}},
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(ImageSparseReadImageOperandsAny,
|
||||
ImageSparseReadImageOperandsTest,
|
||||
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
||||
// Image operands are optional.
|
||||
{"", {}},
|
||||
// Test each kind, alone.
|
||||
{" Bias %5", {MASK(Bias), 5}},
|
||||
{" Lod %5", {MASK(Lod), 5}},
|
||||
{" Grad %5 %6", {MASK(Grad), 5, 6}},
|
||||
{" ConstOffset %5", {MASK(ConstOffset), 5}},
|
||||
{" Offset %5", {MASK(Offset), 5}},
|
||||
{" ConstOffsets %5", {MASK(ConstOffsets), 5}},
|
||||
{" Sample %5", {MASK(Sample), 5}},
|
||||
{" MinLod %5", {MASK(MinLod), 5}},
|
||||
}));
|
||||
#undef MASK
|
||||
#define MASK(NAME) static_cast<uint32_t>(SpvImageOperands##NAME##Mask)
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ImageSparseReadImageOperandsCombination, ImageSparseReadImageOperandsTest,
|
||||
::testing::ValuesIn(std::vector<ImageOperandsCase>{
|
||||
// values.
|
||||
@ -212,7 +212,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
5, 6, 7, 8, 9, 10, 11, 12}},
|
||||
// Don't try the masks reversed, since this is a round trip test,
|
||||
// and the disassembler will sort them.
|
||||
}), );
|
||||
}));
|
||||
#undef MASK
|
||||
|
||||
TEST_F(OpImageSparseReadTest, InvalidTypeOperand) {
|
||||
|
@ -45,14 +45,14 @@ TEST_P(MemoryAccessTest, AnySingleMemoryAccessMask) {
|
||||
GetParam().operands())));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryMemoryAccessTest, MemoryAccessTest,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvMemoryAccessMask>>{
|
||||
{SpvMemoryAccessMaskNone, "None", {}},
|
||||
{SpvMemoryAccessVolatileMask, "Volatile", {}},
|
||||
{SpvMemoryAccessAlignedMask, "Aligned", {16}},
|
||||
{SpvMemoryAccessNontemporalMask, "Nontemporal", {}},
|
||||
}), );
|
||||
}));
|
||||
|
||||
TEST_F(TextToBinaryTest, CombinedMemoryAccessMask) {
|
||||
const std::string input = "OpStore %ptr %value Volatile|Aligned 16";
|
||||
@ -76,7 +76,7 @@ TEST_P(StorageClassTest, AnyStorageClass) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(NAME) { SpvStorageClass##NAME, #NAME, {} }
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryStorageClassTest, StorageClassTest,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvStorageClass>>{
|
||||
CASE(UniformConstant),
|
||||
@ -91,7 +91,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE(PushConstant),
|
||||
CASE(AtomicCounter),
|
||||
CASE(Image),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
|
@ -69,7 +69,7 @@ TEST_P(OpMemoryModelTest, AnyMemoryModelCase) {
|
||||
#MEMORY \
|
||||
}
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryMemoryModel, OpMemoryModelTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryMemoryModel, OpMemoryModelTest,
|
||||
ValuesIn(std::vector<MemoryModelCase>{
|
||||
// These cases exercise each addressing model, and
|
||||
// each memory model, but not necessarily in
|
||||
@ -78,7 +78,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryMemoryModel, OpMemoryModelTest,
|
||||
CASE(Logical,GLSL450),
|
||||
CASE(Physical32,OpenCL),
|
||||
CASE(Physical64,OpenCL),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -116,7 +116,7 @@ TEST_P(OpEntryPointTest, AnyEntryPointCase) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(NAME) SpvExecutionModel##NAME, #NAME
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryEntryPoint, OpEntryPointTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryEntryPoint, OpEntryPointTest,
|
||||
ValuesIn(std::vector<EntryPointCase>{
|
||||
{ CASE(Vertex), "" },
|
||||
{ CASE(TessellationControl), "my tess" },
|
||||
@ -125,7 +125,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryEntryPoint, OpEntryPointTest,
|
||||
{ CASE(Fragment), "FAT32" },
|
||||
{ CASE(GLCompute), "cubic" },
|
||||
{ CASE(Kernel), "Sanders" },
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -151,7 +151,7 @@ TEST_P(OpExecutionModeTest, AnyExecutionMode) {
|
||||
}
|
||||
|
||||
#define CASE(NAME) SpvExecutionMode##NAME, #NAME
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryExecutionMode, OpExecutionModeTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCase<SpvExecutionMode>>{
|
||||
@ -188,16 +188,16 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{CASE(OutputTriangleStrip), {}},
|
||||
{CASE(VecTypeHint), {96}},
|
||||
{CASE(ContractionOff), {}},
|
||||
})), );
|
||||
})));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryExecutionModeV11, OpExecutionModeTest,
|
||||
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
||||
ValuesIn(std::vector<EnumCase<SpvExecutionMode>>{
|
||||
{CASE(Initializer)},
|
||||
{CASE(Finalizer)},
|
||||
{CASE(SubgroupSize), {12}},
|
||||
{CASE(SubgroupsPerWorkgroup), {64}}})), );
|
||||
{CASE(SubgroupsPerWorkgroup), {64}}})));
|
||||
#undef CASE
|
||||
|
||||
TEST_F(OpExecutionModeTest, WrongMode) {
|
||||
@ -224,7 +224,7 @@ TEST_P(OpCapabilityTest, AnyCapability) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(NAME) { SpvCapability##NAME, #NAME }
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryCapability, OpCapabilityTest,
|
||||
INSTANTIATE_TEST_SUITE_P(TextToBinaryCapability, OpCapabilityTest,
|
||||
ValuesIn(std::vector<EnumCase<SpvCapability>>{
|
||||
CASE(Matrix),
|
||||
CASE(Shader),
|
||||
@ -280,7 +280,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryCapability, OpCapabilityTest,
|
||||
CASE(DerivativeControl),
|
||||
CASE(InterpolationFunction),
|
||||
CASE(TransformFeedback),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
|
@ -48,7 +48,7 @@ TEST_P(DimTest, AnyDim) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(NAME) {SpvDim##NAME, #NAME}
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryDim, DimTest,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvDim>>{
|
||||
CASE(1D),
|
||||
@ -58,7 +58,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE(Rect),
|
||||
CASE(Buffer),
|
||||
CASE(SubpassData),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -84,7 +84,7 @@ TEST_P(ImageFormatTest, AnyImageFormatAndNoAccessQualifier) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(NAME) {SpvImageFormat##NAME, #NAME}
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryImageFormat, ImageFormatTest,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvImageFormat>>{
|
||||
CASE(Unknown),
|
||||
@ -127,7 +127,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
CASE(Rg8ui),
|
||||
CASE(R16ui),
|
||||
CASE(R8ui),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
@ -153,13 +153,13 @@ TEST_P(ImageAccessQualifierTest, AnyAccessQualifier) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(NAME) {SpvAccessQualifier##NAME, #NAME}
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
AccessQualifier, ImageAccessQualifierTest,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvAccessQualifier>>{
|
||||
CASE(ReadOnly),
|
||||
CASE(WriteOnly),
|
||||
CASE(ReadWrite),
|
||||
}),);
|
||||
}));
|
||||
// clang-format on
|
||||
#undef CASE
|
||||
|
||||
@ -178,13 +178,13 @@ TEST_P(OpTypePipeTest, AnyAccessQualifier) {
|
||||
|
||||
// clang-format off
|
||||
#define CASE(NAME) {SpvAccessQualifier##NAME, #NAME}
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TextToBinaryTypePipe, OpTypePipeTest,
|
||||
::testing::ValuesIn(std::vector<EnumCase<SpvAccessQualifier>>{
|
||||
CASE(ReadOnly),
|
||||
CASE(WriteOnly),
|
||||
CASE(ReadWrite),
|
||||
}),);
|
||||
}));
|
||||
#undef CASE
|
||||
// clang-format on
|
||||
|
||||
|
@ -58,7 +58,7 @@ TEST_P(GoodMaskParseTest, GoodMaskExpressions) {
|
||||
spvContextDestroy(context);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ParseMask, GoodMaskParseTest,
|
||||
::testing::ValuesIn(std::vector<MaskCase>{
|
||||
{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, 8, "Const"},
|
||||
{SPV_OPERAND_TYPE_FUNCTION_CONTROL, 0xd, "Inline|Const|Pure"},
|
||||
}), );
|
||||
}));
|
||||
|
||||
using BadFPFastMathMaskParseTest = ::testing::TestWithParam<const char*>;
|
||||
|
||||
@ -102,12 +102,12 @@ TEST_P(BadFPFastMathMaskParseTest, BadMaskExpressions) {
|
||||
spvContextDestroy(context);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ParseMask, BadFPFastMathMaskParseTest,
|
||||
::testing::ValuesIn(std::vector<const char*>{
|
||||
nullptr, "", "NotValidEnum", "|", "NotInf|",
|
||||
"|NotInf", "NotInf||NotNaN",
|
||||
"Unroll" // A good word, but for the wrong enum
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(ParseMask, BadFPFastMathMaskParseTest,
|
||||
::testing::ValuesIn(std::vector<const char*>{
|
||||
nullptr, "", "NotValidEnum", "|", "NotInf|",
|
||||
"|NotInf", "NotInf||NotNaN",
|
||||
"Unroll" // A good word, but for the wrong enum
|
||||
}));
|
||||
|
||||
TEST_F(TextToBinaryTest, InvalidText) {
|
||||
ASSERT_EQ(SPV_ERROR_INVALID_TEXT,
|
||||
@ -197,7 +197,7 @@ TEST_P(TextToBinaryFloatValueTest, Samples) {
|
||||
{1, 2, GetParam().second})})));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
FloatValues, TextToBinaryFloatValueTest,
|
||||
::testing::ValuesIn(std::vector<std::pair<std::string, uint32_t>>{
|
||||
{"0.0", 0x00000000}, // +0
|
||||
@ -213,7 +213,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"-2.5", 0xc0200000},
|
||||
{"!0xff800000", 0xff800000}, // -inf
|
||||
{"!0xff800001", 0xff800001}, // NaN
|
||||
}), );
|
||||
}));
|
||||
|
||||
using TextToBinaryHalfValueTest = spvtest::TextToBinaryTestBase<
|
||||
::testing::TestWithParam<std::pair<std::string, uint32_t>>>;
|
||||
@ -227,7 +227,7 @@ TEST_P(TextToBinaryHalfValueTest, Samples) {
|
||||
{1, 2, GetParam().second})})));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
HalfValues, TextToBinaryHalfValueTest,
|
||||
::testing::ValuesIn(std::vector<std::pair<std::string, uint32_t>>{
|
||||
{"0.0", 0x00000000},
|
||||
@ -245,7 +245,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"0x1.8p4", 0x00004e00},
|
||||
{"0x1.801p4", 0x00004e00},
|
||||
{"0x1.804p4", 0x00004e01},
|
||||
}), );
|
||||
}));
|
||||
|
||||
TEST(CreateContext, InvalidEnvironment) {
|
||||
spv_target_env env;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -611,7 +611,7 @@ const char kVoidFVoid2[] = \
|
||||
" OpReturn"
|
||||
" OpFunctionEnd ";
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ExecutionModel, ValidateCapability,
|
||||
INSTANTIATE_TEST_SUITE_P(ExecutionModel, ValidateCapability,
|
||||
Combine(
|
||||
ValuesIn(AllCapabilities()),
|
||||
Values(
|
||||
@ -639,9 +639,9 @@ std::make_pair(std::string(kOpenCLMemoryModel) +
|
||||
std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||
" OpEntryPoint Kernel %func \"shader\"" +
|
||||
std::string(kVoidFVoid), KernelDependencies())
|
||||
)),);
|
||||
)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AddressingAndMemoryModel, ValidateCapability,
|
||||
INSTANTIATE_TEST_SUITE_P(AddressingAndMemoryModel, ValidateCapability,
|
||||
Combine(
|
||||
ValuesIn(AllCapabilities()),
|
||||
Values(
|
||||
@ -681,9 +681,9 @@ std::make_pair(" OpCapability Kernel"
|
||||
" OpMemoryModel Physical64 OpenCL"
|
||||
" OpEntryPoint Kernel %func \"compute\"" +
|
||||
std::string(kVoidFVoid), AddressesDependencies())
|
||||
)),);
|
||||
)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ExecutionMode, ValidateCapability,
|
||||
INSTANTIATE_TEST_SUITE_P(ExecutionMode, ValidateCapability,
|
||||
Combine(
|
||||
ValuesIn(AllCapabilities()),
|
||||
Values(
|
||||
@ -836,11 +836,11 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||
std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||
"OpEntryPoint Kernel %func \"shader\" "
|
||||
"OpExecutionMode %func ContractionOff" +
|
||||
std::string(kVoidFVoid), KernelDependencies()))),);
|
||||
std::string(kVoidFVoid), KernelDependencies()))));
|
||||
|
||||
// clang-format on
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ExecutionModeV11, ValidateCapabilityV11,
|
||||
Combine(ValuesIn(AllCapabilities()),
|
||||
Values(std::make_pair(std::string(kOpenCLMemoryModel) +
|
||||
@ -853,10 +853,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"OpEntryPoint Kernel %func \"shader\" "
|
||||
"OpExecutionMode %func SubgroupsPerWorkgroup 65535" +
|
||||
std::string(kVoidFVoid),
|
||||
std::vector<std::string>{"SubgroupDispatch"}))), );
|
||||
std::vector<std::string>{"SubgroupDispatch"}))));
|
||||
// clang-format off
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(StorageClass, ValidateCapability,
|
||||
INSTANTIATE_TEST_SUITE_P(StorageClass, ValidateCapability,
|
||||
Combine(
|
||||
ValuesIn(AllCapabilities()),
|
||||
Values(
|
||||
@ -920,9 +920,9 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||
" %ptrt = OpTypePointer Image %intt\n"
|
||||
" %var = OpVariable %ptrt Image\n" + std::string(kVoidFVoid),
|
||||
AllCapabilities())
|
||||
)),);
|
||||
)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Dim, ValidateCapability,
|
||||
INSTANTIATE_TEST_SUITE_P(Dim, ValidateCapability,
|
||||
Combine(
|
||||
ValuesIn(AllCapabilities()),
|
||||
Values(
|
||||
@ -968,11 +968,11 @@ std::make_pair(" OpCapability ImageBasic" +
|
||||
" %voidt = OpTypeVoid"
|
||||
" %imgt = OpTypeImage %voidt SubpassData 0 0 0 2 Unknown" + std::string(kVoidFVoid2),
|
||||
std::vector<std::string>{"InputAttachment"})
|
||||
)),);
|
||||
)));
|
||||
|
||||
// NOTE: All Sampler Address Modes require kernel capabilities but the
|
||||
// OpConstantSampler requires LiteralSampler which depends on Kernel
|
||||
INSTANTIATE_TEST_CASE_P(SamplerAddressingMode, ValidateCapability,
|
||||
INSTANTIATE_TEST_SUITE_P(SamplerAddressingMode, ValidateCapability,
|
||||
Combine(
|
||||
ValuesIn(AllCapabilities()),
|
||||
Values(
|
||||
@ -1006,7 +1006,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||
" %sampler = OpConstantSampler %samplert RepeatMirrored 1 Nearest" +
|
||||
std::string(kVoidFVoid),
|
||||
std::vector<std::string>{"LiteralSampler"})
|
||||
)),);
|
||||
)));
|
||||
|
||||
// TODO(umar): Sampler Filter Mode
|
||||
// TODO(umar): Image Format
|
||||
@ -1019,7 +1019,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||
// TODO(umar): Access Qualifier
|
||||
// TODO(umar): Function Parameter Attribute
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Decoration, ValidateCapability,
|
||||
INSTANTIATE_TEST_SUITE_P(Decoration, ValidateCapability,
|
||||
Combine(
|
||||
ValuesIn(AllCapabilities()),
|
||||
Values(
|
||||
@ -1231,10 +1231,10 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||
"OpDecorate %intt Alignment 4\n"
|
||||
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
||||
KernelDependencies())
|
||||
)),);
|
||||
)));
|
||||
|
||||
// clang-format on
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DecorationSpecId, ValidateCapability,
|
||||
Combine(
|
||||
ValuesIn(AllSpirV10Capabilities()),
|
||||
@ -1244,9 +1244,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"%intt = OpTypeInt 32 0\n"
|
||||
"%1 = OpSpecConstant %intt 0\n" +
|
||||
std::string(kVoidFVoid),
|
||||
ShaderDependencies()))), );
|
||||
ShaderDependencies()))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DecorationV11, ValidateCapabilityV11,
|
||||
Combine(ValuesIn(AllCapabilities()),
|
||||
Values(std::make_pair(std::string(kOpenCLMemoryModel) +
|
||||
@ -1275,10 +1275,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"%intt = OpTypeInt 32 0 "
|
||||
"%1 = OpSpecConstant %intt 0") +
|
||||
std::string(kVoidFVoid),
|
||||
ShaderDependencies()))), );
|
||||
ShaderDependencies()))));
|
||||
// clang-format off
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapability,
|
||||
INSTANTIATE_TEST_SUITE_P(BuiltIn, ValidateCapability,
|
||||
Combine(
|
||||
ValuesIn(AllCapabilities()),
|
||||
Values(
|
||||
@ -1500,13 +1500,13 @@ std::make_pair(std::string(kOpenCLMemoryModel) +
|
||||
"OpDecorate %intt BuiltIn InstanceIndex\n"
|
||||
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
||||
ShaderDependencies())
|
||||
)),);
|
||||
)));
|
||||
|
||||
// Ensure that mere mention of PointSize, ClipDistance, or CullDistance as
|
||||
// BuiltIns does not trigger the requirement for the associated
|
||||
// capability.
|
||||
// See https://github.com/KhronosGroup/SPIRV-Tools/issues/365
|
||||
INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapabilityVulkan10,
|
||||
INSTANTIATE_TEST_SUITE_P(BuiltIn, ValidateCapabilityVulkan10,
|
||||
Combine(
|
||||
// All capabilities to try.
|
||||
ValuesIn(AllSpirV10Capabilities()),
|
||||
@ -1537,9 +1537,9 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||
"%f32arr4 = OpTypeArray %f32 %intt_4\n"
|
||||
"%block = OpTypeStruct %f32arr4\n" + std::string(kVoidFVoid),
|
||||
AllVulkan10Capabilities())
|
||||
)),);
|
||||
)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapabilityOpenGL40,
|
||||
INSTANTIATE_TEST_SUITE_P(BuiltIn, ValidateCapabilityOpenGL40,
|
||||
Combine(
|
||||
// OpenGL 4.0 is based on SPIR-V 1.0
|
||||
ValuesIn(AllSpirV10Capabilities()),
|
||||
@ -1559,9 +1559,9 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||
"OpDecorate %intt BuiltIn CullDistance\n"
|
||||
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
||||
AllSpirV10Capabilities())
|
||||
)),);
|
||||
)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Capabilities, ValidateCapabilityWebGPU,
|
||||
INSTANTIATE_TEST_SUITE_P(Capabilities, ValidateCapabilityWebGPU,
|
||||
Combine(
|
||||
// All capabilities to try.
|
||||
ValuesIn(AllCapabilities()),
|
||||
@ -1569,9 +1569,9 @@ INSTANTIATE_TEST_CASE_P(Capabilities, ValidateCapabilityWebGPU,
|
||||
std::make_pair(std::string(kVulkanMemoryModel) +
|
||||
"OpEntryPoint Vertex %func \"shader\" \n" + std::string(kVoidFVoid),
|
||||
AllWebGPUCapabilities())
|
||||
)),);
|
||||
)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Capabilities, ValidateCapabilityVulkan11,
|
||||
INSTANTIATE_TEST_SUITE_P(Capabilities, ValidateCapabilityVulkan11,
|
||||
Combine(
|
||||
// All capabilities to try.
|
||||
ValuesIn(AllCapabilities()),
|
||||
@ -1586,7 +1586,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||
"OpDecorate %intt BuiltIn CullDistance\n"
|
||||
"%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
|
||||
AllVulkan11Capabilities())
|
||||
)),);
|
||||
)));
|
||||
|
||||
// TODO(umar): Selection Control
|
||||
// TODO(umar): Loop Control
|
||||
@ -1598,7 +1598,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
|
||||
// TODO(umar): Kernel Enqueue Flags
|
||||
// TODO(umar): Kernel Profiling Flags
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateCapability,
|
||||
INSTANTIATE_TEST_SUITE_P(MatrixOp, ValidateCapability,
|
||||
Combine(
|
||||
ValuesIn(AllCapabilities()),
|
||||
Values(
|
||||
@ -1607,7 +1607,7 @@ std::make_pair(std::string(kOpenCLMemoryModel) +
|
||||
"%f32 = OpTypeFloat 32\n"
|
||||
"%vec3 = OpTypeVector %f32 3\n"
|
||||
"%mat33 = OpTypeMatrix %vec3 3\n" + std::string(kVoidFVoid),
|
||||
MatrixDependencies()))),);
|
||||
MatrixDependencies()))));
|
||||
// clang-format on
|
||||
|
||||
#if 0
|
||||
@ -1648,7 +1648,7 @@ OpFunctionEnd
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TwoImageOperandsMask, ValidateCapability,
|
||||
Combine(
|
||||
ValuesIn(AllCapabilities()),
|
||||
|
@ -171,9 +171,9 @@ const char* types_consts() {
|
||||
return types;
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(StructuredControlFlow, ValidateCFG,
|
||||
::testing::Values(SpvCapabilityShader,
|
||||
SpvCapabilityKernel));
|
||||
INSTANTIATE_TEST_SUITE_P(StructuredControlFlow, ValidateCFG,
|
||||
::testing::Values(SpvCapabilityShader,
|
||||
SpvCapabilityKernel));
|
||||
|
||||
TEST_P(ValidateCFG, LoopReachableFromEntryButNeverLeadingToReturn) {
|
||||
// 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, "" }
|
||||
#define GOOD_KERNEL_10(STR) \
|
||||
{ SPV_ENV_UNIVERSAL_1_0, kKernelPreamble kBasicTypes STR, true, "" }
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
UniversalInShader, ValidateConstantOp,
|
||||
ValuesIn(std::vector<ConstantOpCase>{
|
||||
// TODO(dneto): Conversions must change width.
|
||||
@ -141,7 +141,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"%v = OpSpecConstantOp %bool SGreaterThanEqual %uint_0 %uint_0"),
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
UniversalInKernel, ValidateConstantOp,
|
||||
ValuesIn(std::vector<ConstantOpCase>{
|
||||
// TODO(dneto): Conversions must change width.
|
||||
@ -198,7 +198,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"%v = OpSpecConstantOp %bool SGreaterThanEqual %uint_0 %uint_0"),
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
KernelInKernel, ValidateConstantOp,
|
||||
ValuesIn(std::vector<ConstantOpCase>{
|
||||
// TODO(dneto): Conversions must change width.
|
||||
@ -235,7 +235,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"Specialization constant operation " NAME \
|
||||
" requires Kernel capability" \
|
||||
}
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
KernelInShader, ValidateConstantOp,
|
||||
ValuesIn(std::vector<ConstantOpCase>{
|
||||
// TODO(dneto): Conversions must change width.
|
||||
@ -280,7 +280,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"InBoundsPtrAccessChain"),
|
||||
}));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
UConvertInAMD_gpu_shader_int16, ValidateConstantOp,
|
||||
ValuesIn(std::vector<ConstantOpCase>{
|
||||
// SPV_AMD_gpu_shader_int16 should enable UConvert for OpSpecConstantOp
|
||||
|
@ -493,20 +493,20 @@ TEST_P(ValidateGlslStd450SqrtLike, IntOperand) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllSqrtLike, ValidateGlslStd450SqrtLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"Round",
|
||||
"RoundEven",
|
||||
"FAbs",
|
||||
"Trunc",
|
||||
"FSign",
|
||||
"Floor",
|
||||
"Ceil",
|
||||
"Fract",
|
||||
"Sqrt",
|
||||
"InverseSqrt",
|
||||
"Normalize",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllSqrtLike, ValidateGlslStd450SqrtLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"Round",
|
||||
"RoundEven",
|
||||
"FAbs",
|
||||
"Trunc",
|
||||
"FSign",
|
||||
"Floor",
|
||||
"Ceil",
|
||||
"Fract",
|
||||
"Sqrt",
|
||||
"InverseSqrt",
|
||||
"Normalize",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateGlslStd450FMinLike, Success) {
|
||||
const std::string ext_inst_name = GetParam();
|
||||
@ -560,15 +560,15 @@ TEST_P(ValidateGlslStd450FMinLike, IntOperand2) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllFMinLike, ValidateGlslStd450FMinLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"FMin",
|
||||
"FMax",
|
||||
"Step",
|
||||
"Reflect",
|
||||
"NMin",
|
||||
"NMax",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllFMinLike, ValidateGlslStd450FMinLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"FMin",
|
||||
"FMax",
|
||||
"Step",
|
||||
"Reflect",
|
||||
"NMin",
|
||||
"NMax",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateGlslStd450FClampLike, Success) {
|
||||
const std::string ext_inst_name = GetParam();
|
||||
@ -635,15 +635,15 @@ TEST_P(ValidateGlslStd450FClampLike, IntOperand3) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllFClampLike, ValidateGlslStd450FClampLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"FClamp",
|
||||
"FMix",
|
||||
"SmoothStep",
|
||||
"Fma",
|
||||
"FaceForward",
|
||||
"NClamp",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllFClampLike, ValidateGlslStd450FClampLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"FClamp",
|
||||
"FMix",
|
||||
"SmoothStep",
|
||||
"Fma",
|
||||
"FaceForward",
|
||||
"NClamp",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateGlslStd450SAbsLike, Success) {
|
||||
const std::string ext_inst_name = GetParam();
|
||||
@ -716,14 +716,14 @@ TEST_P(ValidateGlslStd450SAbsLike, WrongBitWidthOperand) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllSAbsLike, ValidateGlslStd450SAbsLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"SAbs",
|
||||
"SSign",
|
||||
"FindILsb",
|
||||
"FindUMsb",
|
||||
"FindSMsb",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllSAbsLike, ValidateGlslStd450SAbsLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"SAbs",
|
||||
"SSign",
|
||||
"FindILsb",
|
||||
"FindUMsb",
|
||||
"FindSMsb",
|
||||
}));
|
||||
|
||||
TEST_F(ValidateExtInst, FindUMsbNot32Bit) {
|
||||
const std::string body = R"(
|
||||
@ -865,13 +865,13 @@ TEST_P(ValidateGlslStd450UMinLike, WrongBitWidthOperand2) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllUMinLike, ValidateGlslStd450UMinLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"UMin",
|
||||
"SMin",
|
||||
"UMax",
|
||||
"SMax",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllUMinLike, ValidateGlslStd450UMinLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"UMin",
|
||||
"SMin",
|
||||
"UMax",
|
||||
"SMax",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateGlslStd450UClampLike, Success) {
|
||||
const std::string ext_inst_name = GetParam();
|
||||
@ -1028,11 +1028,11 @@ TEST_P(ValidateGlslStd450UClampLike, WrongBitWidthOperand3) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllUClampLike, ValidateGlslStd450UClampLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"UClamp",
|
||||
"SClamp",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllUClampLike, ValidateGlslStd450UClampLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"UClamp",
|
||||
"SClamp",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateGlslStd450SinLike, Success) {
|
||||
const std::string ext_inst_name = GetParam();
|
||||
@ -1083,27 +1083,27 @@ TEST_P(ValidateGlslStd450SinLike, IntOperand) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllSinLike, ValidateGlslStd450SinLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"Radians",
|
||||
"Degrees",
|
||||
"Sin",
|
||||
"Cos",
|
||||
"Tan",
|
||||
"Asin",
|
||||
"Acos",
|
||||
"Atan",
|
||||
"Sinh",
|
||||
"Cosh",
|
||||
"Tanh",
|
||||
"Asinh",
|
||||
"Acosh",
|
||||
"Atanh",
|
||||
"Exp",
|
||||
"Exp2",
|
||||
"Log",
|
||||
"Log2",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllSinLike, ValidateGlslStd450SinLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"Radians",
|
||||
"Degrees",
|
||||
"Sin",
|
||||
"Cos",
|
||||
"Tan",
|
||||
"Asin",
|
||||
"Acos",
|
||||
"Atan",
|
||||
"Sinh",
|
||||
"Cosh",
|
||||
"Tanh",
|
||||
"Asinh",
|
||||
"Acosh",
|
||||
"Atanh",
|
||||
"Exp",
|
||||
"Exp2",
|
||||
"Log",
|
||||
"Log2",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateGlslStd450PowLike, Success) {
|
||||
const std::string ext_inst_name = GetParam();
|
||||
@ -1168,11 +1168,11 @@ TEST_P(ValidateGlslStd450PowLike, IntOperand2) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllPowLike, ValidateGlslStd450PowLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"Atan2",
|
||||
"Pow",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllPowLike, ValidateGlslStd450PowLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"Atan2",
|
||||
"Pow",
|
||||
}));
|
||||
|
||||
TEST_F(ValidateExtInst, GlslStd450DeterminantSuccess) {
|
||||
const std::string body = R"(
|
||||
@ -1795,14 +1795,14 @@ TEST_P(ValidateGlslStd450Pack, VWrongSizeVector) {
|
||||
EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str()));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllPack, ValidateGlslStd450Pack,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"PackSnorm4x8",
|
||||
"PackUnorm4x8",
|
||||
"PackSnorm2x16",
|
||||
"PackUnorm2x16",
|
||||
"PackHalf2x16",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllPack, ValidateGlslStd450Pack,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"PackSnorm4x8",
|
||||
"PackUnorm4x8",
|
||||
"PackSnorm2x16",
|
||||
"PackUnorm2x16",
|
||||
"PackHalf2x16",
|
||||
}));
|
||||
|
||||
TEST_F(ValidateExtInst, PackDouble2x32Success) {
|
||||
const std::string body = R"(
|
||||
@ -2034,14 +2034,14 @@ TEST_P(ValidateGlslStd450Unpack, ResultPWrongBitWidth) {
|
||||
EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str()));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllUnpack, ValidateGlslStd450Unpack,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"UnpackSnorm4x8",
|
||||
"UnpackUnorm4x8",
|
||||
"UnpackSnorm2x16",
|
||||
"UnpackUnorm2x16",
|
||||
"UnpackHalf2x16",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllUnpack, ValidateGlslStd450Unpack,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"UnpackSnorm4x8",
|
||||
"UnpackUnorm4x8",
|
||||
"UnpackSnorm2x16",
|
||||
"UnpackUnorm2x16",
|
||||
"UnpackHalf2x16",
|
||||
}));
|
||||
|
||||
TEST_F(ValidateExtInst, UnpackDouble2x32Success) {
|
||||
const std::string body = R"(
|
||||
@ -2831,7 +2831,7 @@ TEST_P(ValidateOpenCLStdSqrtLike, IntOperand) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
AllSqrtLike, ValidateOpenCLStdSqrtLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"acos", "acosh", "acospi", "asin",
|
||||
@ -2851,7 +2851,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"native_log", "native_log2", "native_log10", "native_recip",
|
||||
"native_rsqrt", "native_sin", "native_sqrt", "native_tan",
|
||||
"degrees", "radians", "sign",
|
||||
}), );
|
||||
}));
|
||||
|
||||
TEST_P(ValidateOpenCLStdFMinLike, Success) {
|
||||
const std::string ext_inst_name = GetParam();
|
||||
@ -2905,16 +2905,16 @@ TEST_P(ValidateOpenCLStdFMinLike, IntOperand2) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllFMinLike, ValidateOpenCLStdFMinLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"atan2", "atan2pi", "copysign",
|
||||
"fdim", "fmax", "fmin",
|
||||
"fmod", "maxmag", "minmag",
|
||||
"hypot", "nextafter", "pow",
|
||||
"powr", "remainder", "half_divide",
|
||||
"half_powr", "native_divide", "native_powr",
|
||||
"step", "fmax_common", "fmin_common",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllFMinLike, ValidateOpenCLStdFMinLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"atan2", "atan2pi", "copysign",
|
||||
"fdim", "fmax", "fmin",
|
||||
"fmod", "maxmag", "minmag",
|
||||
"hypot", "nextafter", "pow",
|
||||
"powr", "remainder", "half_divide",
|
||||
"half_powr", "native_divide", "native_powr",
|
||||
"step", "fmax_common", "fmin_common",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateOpenCLStdFClampLike, Success) {
|
||||
const std::string ext_inst_name = GetParam();
|
||||
@ -2981,14 +2981,14 @@ TEST_P(ValidateOpenCLStdFClampLike, IntOperand3) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllFClampLike, ValidateOpenCLStdFClampLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"fma",
|
||||
"mad",
|
||||
"fclamp",
|
||||
"mix",
|
||||
"smoothstep",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllFClampLike, ValidateOpenCLStdFClampLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"fma",
|
||||
"mad",
|
||||
"fclamp",
|
||||
"mix",
|
||||
"smoothstep",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateOpenCLStdSAbsLike, Success) {
|
||||
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"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllSAbsLike, ValidateOpenCLStdSAbsLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"s_abs",
|
||||
"clz",
|
||||
"ctz",
|
||||
"popcount",
|
||||
"u_abs",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllSAbsLike, ValidateOpenCLStdSAbsLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"s_abs",
|
||||
"clz",
|
||||
"ctz",
|
||||
"popcount",
|
||||
"u_abs",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateOpenCLStdUMinLike, Success) {
|
||||
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"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllUMinLike, ValidateOpenCLStdUMinLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"s_max",
|
||||
"u_max",
|
||||
"s_min",
|
||||
"u_min",
|
||||
"s_abs_diff",
|
||||
"s_add_sat",
|
||||
"u_add_sat",
|
||||
"s_mul_hi",
|
||||
"rotate",
|
||||
"s_sub_sat",
|
||||
"u_sub_sat",
|
||||
"s_hadd",
|
||||
"u_hadd",
|
||||
"s_rhadd",
|
||||
"u_rhadd",
|
||||
"u_abs_diff",
|
||||
"u_mul_hi",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllUMinLike, ValidateOpenCLStdUMinLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"s_max",
|
||||
"u_max",
|
||||
"s_min",
|
||||
"u_min",
|
||||
"s_abs_diff",
|
||||
"s_add_sat",
|
||||
"u_add_sat",
|
||||
"s_mul_hi",
|
||||
"rotate",
|
||||
"s_sub_sat",
|
||||
"u_sub_sat",
|
||||
"s_hadd",
|
||||
"u_hadd",
|
||||
"s_rhadd",
|
||||
"u_rhadd",
|
||||
"u_abs_diff",
|
||||
"u_mul_hi",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateOpenCLStdUClampLike, Success) {
|
||||
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"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllUClampLike, ValidateOpenCLStdUClampLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"s_clamp",
|
||||
"u_clamp",
|
||||
"s_mad_hi",
|
||||
"u_mad_sat",
|
||||
"s_mad_sat",
|
||||
"u_mad_hi",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllUClampLike, ValidateOpenCLStdUClampLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"s_clamp",
|
||||
"u_clamp",
|
||||
"s_mad_hi",
|
||||
"u_mad_sat",
|
||||
"s_mad_sat",
|
||||
"u_mad_hi",
|
||||
}));
|
||||
|
||||
// -------------------------------------------------------------
|
||||
TEST_P(ValidateOpenCLStdUMul24Like, Success) {
|
||||
@ -3398,11 +3398,11 @@ TEST_P(ValidateOpenCLStdUMul24Like, U64Operand2) {
|
||||
": expected types of all operands to be equal to Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllUMul24Like, ValidateOpenCLStdUMul24Like,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"s_mul24",
|
||||
"u_mul24",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllUMul24Like, ValidateOpenCLStdUMul24Like,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"s_mul24",
|
||||
"u_mul24",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateOpenCLStdUMad24Like, Success) {
|
||||
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"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllUMad24Like, ValidateOpenCLStdUMad24Like,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"s_mad24",
|
||||
"u_mad24",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllUMad24Like, ValidateOpenCLStdUMad24Like,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"s_mad24",
|
||||
"u_mad24",
|
||||
}));
|
||||
|
||||
TEST_F(ValidateExtInst, OpenCLStdCrossSuccess) {
|
||||
const std::string body = R"(
|
||||
@ -3662,11 +3662,11 @@ TEST_P(ValidateOpenCLStdLengthLike, DifferentType) {
|
||||
"Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllLengthLike, ValidateOpenCLStdLengthLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"length",
|
||||
"fast_length",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllLengthLike, ValidateOpenCLStdLengthLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"length",
|
||||
"fast_length",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateOpenCLStdDistanceLike, Success) {
|
||||
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"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllDistanceLike, ValidateOpenCLStdDistanceLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"distance",
|
||||
"fast_distance",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllDistanceLike, ValidateOpenCLStdDistanceLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"distance",
|
||||
"fast_distance",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateOpenCLStdNormalizeLike, Success) {
|
||||
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"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllNormalizeLike, ValidateOpenCLStdNormalizeLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"normalize",
|
||||
"fast_normalize",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllNormalizeLike, ValidateOpenCLStdNormalizeLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"normalize",
|
||||
"fast_normalize",
|
||||
}));
|
||||
|
||||
TEST_F(ValidateExtInst, OpenCLStdBitselectSuccess) {
|
||||
const std::string body = R"(
|
||||
@ -4208,15 +4208,15 @@ TEST_P(ValidateOpenCLStdVStoreHalfLike, PDataTypeFloat32) {
|
||||
": expected operand P data type to be 16-bit float scalar"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllVStoreHalfLike, ValidateOpenCLStdVStoreHalfLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"vstore_half",
|
||||
"vstore_half_r",
|
||||
"vstore_halfn",
|
||||
"vstore_halfn_r",
|
||||
"vstorea_halfn",
|
||||
"vstorea_halfn_r",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllVStoreHalfLike, ValidateOpenCLStdVStoreHalfLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"vstore_half",
|
||||
"vstore_half_r",
|
||||
"vstore_halfn",
|
||||
"vstore_halfn_r",
|
||||
"vstorea_halfn",
|
||||
"vstorea_halfn_r",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateOpenCLStdVLoadHalfLike, SuccessPhysical32) {
|
||||
const std::string ext_inst_name = GetParam();
|
||||
@ -4375,11 +4375,11 @@ TEST_P(ValidateOpenCLStdVLoadHalfLike, WrongN) {
|
||||
"components of Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllVLoadHalfLike, ValidateOpenCLStdVLoadHalfLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"vload_halfn",
|
||||
"vloada_halfn",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllVLoadHalfLike, ValidateOpenCLStdVLoadHalfLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"vload_halfn",
|
||||
"vloada_halfn",
|
||||
}));
|
||||
|
||||
TEST_F(ValidateExtInst, VLoadNSuccessFloatPhysical32) {
|
||||
std::ostringstream ss;
|
||||
@ -5299,12 +5299,12 @@ TEST_P(ValidateOpenCLStdFractLike, PointerWrongDataType) {
|
||||
": expected data type of the pointer to be equal to Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllFractLike, ValidateOpenCLStdFractLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"fract",
|
||||
"modf",
|
||||
"sincos",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllFractLike, ValidateOpenCLStdFractLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"fract",
|
||||
"modf",
|
||||
"sincos",
|
||||
}));
|
||||
|
||||
TEST_F(ValidateExtInst, OpenCLStdRemquoSuccess) {
|
||||
const std::string body = R"(
|
||||
@ -5518,11 +5518,11 @@ TEST_P(ValidateOpenCLStdFrexpLike, PointerDataTypeDiffSize) {
|
||||
"number of components as Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllFrexpLike, ValidateOpenCLStdFrexpLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"frexp",
|
||||
"lgamma_r",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllFrexpLike, ValidateOpenCLStdFrexpLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"frexp",
|
||||
"lgamma_r",
|
||||
}));
|
||||
|
||||
TEST_F(ValidateExtInst, OpenCLStdIlogbSuccess) {
|
||||
const std::string body = R"(
|
||||
@ -5716,12 +5716,12 @@ TEST_P(ValidateOpenCLStdLdexpLike, ExponentWrongSize) {
|
||||
"components as Result Type"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllLdexpLike, ValidateOpenCLStdLdexpLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"ldexp",
|
||||
"pown",
|
||||
"rootn",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllLdexpLike, ValidateOpenCLStdLdexpLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"ldexp",
|
||||
"pown",
|
||||
"rootn",
|
||||
}));
|
||||
|
||||
TEST_P(ValidateOpenCLStdUpsampleLike, Success) {
|
||||
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"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AllUpsampleLike, ValidateOpenCLStdUpsampleLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"u_upsample",
|
||||
"s_upsample",
|
||||
}), );
|
||||
INSTANTIATE_TEST_SUITE_P(AllUpsampleLike, ValidateOpenCLStdUpsampleLike,
|
||||
::testing::ValuesIn(std::vector<std::string>{
|
||||
"u_upsample",
|
||||
"s_upsample",
|
||||
}));
|
||||
|
||||
} // namespace
|
||||
} // namespace val
|
||||
|
@ -43,7 +43,7 @@ std::string GetErrorString(const std::string& extension) {
|
||||
return "Found unrecognized extension " + extension;
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ExpectSuccess, ValidateKnownExtensions,
|
||||
Values(
|
||||
// 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_NV_shader_subgroup_partitioned", "SPV_EXT_descriptor_indexing"));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(FailSilently, ValidateUnknownExtensions,
|
||||
Values("ERROR_unknown_extension", "SPV_KHR_",
|
||||
"SPV_KHR_shader_ballot_ERROR"));
|
||||
INSTANTIATE_TEST_SUITE_P(FailSilently, ValidateUnknownExtensions,
|
||||
Values("ERROR_unknown_extension", "SPV_KHR_",
|
||||
"SPV_KHR_shader_ballot_ERROR"));
|
||||
|
||||
TEST_P(ValidateKnownExtensions, ExpectSuccess) {
|
||||
const std::string extension = GetParam();
|
||||
@ -227,8 +227,8 @@ TEST_P(ValidateAMDShaderBallotCapabilities, ExpectSuccess) {
|
||||
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ExpectSuccess, ValidateAMDShaderBallotCapabilities,
|
||||
ValuesIn(AMDShaderBallotGroupInstructions()));
|
||||
INSTANTIATE_TEST_SUITE_P(ExpectSuccess, ValidateAMDShaderBallotCapabilities,
|
||||
ValuesIn(AMDShaderBallotGroupInstructions()));
|
||||
|
||||
TEST_P(ValidateAMDShaderBallotCapabilities, ExpectFailure) {
|
||||
// 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")));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ExpectFailure, ValidateAMDShaderBallotCapabilities,
|
||||
ValuesIn(AMDShaderBallotGroupInstructions()));
|
||||
INSTANTIATE_TEST_SUITE_P(ExpectFailure, ValidateAMDShaderBallotCapabilities,
|
||||
ValuesIn(AMDShaderBallotGroupInstructions()));
|
||||
|
||||
struct ExtIntoCoreCase {
|
||||
const char* ext;
|
||||
@ -305,7 +305,7 @@ TEST_P(ValidateExtIntoCore, DoNotAskForExtensionInLaterVersion) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
KHR_extensions, ValidateExtIntoCore,
|
||||
ValuesIn(std::vector<ExtIntoCoreCase>{
|
||||
// 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
|
||||
// here since the purpose of these tests is to check the validity of
|
||||
// OpTypeArray, not OpTypeInt.
|
||||
INSTANTIATE_TEST_CASE_P(Widths, OpTypeArrayLengthTest,
|
||||
ValuesIn(std::vector<int>{16, 32, 64}));
|
||||
INSTANTIATE_TEST_SUITE_P(Widths, OpTypeArrayLengthTest,
|
||||
ValuesIn(std::vector<int>{16, 32, 64}));
|
||||
|
||||
TEST_F(ValidateIdWithMessage, OpTypeArrayLengthNull) {
|
||||
std::string spirv = kGLSL450MemoryModel + R"(
|
||||
@ -3918,7 +3918,7 @@ OpFunctionEnd
|
||||
}
|
||||
|
||||
// Run tests for Access Chain Instructions.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
CheckAccessChainInstructions, AccessChainInstructionTest,
|
||||
::testing::Values("OpAccessChain", "OpInBoundsAccessChain",
|
||||
"OpPtrAccessChain", "OpInBoundsPtrAccessChain"));
|
||||
|
@ -120,7 +120,7 @@ const std::vector<std::string>& getInstructions() {
|
||||
static const int kRangeEnd = 1000;
|
||||
pred_type All = Range<0, kRangeEnd>();
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(InstructionsOrder,
|
||||
INSTANTIATE_TEST_SUITE_P(InstructionsOrder,
|
||||
ValidateLayout,
|
||||
::testing::Combine(::testing::Range((int)0, (int)getInstructions().size()),
|
||||
// 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("OpNop") , Equals<40> , Range<40,kRangeEnd>())
|
||||
, std::make_tuple(std::string("OpReturn ; %func2 return") , Equals<41> , All)
|
||||
)),);
|
||||
)));
|
||||
// clang-format on
|
||||
|
||||
// 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
|
||||
// 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".
|
||||
TEST_P(ValidateLayout, Layout) {
|
||||
int order;
|
||||
|
@ -99,7 +99,7 @@ TEST_P(ValidateLiteralsShader, LiteralsShaderBad) {
|
||||
"or sign extended when Signedness is 1"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
LiteralsShaderCases, ValidateLiteralsShader,
|
||||
::testing::Values("%11 = OpConstant %int16 !0xFFFF0000", // Sign bit is 0
|
||||
"%11 = OpConstant %int16 !0x00008000", // Sign bit is 1
|
||||
@ -132,7 +132,7 @@ TEST_P(ValidateLiteralsKernel, LiteralsKernelBad) {
|
||||
"or sign extended when Signedness is 1"));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
LiteralsKernelCases, ValidateLiteralsKernel,
|
||||
::testing::Values("%2 = OpConstant %uint8 !0xABCDEF00",
|
||||
"%2 = OpConstant %uint8 !0xABCDEFFF"));
|
||||
|
@ -510,7 +510,7 @@ TEST_P(ValidateModeGeometry, ExecutionMode) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
GeometryRequiredModes, ValidateModeGeometry,
|
||||
Combine(Combine(Values("InputPoints", ""), Values("InputLines", ""),
|
||||
Values("InputLinesAdjacency", ""), Values("Triangles", ""),
|
||||
@ -584,7 +584,7 @@ TEST_P(ValidateModeExecution, ExecutionMode) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateModeGeometryOnlyGoodSpv10, ValidateModeExecution,
|
||||
Combine(Values(SPV_SUCCESS), Values(""), Values("Geometry"),
|
||||
Values("Invocations 3", "InputPoints", "InputLines",
|
||||
@ -592,7 +592,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"OutputPoints", "OutputLineStrip", "OutputTriangleStrip"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateModeGeometryOnlyBadSpv10, ValidateModeExecution,
|
||||
Combine(Values(SPV_ERROR_INVALID_DATA),
|
||||
Values("Execution mode can only be used with the Geometry "
|
||||
@ -604,7 +604,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"OutputPoints", "OutputLineStrip", "OutputTriangleStrip"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateModeTessellationOnlyGoodSpv10, ValidateModeExecution,
|
||||
Combine(Values(SPV_SUCCESS), Values(""),
|
||||
Values("TessellationControl", "TessellationEvaluation"),
|
||||
@ -613,7 +613,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"PointMode", "Quads", "Isolines"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateModeTessellationOnlyBadSpv10, ValidateModeExecution,
|
||||
Combine(Values(SPV_ERROR_INVALID_DATA),
|
||||
Values("Execution mode can only be used with a tessellation "
|
||||
@ -624,15 +624,15 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"PointMode", "Quads", "Isolines"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ValidateModeGeometryAndTessellationGoodSpv10,
|
||||
ValidateModeExecution,
|
||||
Combine(Values(SPV_SUCCESS), Values(""),
|
||||
Values("TessellationControl",
|
||||
"TessellationEvaluation", "Geometry"),
|
||||
Values("Triangles", "OutputVertices 3"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||
INSTANTIATE_TEST_SUITE_P(ValidateModeGeometryAndTessellationGoodSpv10,
|
||||
ValidateModeExecution,
|
||||
Combine(Values(SPV_SUCCESS), Values(""),
|
||||
Values("TessellationControl",
|
||||
"TessellationEvaluation", "Geometry"),
|
||||
Values("Triangles", "OutputVertices 3"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateModeGeometryAndTessellationBadSpv10, ValidateModeExecution,
|
||||
Combine(Values(SPV_ERROR_INVALID_DATA),
|
||||
Values("Execution mode can only be used with a Geometry or "
|
||||
@ -641,7 +641,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
Values("Triangles", "OutputVertices 3"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateModeFragmentOnlyGoodSpv10, ValidateModeExecution,
|
||||
Combine(Values(SPV_SUCCESS), Values(""), Values("Fragment"),
|
||||
Values("PixelCenterInteger", "OriginUpperLeft", "OriginLowerLeft",
|
||||
@ -649,7 +649,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"DepthUnchanged"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateModeFragmentOnlyBadSpv10, ValidateModeExecution,
|
||||
Combine(Values(SPV_ERROR_INVALID_DATA),
|
||||
Values("Execution mode can only be used with the Fragment "
|
||||
@ -661,15 +661,15 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"DepthUnchanged"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_0)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ValidateModeKernelOnlyGoodSpv13, ValidateModeExecution,
|
||||
Combine(Values(SPV_SUCCESS), Values(""),
|
||||
Values("Kernel"),
|
||||
Values("LocalSizeHint 1 1 1", "VecTypeHint 4",
|
||||
"ContractionOff",
|
||||
"LocalSizeHintId %int1"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_3)));
|
||||
INSTANTIATE_TEST_SUITE_P(ValidateModeKernelOnlyGoodSpv13, ValidateModeExecution,
|
||||
Combine(Values(SPV_SUCCESS), Values(""),
|
||||
Values("Kernel"),
|
||||
Values("LocalSizeHint 1 1 1", "VecTypeHint 4",
|
||||
"ContractionOff",
|
||||
"LocalSizeHintId %int1"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_3)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateModeKernelOnlyBadSpv13, ValidateModeExecution,
|
||||
Combine(
|
||||
Values(SPV_ERROR_INVALID_DATA),
|
||||
@ -681,13 +681,13 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"LocalSizeHintId %int1"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_3)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateModeGLComputeAndKernelGoodSpv13, ValidateModeExecution,
|
||||
Combine(Values(SPV_SUCCESS), Values(""), Values("Kernel", "GLCompute"),
|
||||
Values("LocalSize 1 1 1", "LocalSizeId %int1 %int1 %int1"),
|
||||
Values(SPV_ENV_UNIVERSAL_1_3)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateModeGLComputeAndKernelBadSpv13, ValidateModeExecution,
|
||||
Combine(Values(SPV_ERROR_INVALID_DATA),
|
||||
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(SPV_ENV_UNIVERSAL_1_3)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateModeAllGoodSpv13, ValidateModeExecution,
|
||||
Combine(Values(SPV_SUCCESS), Values(""),
|
||||
Values("Kernel", "GLCompute", "Geometry", "TessellationControl",
|
||||
|
@ -182,63 +182,63 @@ TEST_P(GroupNonUniform, Spirv1p3) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformElect, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformElect"),
|
||||
Values("%bool"), ValuesIn(scopes), Values(""),
|
||||
Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformElect, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformElect"),
|
||||
Values("%bool"), ValuesIn(scopes), Values(""),
|
||||
Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformVote, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformAll",
|
||||
"OpGroupNonUniformAny",
|
||||
"OpGroupNonUniformAllEqual"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("%true"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformVote, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformAll",
|
||||
"OpGroupNonUniformAny",
|
||||
"OpGroupNonUniformAllEqual"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("%true"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBroadcast, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBroadcast"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("%true %u32_0"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBroadcast, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBroadcast"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("%true %u32_0"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBroadcastFirst, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBroadcastFirst"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("%true"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBroadcastFirst, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBroadcastFirst"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("%true"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallot, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallot"),
|
||||
Values("%u32vec4"), ValuesIn(scopes),
|
||||
Values("%true"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallot, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallot"),
|
||||
Values("%u32vec4"), ValuesIn(scopes),
|
||||
Values("%true"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformInverseBallot, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformInverseBallot"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("%u32vec4_null"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformInverseBallot, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformInverseBallot"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("%u32vec4_null"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitExtract, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallotBitExtract"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("%u32vec4_null %u32_0"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitExtract, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallotBitExtract"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("%u32vec4_null %u32_0"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitCount, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
||||
Values("%u32"), ValuesIn(scopes),
|
||||
Values("Reduce %u32vec4_null"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitCount, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
||||
Values("%u32"), ValuesIn(scopes),
|
||||
Values("Reduce %u32vec4_null"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotFind, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallotFindLSB",
|
||||
"OpGroupNonUniformBallotFindMSB"),
|
||||
Values("%u32"), ValuesIn(scopes),
|
||||
Values("%u32vec4_null"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotFind, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallotFindLSB",
|
||||
"OpGroupNonUniformBallotFindMSB"),
|
||||
Values("%u32"), ValuesIn(scopes),
|
||||
Values("%u32vec4_null"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformShuffle, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformShuffle",
|
||||
"OpGroupNonUniformShuffleXor",
|
||||
"OpGroupNonUniformShuffleUp",
|
||||
"OpGroupNonUniformShuffleDown"),
|
||||
Values("%u32"), ValuesIn(scopes),
|
||||
Values("%u32_0 %u32_0"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformShuffle, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformShuffle",
|
||||
"OpGroupNonUniformShuffleXor",
|
||||
"OpGroupNonUniformShuffleUp",
|
||||
"OpGroupNonUniformShuffleDown"),
|
||||
Values("%u32"), ValuesIn(scopes),
|
||||
Values("%u32_0 %u32_0"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
GroupNonUniformIntegerArithmetic, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformIAdd", "OpGroupNonUniformIMul",
|
||||
"OpGroupNonUniformSMin", "OpGroupNonUniformUMin",
|
||||
@ -248,45 +248,45 @@ INSTANTIATE_TEST_CASE_P(
|
||||
Values("%u32"), ValuesIn(scopes), Values("Reduce %u32_0"),
|
||||
Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
GroupNonUniformFloatArithmetic, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformFAdd", "OpGroupNonUniformFMul",
|
||||
"OpGroupNonUniformFMin", "OpGroupNonUniformFMax"),
|
||||
Values("%float"), ValuesIn(scopes), Values("Reduce %float_0"),
|
||||
Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformLogicalArithmetic, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformLogicalAnd",
|
||||
"OpGroupNonUniformLogicalOr",
|
||||
"OpGroupNonUniformLogicalXor"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("Reduce %true"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformLogicalArithmetic, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformLogicalAnd",
|
||||
"OpGroupNonUniformLogicalOr",
|
||||
"OpGroupNonUniformLogicalXor"),
|
||||
Values("%bool"), ValuesIn(scopes),
|
||||
Values("Reduce %true"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformQuad, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformQuadBroadcast",
|
||||
"OpGroupNonUniformQuadSwap"),
|
||||
Values("%u32"), ValuesIn(scopes),
|
||||
Values("%u32_0 %u32_0"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformQuad, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformQuadBroadcast",
|
||||
"OpGroupNonUniformQuadSwap"),
|
||||
Values("%u32"), ValuesIn(scopes),
|
||||
Values("%u32_0 %u32_0"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitCountScope, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
||||
Values("%u32"), ValuesIn(scopes),
|
||||
Values("Reduce %u32vec4_null"), Values("")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitCountScope, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
||||
Values("%u32"), ValuesIn(scopes),
|
||||
Values("Reduce %u32vec4_null"), Values("")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
GroupNonUniformBallotBitCountBadResultType, GroupNonUniform,
|
||||
Combine(
|
||||
Values("OpGroupNonUniformBallotBitCount"), Values("%float", "%int"),
|
||||
Values(SpvScopeSubgroup), Values("Reduce %u32vec4_null"),
|
||||
Values("Expected Result Type to be an unsigned integer type scalar.")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitCountBadValue, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
||||
Values("%u32"), Values(SpvScopeSubgroup),
|
||||
Values("Reduce %u32vec3_null", "Reduce %u32_0",
|
||||
"Reduce %float_0"),
|
||||
Values("Expected Value to be a vector of four "
|
||||
"components of integer type scalar")));
|
||||
INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitCountBadValue, GroupNonUniform,
|
||||
Combine(Values("OpGroupNonUniformBallotBitCount"),
|
||||
Values("%u32"), Values(SpvScopeSubgroup),
|
||||
Values("Reduce %u32vec3_null", "Reduce %u32_0",
|
||||
"Reduce %float_0"),
|
||||
Values("Expected Value to be a vector of four "
|
||||
"components of integer type scalar")));
|
||||
|
||||
} // namespace
|
||||
} // namespace val
|
||||
|
@ -823,7 +823,7 @@ std::pair<std::string, bool> cases[] = {
|
||||
{"OpGetKernelWorkGroupSize", 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"(
|
||||
OpReturn
|
||||
|
@ -137,7 +137,7 @@ TEST_P(ValidateStorage, OtherStorageInsideFunction) {
|
||||
"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(
|
||||
"Input",
|
||||
"Uniform",
|
||||
@ -147,7 +147,7 @@ INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateStorage,
|
||||
"Private",
|
||||
"PushConstant",
|
||||
"AtomicCounter",
|
||||
"Image"),);
|
||||
"Image"));
|
||||
// clang-format on
|
||||
|
||||
TEST_F(ValidateStorage, GenericVariableOutsideFunction) {
|
||||
|
@ -108,7 +108,7 @@ TEST_P(ValidateVersion, version) {
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(Universal, ValidateVersion,
|
||||
INSTANTIATE_TEST_SUITE_P(Universal, ValidateVersion,
|
||||
::testing::Values(
|
||||
// Binary version, Target environment
|
||||
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(
|
||||
// Binary version, Target environment
|
||||
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(
|
||||
// Binary version, Target environment
|
||||
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(
|
||||
// Binary version, Target environment
|
||||
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