diff options
3 files changed, 10 insertions, 13 deletions
diff --git a/compiler-rt/test/asan/TestCases/Windows/bind_io_completion_callback.cc b/compiler-rt/test/asan/TestCases/Windows/bind_io_completion_callback.cc index c062a799fdc..44b92ab9146 100644 --- a/compiler-rt/test/asan/TestCases/Windows/bind_io_completion_callback.cc +++ b/compiler-rt/test/asan/TestCases/Windows/bind_io_completion_callback.cc @@ -6,8 +6,7 @@ // the rest is built with Clang. This represents the typical scenario when we // build a large project using "clang-cl -fallback -fsanitize=address". // -// RUN: cl -c %s -Fo%t.obj -// RUN: %clangxx_asan -o %t.exe %s %t.obj +// RUN: %clangxx_asan %s -o %t.exe // RUN: %run %t.exe 2>&1 | FileCheck %s #include <windows.h> @@ -15,7 +14,6 @@ void ThrowAndCatch(); -#if !defined(__clang__) __declspec(noinline) void Throw() { fprintf(stderr, "Throw\n"); @@ -32,7 +30,6 @@ void ThrowAndCatch() { // CHECK: Catch } } -#else char buffer[65536]; HANDLE done; @@ -62,9 +59,8 @@ int main(int argc, char **argv) { GetLastError() != ERROR_IO_PENDING) return 4; - if (WAIT_OBJECT_0 != WaitForSingleObject(done, INFINITE)) + if (WAIT_OBJECT_0 != WaitForSingleObject(done, 10 * 1000)) return 5; fprintf(stderr, "Done!\n"); // CHECK: Done! } -#endif diff --git a/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item.cc b/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item.cc index d99ea6fc2e4..2a0b622f621 100644 --- a/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item.cc +++ b/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item.cc @@ -6,8 +6,7 @@ // the rest is built with Clang. This represents the typical scenario when we // build a large project using "clang-cl -fallback -fsanitize=address". // -// RUN: cl -c %s -Fo%t.obj -// RUN: %clangxx_asan -o %t.exe %s %t.obj +// RUN: %clangxx_asan %s -o %t.exe // RUN: %run %t.exe 2>&1 | FileCheck %s #include <windows.h> @@ -15,7 +14,6 @@ void ThrowAndCatch(); -#if !defined(__clang__) __declspec(noinline) void Throw() { fprintf(stderr, "Throw\n"); @@ -32,7 +30,6 @@ void ThrowAndCatch() { // CHECK: Catch } } -#else HANDLE done; @@ -47,9 +44,13 @@ int main(int argc, char **argv) { if (!done) return 1; QueueUserWorkItem(&work_item, nullptr, 0); - if (WAIT_OBJECT_0 != WaitForSingleObject(done, INFINITE)) + unsigned wait_result = WaitForSingleObject(done, 10 * 1000); + if (wait_result == WAIT_ABANDONED) + fprintf(stderr, "Timed out\n"); + if (wait_result != WAIT_OBJECT_0) { + fprintf(stderr, "Wait for work item failed\n"); return 2; + } fprintf(stderr, "Done!\n"); // CHECK: Done! } -#endif diff --git a/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item_report.cc b/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item_report.cc index f0d3d3e7cbc..e500a919fda 100644 --- a/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item_report.cc +++ b/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item_report.cc @@ -24,6 +24,6 @@ int main(int argc, char **argv) { return 1; // CHECK-NOT: Thread T1 created QueueUserWorkItem(&work_item, nullptr, 0); - if (WAIT_OBJECT_0 != WaitForSingleObject(done, INFINITE)) + if (WAIT_OBJECT_0 != WaitForSingleObject(done, 10 * 1000)) return 2; } |