xref: /minix3/external/bsd/llvm/dist/clang/test/Driver/cl-link.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1 // Don't attempt slash switches on msys bash.
2 // REQUIRES: shell-preserves-root
3 
4 // Note: %s must be preceded by -- or bound to another option, otherwise it may
5 // be interpreted as a command-line option, e.g. on Mac where %s is commonly
6 // under /Users.
7 
8 // RUN: %clang_cl /Tc%s -### /link foo bar baz 2>&1 | FileCheck --check-prefix=LINK %s
9 // LINK: link.exe
10 // LINK: "foo"
11 // LINK: "bar"
12 // LINK: "baz"
13 
14 // RUN: %clang_cl /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN %s
15 // ASAN: link.exe
16 // ASAN: "-debug"
17 // ASAN: "-incremental:no"
18 // ASAN: "{{.*}}clang_rt.asan-i386.lib"
19 // ASAN: "{{.*}}clang_rt.asan_cxx-i386.lib"
20 // ASAN: "{{.*}}cl-link{{.*}}.obj"
21 
22 // RUN: %clang_cl /MD /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-MD %s
23 // ASAN-MD: link.exe
24 // ASAN-MD: "-debug"
25 // ASAN-MD: "-incremental:no"
26 // ASAN-MD: "{{.*}}clang_rt.asan_dynamic-i386.lib"
27 // ASAN-MD: "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib"
28 // ASAN-MD: "-include:___asan_seh_interceptor"
29 // ASAN-MD: "{{.*}}cl-link{{.*}}.obj"
30 
31 // RUN: %clang_cl /LD -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
32 // RUN: %clang_cl /LDd -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
33 // DLL: link.exe
34 // "-dll"
35 
36 // RUN: %clang_cl /LD /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-DLL %s
37 // RUN: %clang_cl /LDd /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-DLL %s
38 // ASAN-DLL: link.exe
39 // ASAN-DLL: "-dll"
40 // ASAN-DLL: "-debug"
41 // ASAN-DLL: "-incremental:no"
42 // ASAN-DLL: "{{.*}}clang_rt.asan_dll_thunk-i386.lib"
43 // ASAN-DLL: "{{.*}}cl-link{{.*}}.obj"
44 
45 // RUN: %clang_cl /Zi /Tc%s -### 2>&1 | FileCheck --check-prefix=DEBUG %s
46 // DEBUG: link.exe
47 // DEBUG: "-debug"
48