From 81ecef386cddb99cbd74ee23a77e814e30c85c68 Mon Sep 17 00:00:00 2001 From: Alvin Wong Date: Mon, 7 Nov 2022 18:11:11 +0800 Subject: [PATCH 1/3] Re-enable some disconnected.cpp test cases for Clang --- test/test/disconnected.cpp | 10 ---------- test/test_win7/disconnected.cpp | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/test/test/disconnected.cpp b/test/test/disconnected.cpp index 0def1ac69..a805a408f 100644 --- a/test/test/disconnected.cpp +++ b/test/test/disconnected.cpp @@ -93,12 +93,7 @@ TEST_CASE("disconnected,handler,2") }); } -#if defined(__clang__) -// FIXME: Test is known to abort when built with Clang. (Seems to be from unhandled exception thrown on a worker thread.) -TEST_CASE("disconnected,handler,3", "[.clang-crash]") -#else TEST_CASE("disconnected,handler,3") -#endif { auto async = ActionProgress(); handle signal{ CreateEventW(nullptr, true, false, nullptr) }; @@ -132,12 +127,7 @@ TEST_CASE("disconnected,handler,4") }); } -#if defined(__clang__) -// FIXME: Test is known to abort when built with Clang. (Seems to be from unhandled exception thrown on a worker thread.) -TEST_CASE("disconnected,handler,5", "[.clang-crash]") -#else TEST_CASE("disconnected,handler,5") -#endif { auto async = OperationProgress(); handle signal{ CreateEventW(nullptr, true, false, nullptr) }; diff --git a/test/test_win7/disconnected.cpp b/test/test_win7/disconnected.cpp index a68639318..001e5e07c 100644 --- a/test/test_win7/disconnected.cpp +++ b/test/test_win7/disconnected.cpp @@ -82,12 +82,7 @@ TEST_CASE("disconnected,2") }); } -#if defined(__clang__) -// FIXME: Test is known to abort when built with Clang. (Seems to be from unhandled exception thrown on a worker thread.) -TEST_CASE("disconnected,3", "[.clang-crash]") -#else TEST_CASE("disconnected,3") -#endif { auto async = ActionProgress(); handle signal{ CreateEventW(nullptr, true, false, nullptr) }; @@ -121,12 +116,7 @@ TEST_CASE("disconnected,4") }); } -#if defined(__clang__) -// FIXME: Test is known to abort when built with Clang. (Seems to be from unhandled exception thrown on a worker thread.) -TEST_CASE("disconnected,5", "[.clang-crash]") -#else TEST_CASE("disconnected,5") -#endif { auto async = OperationProgress(); handle signal{ CreateEventW(nullptr, true, false, nullptr) }; From 94424ac9a862015549f3ed0ae06a3a1920c73e0c Mon Sep 17 00:00:00 2001 From: Alvin Wong Date: Mon, 7 Nov 2022 18:14:25 +0800 Subject: [PATCH 2/3] Call winrt::impl::invoke with namespace specified For unknown reasons, Clang resolves the `invoke` call to `std::invoke`, which breaks exception handling and causes some disconnected.cpp tests to crash. --- strings/base_coroutine_foundation.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/base_coroutine_foundation.h b/strings/base_coroutine_foundation.h index 71dbb0043..31ec1bcc4 100644 --- a/strings/base_coroutine_foundation.h +++ b/strings/base_coroutine_foundation.h @@ -414,7 +414,7 @@ namespace winrt::impl if (handler) { - invoke(handler, *this, status); + winrt::impl::invoke(handler, *this, status); } } @@ -539,7 +539,7 @@ namespace winrt::impl if (handler) { - invoke(handler, *this, status); + winrt::impl::invoke(handler, *this, status); } } From 4f85e420c244c20b9955bc45e400e497fa2b4dc5 Mon Sep 17 00:00:00 2001 From: Alvin Wong Date: Mon, 7 Nov 2022 19:54:51 +0800 Subject: [PATCH 3/3] Two more disconnected.cpp test cases are now passing on Clang --- test/test/disconnected.cpp | 10 ---------- test/test_win7/disconnected.cpp | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/test/test/disconnected.cpp b/test/test/disconnected.cpp index a805a408f..816344c35 100644 --- a/test/test/disconnected.cpp +++ b/test/test/disconnected.cpp @@ -78,12 +78,7 @@ TEST_CASE("disconnected,handler,1") source(nullptr, 123); } -#if defined(__clang__) -// FIXME: Test is known to fail with unhandled exception when built with Clang. -TEST_CASE("disconnected,handler,2", "[!shouldfail]") -#else TEST_CASE("disconnected,handler,2") -#endif { auto async = Action(); @@ -112,12 +107,7 @@ TEST_CASE("disconnected,handler,3") WaitForSingleObject(signal.get(), INFINITE); } -#if defined(__clang__) -// FIXME: Test is known to fail with unhandled exception when built with Clang. -TEST_CASE("disconnected,handler,4", "[!shouldfail]") -#else TEST_CASE("disconnected,handler,4") -#endif { auto async = Operation(); diff --git a/test/test_win7/disconnected.cpp b/test/test_win7/disconnected.cpp index 001e5e07c..17411e99e 100644 --- a/test/test_win7/disconnected.cpp +++ b/test/test_win7/disconnected.cpp @@ -67,12 +67,7 @@ TEST_CASE("disconnected,1") source(nullptr, 123); } -#if defined(__clang__) -// FIXME: Test is known to fail with unhandled exception when built with Clang. -TEST_CASE("disconnected,2", "[!shouldfail]") -#else TEST_CASE("disconnected,2") -#endif { auto async = Action(); @@ -101,12 +96,7 @@ TEST_CASE("disconnected,3") WaitForSingleObject(signal.get(), INFINITE); } -#if defined(__clang__) -// FIXME: Test is known to fail with unhandled exception when built with Clang. -TEST_CASE("disconnected,4", "[!shouldfail]") -#else TEST_CASE("disconnected,4") -#endif { auto async = Operation();