diff options
Diffstat (limited to '3rdparty/bgfx/3rdparty/glslang/gtests/Spv.FromFile.cpp')
-rw-r--r-- | 3rdparty/bgfx/3rdparty/glslang/gtests/Spv.FromFile.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/3rdparty/bgfx/3rdparty/glslang/gtests/Spv.FromFile.cpp b/3rdparty/bgfx/3rdparty/glslang/gtests/Spv.FromFile.cpp index d0c075156a6..ce5960c8ea5 100644 --- a/3rdparty/bgfx/3rdparty/glslang/gtests/Spv.FromFile.cpp +++ b/3rdparty/bgfx/3rdparty/glslang/gtests/Spv.FromFile.cpp @@ -63,6 +63,7 @@ std::string FileNameAsCustomTestSuffixIoMap( } using CompileVulkanToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>; +using CompileVulkanToSpirvDeadCodeElimTest = GlslangTest<::testing::TestWithParam<std::string>>; using CompileVulkanToDebugSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>; using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>; using CompileToSpirv14Test = GlslangTest<::testing::TestWithParam<std::string>>; @@ -85,6 +86,13 @@ TEST_P(CompileVulkanToSpirvTest, FromFile) Target::Spv); } +TEST_P(CompileVulkanToSpirvDeadCodeElimTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0, + Target::Spv); +} + // Compiling GLSL to SPIR-V with debug info under Vulkan semantics. Expected // to successfully generate SPIR-V. TEST_P(CompileVulkanToDebugSpirvTest, FromFile) @@ -404,6 +412,7 @@ INSTANTIATE_TEST_CASE_P( "spv.storageBuffer.vert", "spv.precise.tese", "spv.precise.tesc", + "spv.volatileAtomic.comp", "spv.vulkan100.subgroupArithmetic.comp", "spv.vulkan100.subgroupPartitioned.comp", "spv.xfb.vert", @@ -416,6 +425,23 @@ INSTANTIATE_TEST_CASE_P( FileNameAsCustomTestSuffix ); +// Cases with deliberately unreachable code. +// By default the compiler will aggressively eliminate +// unreachable merges and continues. +INSTANTIATE_TEST_CASE_P( + GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest, + ::testing::ValuesIn(std::vector<std::string>({ + "spv.dead-after-continue.vert", + "spv.dead-after-discard.frag", + "spv.dead-after-return.vert", + "spv.dead-after-loop-break.vert", + "spv.dead-after-switch-break.vert", + "spv.dead-complex-continue-after-return.vert", + "spv.dead-complex-merge-after-return.vert", + })), + FileNameAsCustomTestSuffix +); + // clang-format off INSTANTIATE_TEST_CASE_P( Glsl, CompileVulkanToDebugSpirvTest, |