[compiler-rt][asan][test] Fix lit test config on MinGW
authorAlvin Wong <alvin@alvinhc.com>
Mon, 27 Mar 2023 14:48:17 +0000 (22:48 +0800)
committerAlvin Wong <alvin@alvinhc.com>
Sat, 1 Apr 2023 17:06:15 +0000 (01:06 +0800)
MinGW is GCC-like and does not support clang-cl, so clean up the lit cfg
to reflect that. Also mark all Windows test cases using clang-cl as
UNSUPPORTED for now. We should probably adapt most of these test cases
to use the GCC-like clang driver, but that will be for later.

Differential Revision: https://reviews.llvm.org/D147057

116 files changed:
compiler-rt/test/asan/TestCases/Windows/aligned_mallocs.cpp
compiler-rt/test/asan/TestCases/Windows/allocators_sanity.cpp
compiler-rt/test/asan/TestCases/Windows/beginthreadex.cpp
compiler-rt/test/asan/TestCases/Windows/bitfield.cpp
compiler-rt/test/asan/TestCases/Windows/bitfield_uaf.cpp
compiler-rt/test/asan/TestCases/Windows/breakpoint.cpp
compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cpp
compiler-rt/test/asan/TestCases/Windows/calloc_uaf.cpp
compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp
compiler-rt/test/asan/TestCases/Windows/crt_initializers.cpp
compiler-rt/test/asan/TestCases/Windows/delay_dbghelp.cpp
compiler-rt/test/asan/TestCases/Windows/demangled_names.cpp
compiler-rt/test/asan/TestCases/Windows/dll_aligned_mallocs.cpp
compiler-rt/test/asan/TestCases/Windows/dll_allocators_sanity.cpp
compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp
compiler-rt/test/asan/TestCases/Windows/dll_cerr.cpp
compiler-rt/test/asan/TestCases/Windows/dll_control_c.cpp
compiler-rt/test/asan/TestCases/Windows/dll_global_dead_strip.c
compiler-rt/test/asan/TestCases/Windows/dll_heap_allocation.cpp
compiler-rt/test/asan/TestCases/Windows/dll_host.cpp
compiler-rt/test/asan/TestCases/Windows/dll_intercept_memchr.cpp
compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cpp
compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cpp
compiler-rt/test/asan/TestCases/Windows/dll_intercept_memset.cpp
compiler-rt/test/asan/TestCases/Windows/dll_intercept_strlen.cpp
compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp
compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/dll_malloc_uaf.cpp
compiler-rt/test/asan/TestCases/Windows/dll_noreturn.cpp
compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cpp
compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/dll_poison_unpoison.cpp
compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cpp
compiler-rt/test/asan/TestCases/Windows/dll_seh.cpp
compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp
compiler-rt/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/dll_unload.cpp
compiler-rt/test/asan/TestCases/Windows/double_free.cpp
compiler-rt/test/asan/TestCases/Windows/double_operator_delete.cpp
compiler-rt/test/asan/TestCases/Windows/global_const_string.cpp
compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cpp
compiler-rt/test/asan/TestCases/Windows/global_dead_strip.c
compiler-rt/test/asan/TestCases/Windows/heapalloc.cpp
compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_double_free.cpp
compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_unload_realloc_uaf.cpp
compiler-rt/test/asan/TestCases/Windows/heapalloc_doublefree.cpp
compiler-rt/test/asan/TestCases/Windows/heapalloc_flags_fallback.cpp
compiler-rt/test/asan/TestCases/Windows/heapalloc_huge.cpp
compiler-rt/test/asan/TestCases/Windows/heapalloc_rtl_transfer.cpp
compiler-rt/test/asan/TestCases/Windows/heapalloc_sanity.cpp
compiler-rt/test/asan/TestCases/Windows/heapalloc_transfer.cpp
compiler-rt/test/asan/TestCases/Windows/heapalloc_uaf.cpp
compiler-rt/test/asan/TestCases/Windows/heapalloc_zero_size.cpp
compiler-rt/test/asan/TestCases/Windows/heaprealloc.cpp
compiler-rt/test/asan/TestCases/Windows/heaprealloc_alloc_zero.cpp
compiler-rt/test/asan/TestCases/Windows/heaprealloc_zero_size.cpp
compiler-rt/test/asan/TestCases/Windows/hello_world.cpp
compiler-rt/test/asan/TestCases/Windows/illegal_instruction.cpp
compiler-rt/test/asan/TestCases/Windows/integer_divide_by_zero.cpp
compiler-rt/test/asan/TestCases/Windows/intercept_memcpy.cpp
compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cpp
compiler-rt/test/asan/TestCases/Windows/intercept_strlen.cpp
compiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cpp
compiler-rt/test/asan/TestCases/Windows/iostream_sbo.cpp
compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cpp
compiler-rt/test/asan/TestCases/Windows/malloc_uaf.cpp
compiler-rt/test/asan/TestCases/Windows/null_deref_multiple_dlls.cpp
compiler-rt/test/asan/TestCases/Windows/oom.cpp
compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cpp
compiler-rt/test/asan/TestCases/Windows/operator_array_new_uaf.cpp
compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/operator_delete_wrong_argument.cpp
compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cpp
compiler-rt/test/asan/TestCases/Windows/operator_new_uaf.cpp
compiler-rt/test/asan/TestCases/Windows/queue_user_work_item_report.cpp
compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cpp
compiler-rt/test/asan/TestCases/Windows/realloc_uaf.cpp
compiler-rt/test/asan/TestCases/Windows/recalloc_sanity.cpp
compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cpp
compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cpp
compiler-rt/test/asan/TestCases/Windows/rtlallocateheap.cpp
compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_double_free.cpp
compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_realloc.cpp
compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_flags_fallback.cpp
compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_zero.cpp
compiler-rt/test/asan/TestCases/Windows/sanitizer_purge.cpp
compiler-rt/test/asan/TestCases/Windows/seh.cpp
compiler-rt/test/asan/TestCases/Windows/shadow_conflict_32.cpp
compiler-rt/test/asan/TestCases/Windows/shadow_mapping_failure.cpp
compiler-rt/test/asan/TestCases/Windows/sse_misalignment.cpp
compiler-rt/test/asan/TestCases/Windows/stack_array_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/stack_array_right_oob.cpp
compiler-rt/test/asan/TestCases/Windows/stack_array_sanity.cpp
compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp
compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp
compiler-rt/test/asan/TestCases/Windows/thread_simple.cpp
compiler-rt/test/asan/TestCases/Windows/thread_stack_array_left_oob.cpp
compiler-rt/test/asan/TestCases/Windows/thread_stack_array_right_oob.cpp
compiler-rt/test/asan/TestCases/Windows/thread_stack_reuse.cpp
compiler-rt/test/asan/TestCases/Windows/thread_stress.cpp
compiler-rt/test/asan/TestCases/Windows/thread_suspended.cpp
compiler-rt/test/asan/TestCases/Windows/tls_init.cpp
compiler-rt/test/asan/TestCases/Windows/use_after_realloc.cpp
compiler-rt/test/asan/TestCases/Windows/use_after_return_linkage.cpp
compiler-rt/test/asan/TestCases/Windows/user-exception.cpp
compiler-rt/test/asan/TestCases/Windows/windows_h.cpp
compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_heap.cpp
compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_stack.cpp
compiler-rt/test/asan/lit.cfg.py
compiler-rt/test/lit.common.cfg.py

index 2738b4e..e39b7fb 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %run %t | FileCheck %s
 
index 05d72a5..eda43d3 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %run %t
 
index 174c92d..02922f6 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %run %t
 
index 9095b80..cc9a8df 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 1c9e8c4..1ff8d02 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %env_asan_opts=handle_sigill=1 not %run %t 2>&1 | FileCheck %s
 
index b83d635..4a8c6b6 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 504b673..7baf3e1 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 54577f0..facc059 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index f2bfaad..2a880ba 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // Test that coverage and MSVC CRT stdio work from a DLL. This ensures that the
 // __local_stdio_printf_options function isn't instrumented for coverage.
 
index f33c163..a37d47a 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %run %t | FileCheck %s
 
index 33981bd..0cad545 100644 (file)
@@ -1,3 +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: llvm-readobj --coff-imports %t.exe | grep Name: | sed -e 's/ *Name: *//' > %t
index f6325f3..d457d4d 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 //
index a6a1a3b..c180950 100644 (file)
@@ -1,3 +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: %run %t %t.dll | FileCheck %s
index 9e0543c..8e4e71b 100644 (file)
@@ -1,3 +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: %run %t %t.dll | FileCheck %s
index 96fae6b..0346ecf 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // Just make sure we can link an implib into another DLL
 // This used to fail between r212699 and r212814.
 // RUN: %clang_cl_asan -DCONFIG=1 %s -c -Fo%t.1.obj
index 1e09678..ff84090 100644 (file)
@@ -1,3 +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: %run %t %t.dll 2>&1 | FileCheck %s
index e302763..f5127e7 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
 // RUN: %clang_cl_asan -LD -O2 %s -Fe%t.dll
 // RUNX: %run %t %t.dll 2>&1 | FileCheck %s
index e5716be..1871c00 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
 //
 // RUN: %clang_cl_asan /Gw -LD -Od %s -Fe%t.dll
index b4df9d4..40e4833 100644 (file)
@@ -1,3 +1,4 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
 
 // RUN: %clang_cl -LD %s -Fe%t.dll -DHEAP_LIBRARY -MD
 // RUN: %clang_cl %s %t.lib -Fe%t -fsanitize=address -MT
index 8032201..0757af9 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // This is a host program for DLL tests.
 //
 // Just make sure we can compile this.
index 093134f..3db8943 100644 (file)
@@ -1,3 +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: not %run %t %t.dll 2>&1 | FileCheck %s
index 7b4fbb6..6ab61ae 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
 // RUN: %clang_cl_asan -Wno-fortify-source -LD -Od %s -Fe%t.dll
 // RUN: not %run %t %t.dll 2>&1 | FileCheck %s
index f2b8cdb..849c660 100644 (file)
@@ -1,3 +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: not %run %t %t.dll 2>&1 | FileCheck %s
index 789a199..222c143 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
 // RUN: %clang_cl_asan -Wno-fortify-source -LD -Od %s -Fe%t.dll
 // RUN: not %run %t %t.dll 2>&1 | FileCheck %s
index e15dec1..1bad2f8 100644 (file)
@@ -1,3 +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: not %run %t %t.dll 2>&1 | FileCheck %s
index 788488d..c047a52 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // Make sure we can link a DLL with large functions which would mean
 // functions such as __asan_loadN and __asan_storeN will be called
 // from the DLL.  We simulate the large function with
index 194f31f..f2216ce 100644 (file)
@@ -1,3 +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: not %run %t %t.dll 2>&1 | FileCheck %s
index 290541f..bbf6f38 100644 (file)
@@ -1,3 +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: not %run %t %t.dll 2>&1 | FileCheck %s
index 8b8e4d1..d502575 100644 (file)
@@ -1,3 +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: not %run %t %t.dll 2>&1 | FileCheck %s
index 0c826a0..a3242c9 100644 (file)
@@ -1,3 +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: not %run %t %t.dll 2>&1 | FileCheck %s
index b5e980a..34c29b0 100644 (file)
@@ -1,3 +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: not %run %t %t.dll 2>&1 | FileCheck %s
index 5e34071..bdf3fe3 100644 (file)
@@ -1,3 +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: not %run %t %t.dll 2>&1 | FileCheck %s
index 6a23da7..f20c5b1 100644 (file)
@@ -1,3 +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: not %run %t %t.dll 2>&1 | FileCheck %s
index 0a8e3d8..c9fc166 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -LD -Od -DDLL %s -Fe%t.dll
 // RUN: %clang_cl_asan -Od -DEXE %s %t.lib -Fe%te.exe
 // RUN: %env_asan_opts=report_globals=2 %run %te.exe 2>&1 | FileCheck %s
index 3651463..009351d 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
 //
 // Check both -GS and -GS- builds:
index e2c295d..6aa9721 100644 (file)
@@ -1,3 +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: %env_asan_opts=detect_stack_use_after_return=1 not %run %t %t.dll 2>&1 | FileCheck %s
index c25da90..da2a911 100644 (file)
@@ -1,3 +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: not %run %t %t.dll 2>&1 | FileCheck %s
index 6843746..59a2641 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 168e531..55304e2 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 546419d..10437a6 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %run %t | FileCheck %s
 
index adc9b24..3e5bd1d 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index a13447d..32d4a18 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan /Gw /Od %s /Fe%t.exe
 // RUN: %env_asan_opts=report_globals=2 %t.exe 2>&1 | FileCheck %s --check-prefix=NOSTRIP
 // RUN: %clang_cl_asan /Gw /O2 %s /Fe%t.exe -link -opt:ref
index cb07b8f..3deaa64 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // UNSUPPORTED: asan-64-bits
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s
index 3394a92..7f7b51a 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index e040fd5..d126c75 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index 3a6ce78..8514be3 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index a36e594..c65ece7 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 #include "sanitizer\allocator_interface.h"
 #include <cassert>
 #include <stdio.h>
index a2ee686..434de5c 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %run %t 2>&1 | FileCheck %s
 #include <stdio.h>
index 497d36b..fa9f937 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 #include "sanitizer\allocator_interface.h"
 #include <cassert>
 #include <stdio.h>
index e0f1f86..34f3015 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index 40396ed..f1345f6 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index add644c..0073ce0 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index 7b1272e..1595729 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index 96bc9b9..cc1f1f0 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index 0caeb35..546c37e 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %run %t | FileCheck %s
 
index 2b6b05c..eb6c64a 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %env_asan_opts=handle_sigill=1 not %run %t 2>&1 | FileCheck %s
 
index 9a0f97a..d7728e3 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %env_asan_opts=handle_sigfpe=1 not %run %t 2>&1 | FileCheck %s
 
index db8de07..401fc12 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 0e4bd13..8e860f2 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 0cedf9f..6853d12 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index f3ed331..1803911 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // Check that the interface exported by asan static lib matches the list of
 // functions mentioned in sanitizer_interface.inc.
 //
index 8c7570f..eea38b8 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // First, check this works with the default ignorelist:
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: echo "42" | %run %t 2>&1 | FileCheck %s
index 4b92e11..0a97e66 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 890503c..cbdf998 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 8cecc68..a64fdb7 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 09a572e..04f8b92 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // Make sure everything works even if the main module doesn't have any stack
 // variables, thus doesn't explicitly reference any symbol exported by the
 // runtime thunk.
index bf19aa0..52872c1 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 // REQUIRES: asan-32-bits
index 552ca9d..367162e 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index f339496..c9eceff 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 8e76790..85e4de8 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index fe8fc90..bf91b6c 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 709f8ea..3adc6e6 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 5ae7eee..de83936 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 7454d5a..6593e42 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index a94c823..9ed3ed6 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // Workaround for "LINK : fatal error LNK1318: Unexpected PDB error"
 // RUN: rm -f %t.pdb
 
index eb6d4bc..2965122 100644 (file)
@@ -1,3 +1,5 @@
+// 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
index 9619aff..2b6aedb 100644 (file)
@@ -1,3 +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: %env_asan_opts=report_globals=2 %run %te.exe %t.dll 2>&1 | FileCheck %s
index 6ef1caa..8df1b51 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index 0781145..7ab075c 100644 (file)
@@ -1,3 +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: %env_asan_opts=windows_hook_rtl_allocators=true not %run %te.exe %t.dll 2>&1 | FileCheck %s
index a2758ca..3bf1784 100644 (file)
@@ -1,3 +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: %env_asan_opts=windows_hook_rtl_allocators=true not %run %te.exe %t.dll 2>&1 | FileCheck %s
index d7e81ac..177de65 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index 92d2940..b110143 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index e3c7bfe..474f029 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 #include <Windows.h>
 #include <stdio.h>
 #include <sanitizer/allocator_interface.h>
index 4cb0c55..a6cb048 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // Make sure that ASan works with SEH in both Clang and MSVC. MSVC uses a
 // different EH personality depending on the -GS setting, so test both -GS+ and
 // -GS-.
index 9e144be..c08fcc3 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // Load this DLL at the default 32-bit ASan shadow base, and test how we dump
 // the process memory layout.
 // REQUIRES: asan-32-bits
index c774689..b3ee3df 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 // REQUIRES: asan-32-bits
index 9f7e230..ce9bd63 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %env_asan_opts=handle_sigfpe=1 not %run %t 2>&1 | FileCheck %s
 
index ff36185..abda435 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 20270ff..78b3800 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 156e9f8..0f0b545 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %run %t | FileCheck %s
 
index c180bc9..ae16bbd 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index 812ccf2..3681ff1 100644 (file)
@@ -1,3 +1,5 @@
+// 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
index fd9ac4c..1cfc2ef 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %run %t
 
index e25cc6a..a4f75fe 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %run %t
 
index a8569f8..5cf0768 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan %s -Fe%t.exe /MD
 // RUN: %run %t.exe | FileCheck %s
 
index ce116f9..e26af57 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index cacf461..8f92a14 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // Make sure LIBCMT doesn't accidentally get added to the list of DEFAULTLIB
 // directives.
 
index ba14a8b..5265e05 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // 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
index f20edec..b3aacb9 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %run %t
 
index ec5a92d..6c8a649 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 267775e..78c7f49 100644 (file)
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
index 9f42e20..10fe576 100644 (file)
@@ -99,11 +99,13 @@ if config.target_arch == 's390x':
   clang_asan_static_cflags.append("-mbackchain")
 clang_asan_static_cxxflags = config.cxx_mode_flags + clang_asan_static_cflags
 
+target_is_msvc = bool(re.match(r'.*-windows-msvc$', config.target_triple))
+
 asan_dynamic_flags = []
 if config.asan_dynamic:
   asan_dynamic_flags = ["-shared-libasan"]
-  if platform.system() == 'Windows':
-    # On Windows, we need to simulate "clang-cl /MD" on the clang driver side.
+  if platform.system() == 'Windows' and target_is_msvc:
+    # On MSVC target, we need to simulate "clang-cl /MD" on the clang driver side.
     asan_dynamic_flags += ["-D_MT", "-D_DLL", "-Wl,-nodefaultlib:libcmt,-defaultlib:msvcrt,-defaultlib:oldnames"]
   elif platform.system() == 'FreeBSD':
     # On FreeBSD, we need to add -pthread to ensure pthread functions are available.
@@ -144,8 +146,8 @@ if config.asan_dynamic:
   config.substitutions.append( ("%clang_asan_static ", build_invocation(clang_asan_static_cflags)) )
   config.substitutions.append( ("%clangxx_asan_static ", build_invocation(clang_asan_static_cxxflags)) )
 
-# Windows-specific tests might also use the clang-cl.exe driver.
-if platform.system() == 'Windows':
+# MSVC-specific tests might also use the clang-cl.exe driver.
+if platform.system() == 'Windows' and target_is_msvc:
   clang_cl_cxxflags = ["-Wno-deprecated-declarations",
                        "-WX",
                        "-D_HAS_EXCEPTIONS=0",
index 5a6f04a..5401d25 100644 (file)
@@ -102,17 +102,19 @@ config.test_format = lit.formats.ShTest(execute_external)
 if execute_external:
   config.available_features.add('shell')
 
+target_is_msvc = bool(re.match(r'.*-windows-msvc$', config.target_triple))
+
 compiler_id = getattr(config, 'compiler_id', None)
 if compiler_id == "Clang":
-  if platform.system() != 'Windows':
+  if not (platform.system() == 'Windows' and target_is_msvc):
     config.cxx_mode_flags = ["--driver-mode=g++"]
   else:
     config.cxx_mode_flags = []
   # We assume that sanitizers should provide good enough error
   # reports and stack traces even with minimal debug info.
   config.debug_info_flags = ["-gline-tables-only"]
-  if platform.system() == 'Windows':
-    # On Windows, use CodeView with column info instead of DWARF. Both VS and
+  if platform.system() == 'Windows' and target_is_msvc:
+    # On MSVC, use CodeView with column info instead of DWARF. Both VS and
     # windbg do not behave well when column info is enabled, but users have
     # requested it because it makes ASan reports more precise.
     config.debug_info_flags.append("-gcodeview")
@@ -185,8 +187,8 @@ possibly_dangerous_env_vars = ['ASAN_OPTIONS', 'DFSAN_OPTIONS', 'HWASAN_OPTIONS'
                                'LIBCLANG_RESOURCE_USAGE',
                                'LIBCLANG_CODE_COMPLETION_LOGGING',
                                'XRAY_OPTIONS']
-# Clang/Win32 may refer to %INCLUDE%. vsvarsall.bat sets it.
-if platform.system() != 'Windows':
+# Clang/MSVC may refer to %INCLUDE%. vsvarsall.bat sets it.
+if not (platform.system() == 'Windows' and target_is_msvc):
     possibly_dangerous_env_vars.append('INCLUDE')
 for name in possibly_dangerous_env_vars:
   if name in config.environment:
@@ -200,7 +202,7 @@ config.environment['PATH'] = path
 
 # Help MSVS link.exe find the standard libraries.
 # Make sure we only try to use it when targetting Windows.
-if platform.system() == 'Windows' and '-win' in config.target_triple:
+if platform.system() == 'Windows' and target_is_msvc:
   config.environment['LIB'] = os.environ['LIB']
 
 config.available_features.add(config.host_os.lower())
@@ -550,6 +552,8 @@ def is_binutils_lto_supported():
   return True
 
 def is_windows_lto_supported():
+  if not target_is_msvc:
+    return True
   return os.path.exists(os.path.join(config.llvm_tools_dir, 'lld-link.exe'))
 
 if config.host_os == 'Darwin' and is_darwin_lto_supported():