Skip to content

Commit

Permalink
Only test SEH handling with MSVC
Browse files Browse the repository at this point in the history
MinGW doesn't support `__try` and friends at all, while Clang
only supports it partially, and the test would require some
changes to make it work there. Since this is only a test, we can
afford to keep it MSVC-only.

Closes #2447
  • Loading branch information
horenmar committed Jun 5, 2022
1 parent 3644b41 commit 4fe06b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/SelfTest/UsageTests/Misc.tests.cpp
Expand Up @@ -508,7 +508,8 @@ TEMPLATE_TEST_CASE_SIG("#1954 - 7 arg template test case sig compiles", "[regres
TEST_CASE("Same test name but with different tags is fine", "[.approvals][some-tag]") {}
TEST_CASE("Same test name but with different tags is fine", "[.approvals][other-tag]") {}

#if defined(CATCH_PLATFORM_WINDOWS)
// MinGW doesn't support __try, and Clang has only very partial support
#if defined(_MSC_VER)
void throw_and_catch()
{
__try {
Expand Down Expand Up @@ -549,4 +550,4 @@ TEST_CASE("Validate SEH behavior - no crash for stack unwinding", "[approvals][!
throw 1;
}

#endif // CATCH_PLATFORM_WINDOWS
#endif // _MSC_VER

0 comments on commit 4fe06b8

Please sign in to comment.