1 // Note: %s must be preceded by -- or bound to another option, otherwise it may
2 // be interpreted as a command-line option, e.g. on Mac where %s is commonly
3 // under /Users.
4 
5 // RUN: %clang_cl /Tc%s -### /link foo bar baz 2>&1 | FileCheck --check-prefix=LINK %s
6 // LINK: link.exe
7 // LINK: "foo"
8 // LINK: "bar"
9 // LINK: "baz"
10 
11 // RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN %s
12 // ASAN: link.exe
13 // ASAN: "-debug"
14 // ASAN: "-incremental:no"
15 // ASAN: "{{.*}}clang_rt.asan-i386.lib"
16 // ASAN: "{{.*}}clang_rt.asan_cxx-i386.lib"
17 // ASAN: "{{.*}}cl-link{{.*}}.obj"
18 
19 // RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /MD /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-MD %s
20 // ASAN-MD: link.exe
21 // ASAN-MD: "-debug"
22 // ASAN-MD: "-incremental:no"
23 // ASAN-MD: "{{.*}}clang_rt.asan_dynamic-i386.lib"
24 // ASAN-MD: "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib"
25 // ASAN-MD: "-include:___asan_seh_interceptor"
26 // ASAN-MD: "{{.*}}cl-link{{.*}}.obj"
27 
28 // RUN: %clang_cl /LD -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
29 // RUN: %clang_cl /LDd -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
30 // DLL: link.exe
31 // "-dll"
32 
33 // RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /LD /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-DLL %s
34 // RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /LDd /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-DLL %s
35 // ASAN-DLL: link.exe
36 // ASAN-DLL: "-dll"
37 // ASAN-DLL: "-debug"
38 // ASAN-DLL: "-incremental:no"
39 // ASAN-DLL: "{{.*}}clang_rt.asan_dll_thunk-i386.lib"
40 // ASAN-DLL: "{{.*}}cl-link{{.*}}.obj"
41 
42 // RUN: %clang_cl /Zi /Tc%s -### 2>&1 | FileCheck --check-prefix=DEBUG %s
43 // DEBUG: link.exe
44 // DEBUG: "-debug"
45