+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// 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.
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t | FileCheck %s
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
//
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// This is a host program for DLL tests.
//
// Just make sure we can compile this.
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
//
// Check both -GS and -GS- builds:
+// 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
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include <stdio.h>
#include <windows.h>
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// 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
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include <stdio.h>
#include <windows.h>
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include <stdio.h>
#include <windows.h>
+// 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
+// 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
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include "sanitizer\allocator_interface.h"
#include <cassert>
#include <stdio.h>
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t 2>&1 | FileCheck %s
#include <stdio.h>
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include "sanitizer\allocator_interface.h"
#include <cassert>
#include <stdio.h>
+// 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
+// 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
+// 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
+// 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
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t | FileCheck %s
+// 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
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Check that the interface exported by asan static lib matches the list of
// functions mentioned in sanitizer_interface.inc.
//
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// 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.
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
// REQUIRES: asan-32-bits
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Workaround for "LINK : fatal error LNK1318: Unexpected PDB error"
// RUN: rm -f %t.pdb
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include <Windows.h>
#include <stdio.h>
#include <sanitizer/allocator_interface.h>
+// 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-.
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
// REQUIRES: asan-32-bits
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t | FileCheck %s
+// 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
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan %s -Fe%t.exe /MD
// RUN: %run %t.exe | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Make sure LIBCMT doesn't accidentally get added to the list of DEFAULTLIB
// directives.
+// 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
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
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.
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",
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")
'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:
# 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())
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():