Skip to content

Commit

Permalink
Add test cases for Vulkan 1.4, optimizer ir_context tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dneto0 committed Dec 2, 2024
1 parent 539aa04 commit d05b43e
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions test/opt/ir_context_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,10 +1155,7 @@ struct TargetEnvCompareTestData {

using TargetEnvCompareTest = ::testing::TestWithParam<TargetEnvCompareTestData>;

TEST_P(TargetEnvCompareTest, Case) {
// If new environments are added, then we must update the list of tests.
ASSERT_EQ(SPV_ENV_VULKAN_1_3 + 1, SPV_ENV_MAX);

TEST_P(TargetEnvCompareTest, IsTargetEnvAtLeast) {
const auto& tc = GetParam();

std::unique_ptr<Module> module(new Module());
Expand Down Expand Up @@ -1422,6 +1419,8 @@ TEST_F(IRContextTest, RemovesMultipleCapabilities) {
1);
}

// If new environments are added, then we must update the list of tests.
static_assert(SPV_ENV_VULKAN_1_4 + 1 == SPV_ENV_MAX);
INSTANTIATE_TEST_SUITE_P(
TestCase, TargetEnvCompareTest,
::testing::Values(
Expand Down Expand Up @@ -1464,6 +1463,7 @@ INSTANTIATE_TEST_SUITE_P(
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_UNIVERSAL_1_1},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_UNIVERSAL_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_UNIVERSAL_1_3},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_0},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_4, SPV_ENV_VULKAN_1_1},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_1},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_1},
Expand All @@ -1473,14 +1473,24 @@ INSTANTIATE_TEST_SUITE_P(
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_UNIVERSAL_1_3},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_UNIVERSAL_1_4},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_UNIVERSAL_1_5},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_1},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_0},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_1},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_3},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_4},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_5},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_6}));
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_6},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_VULKAN_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_0},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_1},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_3},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_4},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_5},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_6},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_3}));

} // namespace
} // namespace opt
Expand Down

0 comments on commit d05b43e

Please sign in to comment.