diff options
Diffstat (limited to 'test/text_to_binary.constant_test.cpp')
-rw-r--r-- | test/text_to_binary.constant_test.cpp | 262 |
1 files changed, 131 insertions, 131 deletions
diff --git a/test/text_to_binary.constant_test.cpp b/test/text_to_binary.constant_test.cpp index bc5cd064..7ab4ca51 100644 --- a/test/text_to_binary.constant_test.cpp +++ b/test/text_to_binary.constant_test.cpp @@ -35,21 +35,21 @@ using ::testing::Eq; // Test Sampler Addressing Mode enum values using SamplerAddressingModeTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam<EnumCase<spv::SamplerAddressingMode>>>; + ::testing::TestWithParam<EnumCase<SpvSamplerAddressingMode>>>; TEST_P(SamplerAddressingModeTest, AnySamplerAddressingMode) { const std::string input = "%result = OpConstantSampler %type " + GetParam().name() + " 0 Nearest"; EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(spv::Op::OpConstantSampler, - {1, 2, uint32_t(GetParam().value()), 0, 0}))); + Eq(MakeInstruction(SpvOpConstantSampler, + {1, 2, GetParam().value(), 0, 0}))); } // clang-format off -#define CASE(NAME) { spv::SamplerAddressingMode::NAME, #NAME } +#define CASE(NAME) { SpvSamplerAddressingMode##NAME, #NAME } INSTANTIATE_TEST_SUITE_P( TextToBinarySamplerAddressingMode, SamplerAddressingModeTest, - ::testing::ValuesIn(std::vector<EnumCase<spv::SamplerAddressingMode>>{ + ::testing::ValuesIn(std::vector<EnumCase<SpvSamplerAddressingMode>>{ CASE(None), CASE(ClampToEdge), CASE(Clamp), @@ -67,21 +67,21 @@ TEST_F(SamplerAddressingModeTest, WrongMode) { // Test Sampler Filter Mode enum values using SamplerFilterModeTest = spvtest::TextToBinaryTestBase< - ::testing::TestWithParam<EnumCase<spv::SamplerFilterMode>>>; + ::testing::TestWithParam<EnumCase<SpvSamplerFilterMode>>>; TEST_P(SamplerFilterModeTest, AnySamplerFilterMode) { const std::string input = "%result = OpConstantSampler %type Clamp 0 " + GetParam().name(); EXPECT_THAT(CompiledInstructions(input), - Eq(MakeInstruction(spv::Op::OpConstantSampler, - {1, 2, 2, 0, uint32_t(GetParam().value())}))); + Eq(MakeInstruction(SpvOpConstantSampler, + {1, 2, 2, 0, GetParam().value()}))); } // clang-format off -#define CASE(NAME) { spv::SamplerFilterMode::NAME, #NAME} +#define CASE(NAME) { SpvSamplerFilterMode##NAME, #NAME} INSTANTIATE_TEST_SUITE_P( TextToBinarySamplerFilterMode, SamplerFilterModeTest, - ::testing::ValuesIn(std::vector<EnumCase<spv::SamplerFilterMode>>{ + ::testing::ValuesIn(std::vector<EnumCase<SpvSamplerFilterMode>>{ CASE(Nearest), CASE(Linear), })); @@ -119,119 +119,119 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(std::vector<ConstantTestCase>{ // Check 16 bits {"OpTypeInt 16 0", "0x1234", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 0}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0x1234})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0x1234})})}, {"OpTypeInt 16 0", "0x8000", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 0}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0x8000})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0x8000})})}, {"OpTypeInt 16 0", "0", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 0}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, {"OpTypeInt 16 0", "65535", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 0}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 65535})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 65535})})}, {"OpTypeInt 16 0", "0xffff", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 0}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 65535})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 65535})})}, {"OpTypeInt 16 1", "0x8000", // Test sign extension. - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0xffff8000})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0xffff8000})})}, {"OpTypeInt 16 1", "-32", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, uint32_t(-32)})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32)})})}, {"OpTypeInt 16 1", "0", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, {"OpTypeInt 16 1", "-0", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, {"OpTypeInt 16 1", "-0x0", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, {"OpTypeInt 16 1", "-32768", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, uint32_t(-32768)})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32768)})})}, // Check 32 bits {"OpTypeInt 32 0", "42", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 32, 0}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 42})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 42})})}, {"OpTypeInt 32 1", "-32", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 32, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, uint32_t(-32)})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32)})})}, {"OpTypeInt 32 1", "0", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 32, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, {"OpTypeInt 32 1", "-0", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 32, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, {"OpTypeInt 32 1", "-0x0", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 32, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0})})}, {"OpTypeInt 32 1", "-0x001", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 32, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, uint32_t(-1)})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-1)})})}, {"OpTypeInt 32 1", "2147483647", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 32, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0x7fffffffu})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0x7fffffffu})})}, {"OpTypeInt 32 1", "-2147483648", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 32, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0x80000000u})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0x80000000u})})}, {"OpTypeFloat 32", "1.0", - Concatenate({MakeInstruction(spv::Op::OpTypeFloat, {1, 32}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0x3f800000})})}, + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0x3f800000})})}, {"OpTypeFloat 32", "10.0", - Concatenate({MakeInstruction(spv::Op::OpTypeFloat, {1, 32}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0x41200000})})}, + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0x41200000})})}, {"OpTypeFloat 32", "-0x1p+128", // -infinity - Concatenate({MakeInstruction(spv::Op::OpTypeFloat, {1, 32}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0xFF800000})})}, + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0xFF800000})})}, {"OpTypeFloat 32", "0x1p+128", // +infinity - Concatenate({MakeInstruction(spv::Op::OpTypeFloat, {1, 32}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0x7F800000})})}, + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0x7F800000})})}, {"OpTypeFloat 32", "-0x1.8p+128", // A -NaN - Concatenate({MakeInstruction(spv::Op::OpTypeFloat, {1, 32}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0xFFC00000})})}, + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0xFFC00000})})}, {"OpTypeFloat 32", "-0x1.0002p+128", // A +NaN - Concatenate({MakeInstruction(spv::Op::OpTypeFloat, {1, 32}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0xFF800100})})}, + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpConstant, {1, 2, 0xFF800100})})}, // Check 48 bits {"OpTypeInt 48 0", "0x1234", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 48, 0}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0x1234, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})}, {"OpTypeInt 48 0", "0x800000000001", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 48, 0}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 1, 0x00008000})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 1, 0x00008000})})}, {"OpTypeInt 48 1", "0x800000000000", // Test sign extension. - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 48, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0, 0xffff8000})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0, 0xffff8000})})}, {"OpTypeInt 48 1", "-32", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 48, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})}, // Check 64 bits {"OpTypeInt 64 0", "0x1234", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 64, 0}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0x1234, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})}, {"OpTypeInt 64 0", "18446744073709551615", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 64, 0}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, {"OpTypeInt 64 0", "0xffffffffffffffff", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 64, 0}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), + MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, {"OpTypeInt 64 1", "0x1234", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 64, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0x1234, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})}, {"OpTypeInt 64 1", "-42", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 64, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})}, {"OpTypeInt 64 1", "-0x01", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 64, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0xffffffffu})})}, {"OpTypeInt 64 1", "9223372036854775807", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 64, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0xffffffffu, 0x7fffffffu})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0xffffffffu, 0x7fffffffu})})}, {"OpTypeInt 64 1", "0x7fffffff", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 64, 1}), - MakeInstruction(spv::Op::OpConstant, {1, 2, 0x7fffffffu, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpConstant, {1, 2, 0x7fffffffu, 0})})}, })); // clang-format on @@ -388,53 +388,53 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(std::vector<ConstantTestCase>{ // Check 16 bits {"OpTypeInt 16 0", "0x1234", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 0}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, 0x1234})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234})})}, {"OpTypeInt 16 0", "0x8000", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 0}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, 0x8000})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x8000})})}, {"OpTypeInt 16 1", "0x8000", // Test sign extension. - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 1}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, 0xffff8000})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0xffff8000})})}, {"OpTypeInt 16 1", "-32", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 16, 1}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, uint32_t(-32)})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32)})})}, // Check 32 bits {"OpTypeInt 32 0", "42", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 32, 0}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, 42})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 42})})}, {"OpTypeInt 32 1", "-32", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 32, 1}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, uint32_t(-32)})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32)})})}, {"OpTypeFloat 32", "1.0", - Concatenate({MakeInstruction(spv::Op::OpTypeFloat, {1, 32}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, 0x3f800000})})}, + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x3f800000})})}, {"OpTypeFloat 32", "10.0", - Concatenate({MakeInstruction(spv::Op::OpTypeFloat, {1, 32}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, 0x41200000})})}, + Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x41200000})})}, // Check 48 bits {"OpTypeInt 48 0", "0x1234", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 48, 0}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, 0x1234, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})}, {"OpTypeInt 48 0", "0x800000000001", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 48, 0}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, 1, 0x00008000})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 1, 0x00008000})})}, {"OpTypeInt 48 1", "0x800000000000", // Test sign extension. - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 48, 1}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, 0, 0xffff8000})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0, 0xffff8000})})}, {"OpTypeInt 48 1", "-32", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 48, 1}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})}, // Check 64 bits {"OpTypeInt 64 0", "0x1234", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 64, 0}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, 0x1234, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})}, {"OpTypeInt 64 1", "0x1234", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 64, 1}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, 0x1234, 0})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})}, {"OpTypeInt 64 1", "-42", - Concatenate({MakeInstruction(spv::Op::OpTypeInt, {1, 64, 1}), - MakeInstruction(spv::Op::OpSpecConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})}, + Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}), + MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})}, })); // clang-format on @@ -648,7 +648,7 @@ INSTANTIATE_TEST_SUITE_P( // Test OpSpecConstantOp using OpSpecConstantOpTestWithIds = - spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<spv::Op>>>; + spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<SpvOp>>>; // The operands to the OpSpecConstantOp opcode are all Ids. TEST_P(OpSpecConstantOpTestWithIds, Assembly) { @@ -658,7 +658,7 @@ TEST_P(OpSpecConstantOpTestWithIds, Assembly) { input << "\n"; EXPECT_THAT(CompiledInstructions(input.str()), - Eq(MakeInstruction(spv::Op::OpSpecConstantOp, + Eq(MakeInstruction(SpvOpSpecConstantOp, {1, 2, uint32_t(GetParam().value())}, GetParam().operands()))); @@ -667,15 +667,15 @@ TEST_P(OpSpecConstantOpTestWithIds, Assembly) { } // clang-format off -#define CASE1(NAME) { spv::Op::Op##NAME, #NAME, {3} } -#define CASE2(NAME) { spv::Op::Op##NAME, #NAME, {3, 4} } -#define CASE3(NAME) { spv::Op::Op##NAME, #NAME, {3, 4, 5} } -#define CASE4(NAME) { spv::Op::Op##NAME, #NAME, {3, 4, 5, 6} } -#define CASE5(NAME) { spv::Op::Op##NAME, #NAME, {3, 4, 5, 6, 7} } -#define CASE6(NAME) { spv::Op::Op##NAME, #NAME, {3, 4, 5, 6, 7, 8} } +#define CASE1(NAME) { SpvOp##NAME, #NAME, {3} } +#define CASE2(NAME) { SpvOp##NAME, #NAME, {3, 4} } +#define CASE3(NAME) { SpvOp##NAME, #NAME, {3, 4, 5} } +#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_SUITE_P( TextToBinaryOpSpecConstantOp, OpSpecConstantOpTestWithIds, - ::testing::ValuesIn(std::vector<EnumCase<spv::Op>>{ + ::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{ // Conversion CASE1(SConvert), CASE1(FConvert), @@ -759,7 +759,7 @@ INSTANTIATE_TEST_SUITE_P( // clang-format on using OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers = - spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<spv::Op>>>; + spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<SpvOp>>>; // The operands to the OpSpecConstantOp opcode are two Ids followed by a // sequence of literal numbers. @@ -770,7 +770,7 @@ TEST_P(OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers, Assembly) { input << "\n"; EXPECT_THAT(CompiledInstructions(input.str()), - Eq(MakeInstruction(spv::Op::OpSpecConstantOp, + Eq(MakeInstruction(SpvOpSpecConstantOp, {1, 2, uint32_t(GetParam().value()), 3, 4}, GetParam().operands()))); @@ -778,11 +778,11 @@ TEST_P(OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers, Assembly) { EXPECT_THAT(EncodeAndDecodeSuccessfully(input.str()), input.str()); } -#define CASE(NAME) spv::Op::Op##NAME, #NAME +#define CASE(NAME) SpvOp##NAME, #NAME INSTANTIATE_TEST_SUITE_P( TextToBinaryOpSpecConstantOp, OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers, - ::testing::ValuesIn(std::vector<EnumCase<spv::Op>>{ + ::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{ // For VectorShuffle, there are two vector operands, and at least // two selector Ids. OpenCL can have up to 16-element vectors. {CASE(VectorShuffle), {0, 0}}, @@ -797,7 +797,7 @@ INSTANTIATE_TEST_SUITE_P( })); using OpSpecConstantOpTestWithOneIdThenLiteralNumbers = - spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<spv::Op>>>; + spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<SpvOp>>>; // The operands to the OpSpecConstantOp opcode are one Id followed by a // sequence of literal numbers. @@ -808,7 +808,7 @@ TEST_P(OpSpecConstantOpTestWithOneIdThenLiteralNumbers, Assembly) { input << "\n"; EXPECT_THAT(CompiledInstructions(input.str()), - Eq(MakeInstruction(spv::Op::OpSpecConstantOp, + Eq(MakeInstruction(SpvOpSpecConstantOp, {1, 2, uint32_t(GetParam().value()), 3}, GetParam().operands()))); @@ -816,11 +816,11 @@ TEST_P(OpSpecConstantOpTestWithOneIdThenLiteralNumbers, Assembly) { EXPECT_THAT(EncodeAndDecodeSuccessfully(input.str()), input.str()); } -#define CASE(NAME) spv::Op::Op##NAME, #NAME +#define CASE(NAME) SpvOp##NAME, #NAME INSTANTIATE_TEST_SUITE_P( TextToBinaryOpSpecConstantOp, OpSpecConstantOpTestWithOneIdThenLiteralNumbers, - ::testing::ValuesIn(std::vector<EnumCase<spv::Op>>{ + ::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{ // For CompositeExtract, the universal limit permits up to 255 literal // indices. Let's only test a few. {CASE(CompositeExtract), {0}}, |