diff --git a/compiler-rt/test/asan/TestCases/Windows/delay_dbghelp.cpp b/compiler-rt/test/asan/TestCases/Windows/delay_dbghelp.cpp --- a/compiler-rt/test/asan/TestCases/Windows/delay_dbghelp.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/delay_dbghelp.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - // Build an executable with ASan, then extract the DLLs that it depends on. -// RUN: %clang_cl_asan %s -Fe%t.exe +// RUN: %clang_cl_asan %s %Fe%t.exe // RUN: llvm-readobj --coff-imports %t.exe | grep Name: | sed -e 's/ *Name: *//' > %t // // Make sure the binary doesn't depend on dbghelp directly. diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_aligned_mallocs.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_aligned_mallocs.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_aligned_mallocs.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_aligned_mallocs.cpp @@ -1,12 +1,15 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: %run %t %t.dll | FileCheck %s #include #include +#ifdef __MINGW32__ +// FIXME: remove after mingw-w64 adds this declaration. +extern "C" size_t __cdecl _aligned_msize(void *_Memory, size_t _Alignment, size_t _Offset); +#endif + #define CHECK_ALIGNED(ptr,alignment) \ do { \ if (((uintptr_t)(ptr) % (alignment)) != 0) \ diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_allocators_sanity.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_allocators_sanity.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_allocators_sanity.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_allocators_sanity.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: %run %t %t.dll | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memchr.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memchr.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memchr.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memchr.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s // On windows 64-bit, the memchr function is written in assembly and is not diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_intercept_strlen.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_intercept_strlen.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_intercept_strlen.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_intercept_strlen.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_malloc_uaf.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_malloc_uaf.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_malloc_uaf.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_malloc_uaf.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_noreturn.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_noreturn.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_noreturn.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_noreturn.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s __attribute__((noinline)) diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s extern "C" __declspec(dllexport) diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s struct C { diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_poison_unpoison.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_poison_unpoison.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_poison_unpoison.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_poison_unpoison.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include @@ -26,12 +24,12 @@ should_crash(&buffer[96]); // CHECK: AddressSanitizer: use-after-poison on address [[ADDR:0x[0-9a-f]+]] // CHECK-NEXT: WRITE of size 1 at [[ADDR]] thread T0 -// CHECK-NEXT: should_crash{{.*}}\dll_poison_unpoison.cpp -// CHECK-NEXT: test_function{{.*}}\dll_poison_unpoison.cpp:[[@LINE-4]] +// CHECK-NEXT: should_crash{{.*[\\/]}}dll_poison_unpoison.cpp +// CHECK-NEXT: test_function{{.*[\\/]}}dll_poison_unpoison.cpp:[[@LINE-4]] // CHECK-NEXT: main // // CHECK: [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:.*]] in frame -// CHECK-NEXT: test_function{{.*}}\dll_poison_unpoison.cpp +// CHECK-NEXT: test_function{{.*[\\/]}}dll_poison_unpoison.cpp // CHECK: 'buffer'{{.*}} <== Memory access at offset [[OFFSET]] is inside this variable return 0; } diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp @@ -1,9 +1,7 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t %t.dll 2>&1 | FileCheck %s -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll -fsanitize-address-use-after-return=always +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll -fsanitize-address-use-after-return=always // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t -// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll +// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t +// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_unload.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_unload.cpp --- a/compiler-rt/test/asan/TestCases/Windows/dll_unload.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_unload.cpp @@ -1,10 +1,8 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - #include #include -// RUN: %clang_cl_asan -LD /Od -DDLL %s -Fe%t.dll -// RUN: %clang_cl /Od -DEXE %s -Fe%te.exe +// RUN: %clang_cl_asan %LD %Od -DDLL %s %Fe%t.dll +// RUN: %clang_cl %Od -DEXE %s %Fe%te.exe // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %te.exe %t.dll 2>&1 | FileCheck %s // REQUIRES: asan-dynamic-runtime // REQUIRES: asan-32-bits diff --git a/compiler-rt/test/asan/TestCases/Windows/heapalloc.cpp b/compiler-rt/test/asan/TestCases/Windows/heapalloc.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heapalloc.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heapalloc.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - // UNSUPPORTED: asan-64-bits -// RUN: %clang_cl_asan -Od %s -Fe%t +// RUN: %clang_cl_asan %Od %s %Fe%t // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_double_free.cpp b/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_double_free.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_double_free.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_double_free.cpp @@ -1,10 +1,8 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - #include #include -// RUN: %clang_cl_asan -LD /Od -DDLL %s -Fe%t.dll -// RUN: %clang_cl /Od -DEXE %s -Fe%te.exe +// RUN: %clang_cl_asan %LD %Od -DDLL %s %Fe%t.dll +// RUN: %clang_cl %Od -DEXE %s %Fe%te.exe // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %te.exe %t.dll 2>&1 | FileCheck %s // REQUIRES: asan-dynamic-runtime // REQUIRES: asan-32-bits diff --git a/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_unload_realloc_uaf.cpp b/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_unload_realloc_uaf.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_unload_realloc_uaf.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_unload_realloc_uaf.cpp @@ -1,10 +1,8 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - #include #include -// RUN: %clang_cl_asan -LD /Od -DDLL %s -Fe%t.dll -// RUN: %clang_cl /Od -DEXE %s -Fe%te.exe +// RUN: %clang_cl_asan %LD %Od -DDLL %s %Fe%t.dll +// RUN: %clang_cl %Od -DEXE %s %Fe%te.exe // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %te.exe %t.dll 2>&1 | FileCheck %s // REQUIRES: asan-dynamic-runtime // REQUIRES: asan-32-bits diff --git a/compiler-rt/test/asan/TestCases/Windows/heapalloc_doublefree.cpp b/compiler-rt/test/asan/TestCases/Windows/heapalloc_doublefree.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heapalloc_doublefree.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heapalloc_doublefree.cpp @@ -1,6 +1,4 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %s -Fe%t +// RUN: %clang_cl_asan %Od %s %Fe%t // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s // UNSUPPORTED: asan-64-bits #include diff --git a/compiler-rt/test/asan/TestCases/Windows/heapalloc_flags_fallback.cpp b/compiler-rt/test/asan/TestCases/Windows/heapalloc_flags_fallback.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heapalloc_flags_fallback.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heapalloc_flags_fallback.cpp @@ -1,6 +1,4 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %s -Fe%t +// RUN: %clang_cl_asan %Od %s %Fe%t // RUN: %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=windows_hook_rtl_allocators=true %run %t 2>&1 | FileCheck %s // UNSUPPORTED: asan-64-bits diff --git a/compiler-rt/test/asan/TestCases/Windows/heapalloc_huge.cpp b/compiler-rt/test/asan/TestCases/Windows/heapalloc_huge.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heapalloc_huge.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heapalloc_huge.cpp @@ -1,6 +1,4 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %s -Fe%t +// RUN: %clang_cl_asan %Od %s %Fe%t // RUN: %env_asan_opts=allocator_may_return_null=true %run %t // RUN: %env_asan_opts=allocator_may_return_null=true:windows_hook_rtl_allocators=true %run %t // UNSUPPORTED: asan-64-bits diff --git a/compiler-rt/test/asan/TestCases/Windows/heapalloc_rtl_transfer.cpp b/compiler-rt/test/asan/TestCases/Windows/heapalloc_rtl_transfer.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heapalloc_rtl_transfer.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heapalloc_rtl_transfer.cpp @@ -1,5 +1,3 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - #include "sanitizer\allocator_interface.h" #include #include @@ -97,4 +95,4 @@ // CHECK-NOT: Assertion failed: // CHECK-NOT: AddressSanitizer -// CHECK: Success \ No newline at end of file +// CHECK: Success diff --git a/compiler-rt/test/asan/TestCases/Windows/heapalloc_transfer.cpp b/compiler-rt/test/asan/TestCases/Windows/heapalloc_transfer.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heapalloc_transfer.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heapalloc_transfer.cpp @@ -1,5 +1,3 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - #include "sanitizer\allocator_interface.h" #include #include @@ -27,4 +25,4 @@ // CHECK-NOT: assert // CHECK-NOT: AddressSanitizer -// CHECK: Success \ No newline at end of file +// CHECK: Success diff --git a/compiler-rt/test/asan/TestCases/Windows/heapalloc_uaf.cpp b/compiler-rt/test/asan/TestCases/Windows/heapalloc_uaf.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heapalloc_uaf.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heapalloc_uaf.cpp @@ -1,6 +1,4 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %s -Fe%t +// RUN: %clang_cl_asan %Od %s %Fe%t // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s // UNSUPPORTED: asan-64-bits #include diff --git a/compiler-rt/test/asan/TestCases/Windows/heapalloc_zero_size.cpp b/compiler-rt/test/asan/TestCases/Windows/heapalloc_zero_size.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heapalloc_zero_size.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heapalloc_zero_size.cpp @@ -1,9 +1,7 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan /Od -o %t %s +// RUN: %clang_cl_asan %Od -o %t %s // RUN: %env_asan_opts=windows_hook_rtl_allocators=true %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=windows_hook_rtl_allocators=false %run %t 2>&1 | FileCheck %s -// RUN: %clang_cl /Od -o %t %s +// RUN: %clang_cl %Od -o %t %s // RUN: %run %t 2>&1 | FileCheck %s // UNSUPPORTED: asan-64-bits #include diff --git a/compiler-rt/test/asan/TestCases/Windows/heaprealloc.cpp b/compiler-rt/test/asan/TestCases/Windows/heaprealloc.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heaprealloc.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heaprealloc.cpp @@ -1,6 +1,4 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %s -Fe%t +// RUN: %clang_cl_asan %Od %s %Fe%t // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s // UNSUPPORTED: asan-64-bits #include diff --git a/compiler-rt/test/asan/TestCases/Windows/heaprealloc_alloc_zero.cpp b/compiler-rt/test/asan/TestCases/Windows/heaprealloc_alloc_zero.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heaprealloc_alloc_zero.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heaprealloc_alloc_zero.cpp @@ -1,6 +1,4 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan /Od /MT -o %t %s +// RUN: %clang_cl_asan %Od %MT -o %t %s // RUN: %env_asan_opts=windows_hook_rtl_allocators=true %run %t 2>&1 | FileCheck %s // UNSUPPORTED: asan-64-bits #include @@ -57,4 +55,4 @@ // CHECK: allocated! // CHECK-NOT: heap-buffer-overflow // CHECK-NOT: AddressSanitizer -// CHECK-NOT: HeapAlloc size failure! \ No newline at end of file +// CHECK-NOT: HeapAlloc size failure! diff --git a/compiler-rt/test/asan/TestCases/Windows/heaprealloc_zero_size.cpp b/compiler-rt/test/asan/TestCases/Windows/heaprealloc_zero_size.cpp --- a/compiler-rt/test/asan/TestCases/Windows/heaprealloc_zero_size.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/heaprealloc_zero_size.cpp @@ -1,9 +1,7 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan /Od -o %t %s +// RUN: %clang_cl_asan %Od -o %t %s // RUN: %env_asan_opts=windows_hook_rtl_allocators=true %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=windows_hook_rtl_allocators=false %run %t 2>&1 | FileCheck %s -// RUN: %clang_cl /Od -o %t %s +// RUN: %clang_cl %Od -o %t %s // RUN: %run %t 2>&1 | FileCheck %s // UNSUPPORTED: asan-64-bits #include @@ -22,4 +20,4 @@ // CHECK-NOT: double-free // CHECK-NOT: AddressSanitizer -// CHECK: passed! \ No newline at end of file +// CHECK: passed! diff --git a/compiler-rt/test/asan/TestCases/Windows/recalloc_sanity.cpp b/compiler-rt/test/asan/TestCases/Windows/recalloc_sanity.cpp --- a/compiler-rt/test/asan/TestCases/Windows/recalloc_sanity.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/recalloc_sanity.cpp @@ -1,5 +1,3 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - // Workaround for "LINK : fatal error LNK1318: Unexpected PDB error" // RUN: rm -f %t.pdb @@ -39,4 +37,4 @@ } // CHECK-NOT: Assertion -// CHECK: passed \ No newline at end of file +// CHECK: passed diff --git a/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cpp b/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cpp --- a/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cpp @@ -1,8 +1,6 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - // Make sure we can handle reloading the same DLL multiple times. -// RUN: %clang_cl_asan -LD -Od -DDLL %s -Fe%t.dll -// RUN: %clang_cl_asan -Od -DEXE %s -Fe%te.exe +// RUN: %clang_cl_asan %LD %Od -DDLL %s %Fe%t.dll +// RUN: %clang_cl_asan %Od -DEXE %s %Fe%te.exe // RUN: %env_asan_opts=report_globals=1 %run %te.exe %t.dll 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cpp b/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cpp --- a/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -LD -Od -DDLL %s -Fe%t.dll -// RUN: %clang_cl_asan -Od -DEXE %s -Fe%te.exe +// RUN: %clang_cl_asan %LD %Od -DDLL %s %Fe%t.dll +// RUN: %clang_cl_asan %Od -DEXE %s %Fe%te.exe // RUN: %env_asan_opts=report_globals=2 %run %te.exe %t.dll 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap.cpp b/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap.cpp --- a/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap.cpp @@ -1,6 +1,4 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %s -Fe%t /MD +// RUN: %clang_cl_asan %Od %s %Fe%t %MD // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s // UNSUPPORTED: asan-64-bits // REQUIRES: asan-rtl-heap-interception diff --git a/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_double_free.cpp b/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_double_free.cpp --- a/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_double_free.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_double_free.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -LD /Od -DDLL %s -Fe%t.dll -// RUN: %clang_cl /Od -DEXE %s -Fe%te.exe +// RUN: %clang_cl_asan %LD %Od -DDLL %s %Fe%t.dll +// RUN: %clang_cl %Od -DEXE %s %Fe%te.exe // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %te.exe %t.dll 2>&1 | FileCheck %s // REQUIRES: asan-dynamic-runtime // REQUIRES: asan-32-bits diff --git a/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_realloc.cpp b/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_realloc.cpp --- a/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_realloc.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_realloc.cpp @@ -1,7 +1,5 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -LD /Od -DDLL %s -Fe%t.dll -// RUN: %clang_cl /Od -DEXE %s -Fe%te.exe +// RUN: %clang_cl_asan %LD %Od -DDLL %s %Fe%t.dll +// RUN: %clang_cl %Od -DEXE %s %Fe%te.exe // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %te.exe %t.dll 2>&1 | FileCheck %s // REQUIRES: asan-dynamic-runtime // REQUIRES: asan-32-bits diff --git a/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_flags_fallback.cpp b/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_flags_fallback.cpp --- a/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_flags_fallback.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_flags_fallback.cpp @@ -1,6 +1,4 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %s -Fe%t /MD +// RUN: %clang_cl_asan %Od %s %Fe%t %MD // RUN: %env_asan_opts=windows_hook_rtl_allocators=true %run %t 2>&1 | FileCheck %s // UNSUPPORTED: asan-64-bits // REQUIRES: asan-rtl-heap-interception diff --git a/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_zero.cpp b/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_zero.cpp --- a/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_zero.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_zero.cpp @@ -1,6 +1,4 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %s -Fe%t /MD +// RUN: %clang_cl_asan %Od %s %Fe%t %MD // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s // UNSUPPORTED: asan-64-bits // REQUIRES: asan-rtl-heap-interception diff --git a/compiler-rt/test/asan/TestCases/Windows/sanitizer_purge.cpp b/compiler-rt/test/asan/TestCases/Windows/sanitizer_purge.cpp --- a/compiler-rt/test/asan/TestCases/Windows/sanitizer_purge.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/sanitizer_purge.cpp @@ -1,11 +1,9 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - #include #include #include #include -// RUN: %clang_cl_asan -Od %s -Fe%t +// RUN: %clang_cl_asan %Od %s %Fe%t // RUN: %t // REQUIRES: asan-64-bits @@ -30,4 +28,4 @@ } return 0; -} \ No newline at end of file +} diff --git a/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp b/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp --- a/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp @@ -1,8 +1,7 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %s -Fe%t +// RUN: %clang_cl_asan %Od %s %Fe%t // RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clang_cl_asan -Od %s -Fe%t -fsanitize-address-use-after-return=always + +// RUN: %clang_cl_asan %Od %s %Fe%t -fsanitize-address-use-after-return=always // RUN: not %run %t 2>&1 | FileCheck %s char *x; diff --git a/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp b/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp --- a/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp @@ -1,8 +1,6 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - // Make sure symbolization works even if the path to the .exe file changes. // RUN: mkdir %t || true -// RUN: %clang_cl_asan -Od %s -Fe%t/symbols_path.exe +// RUN: %clang_cl_asan %Od %s %Fe%t/symbols_path.exe // RUN: not %run %t/symbols_path.exe 2>&1 | FileCheck %s // RUN: mkdir %t2 || true // RUN: mv %t/* %t2 diff --git a/compiler-rt/test/asan/TestCases/Windows/user-exception.cpp b/compiler-rt/test/asan/TestCases/Windows/user-exception.cpp --- a/compiler-rt/test/asan/TestCases/Windows/user-exception.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/user-exception.cpp @@ -1,6 +1,4 @@ -// UNSUPPORTED: target={{.*-windows-gnu}} - -// RUN: %clang_cl_asan -Od %s -Fe%t +// RUN: %clang_cl_asan %Od %s %Fe%t // RUN: env ASAN_OPTIONS=handle_segv=0 %run %t 2>&1 | FileCheck %s --check-prefix=USER // RUN: env ASAN_OPTIONS=handle_segv=1 not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN // Test the default. diff --git a/compiler-rt/test/asan/lit.cfg.py b/compiler-rt/test/asan/lit.cfg.py --- a/compiler-rt/test/asan/lit.cfg.py +++ b/compiler-rt/test/asan/lit.cfg.py @@ -166,6 +166,9 @@ config.substitutions.append( ("%clang_cl_asan ", clang_cl_asan_invocation) ) config.substitutions.append( ("%Od", "-Od") ) config.substitutions.append( ("%Fe", "-Fe") ) + config.substitutions.append( ("%LD", "-LD") ) + config.substitutions.append( ("%MD", "-MD") ) + config.substitutions.append( ("%MT", "-MT") ) base_lib = os.path.join(config.compiler_rt_libdir, "clang_rt.asan%%s%s.lib" % config.target_suffix) config.substitutions.append( ("%asan_lib", base_lib % "") ) @@ -178,6 +181,9 @@ config.substitutions.append( ("%clang_cl_asan ", build_invocation(clang_asan_cxxflags)) ) config.substitutions.append( ("%Od", "-O0") ) config.substitutions.append( ("%Fe", "-o") ) + config.substitutions.append( ("%LD", "-shared") ) + config.substitutions.append( ("%MD", "") ) + config.substitutions.append( ("%MT", "") ) # FIXME: De-hardcode this path. asan_source_dir = os.path.join(