[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / Driver / cl-link.c
blob444f0c01b3f99902ec17056a94a27c36a907dd45
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.
5 // RUN: %clang_cl /Tc%s -fuse-ld=link -### /link foo bar baz 2>&1 | FileCheck --check-prefix=LINK %s
6 // RUN: %clang_cl /Tc%s -fuse-ld=link -### /linkfoo bar baz 2>&1 | FileCheck --check-prefix=LINK %s
7 // LINK: link.exe
8 // LINK: "foo"
9 // LINK: "bar"
10 // LINK: "baz"
12 // RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /Tc%s -fuse-ld=link -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN %s
13 // ASAN: link.exe
14 // ASAN: "-debug"
15 // ASAN: "-incremental:no"
16 // ASAN: "{{[^"]*}}clang_rt.asan-i386.lib"
17 // ASAN: "-wholearchive:{{.*}}clang_rt.asan-i386.lib"
18 // ASAN: "{{[^"]*}}clang_rt.asan_cxx-i386.lib"
19 // ASAN: "-wholearchive:{{.*}}clang_rt.asan_cxx-i386.lib"
20 // ASAN: "{{.*}}cl-link{{.*}}.obj"
22 // RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /MD /Tc%s -fuse-ld=link -### -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: "-wholearchive:{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib"
30 // ASAN-MD: "{{.*}}cl-link{{.*}}.obj"
32 // RUN: %clang_cl /LD -fuse-ld=link -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
33 // RUN: %clang_cl /LDd -fuse-ld=link -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
34 // DLL: link.exe
35 // "-dll"
37 // RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /LD /Tc%s -fuse-ld=link -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-DLL %s
38 // RUN: not %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /LDd /Tc%s -fuse-ld=link -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-DLL %s
39 // ASAN-DLL: link.exe
40 // ASAN-DLL: "-dll"
41 // ASAN-DLL: "-debug"
42 // ASAN-DLL: "-incremental:no"
43 // ASAN-DLL: "{{.*}}clang_rt.asan_dll_thunk-i386.lib"
44 // ASAN-DLL: "{{.*}}cl-link{{.*}}.obj"
46 // RUN: %clang_cl /Zi /Tc%s -fuse-ld=link -### 2>&1 | FileCheck --check-prefix=DEBUG %s
47 // DEBUG: link.exe
48 // DEBUG: "-debug"
50 // Don't pass through /libpath: if it's not after a /link flag:
51 // RUN: not %clang_cl /Tc%s /libpath:foo -fuse-ld=link -### /link /libpath:bar 2>&1 | FileCheck --check-prefix=LIBPATH %s
52 // LIBPATH: error: no such file or directory: '/libpath:foo'
53 // LIBPATH: libpath:bar
55 // PR27234
56 // RUN: %clang_cl /Tc%s nonexistent.obj -fuse-ld=link -### /link /libpath:somepath 2>&1 | FileCheck --check-prefix=NONEXISTENT %s
57 // RUN: %clang_cl /Tc%s nonexistent.lib -fuse-ld=link -### /link /libpath:somepath 2>&1 | FileCheck --check-prefix=NONEXISTENT %s
58 // RUN: %clang_cl /Tc%s nonexistent.obj -fuse-ld=link -### /winsysroot somepath 2>&1 | FileCheck --check-prefix=NONEXISTENT %s
59 // RUN: %clang_cl /Tc%s nonexistent.lib -fuse-ld=link -### /winsysroot somepath 2>&1 | FileCheck --check-prefix=NONEXISTENT %s
60 // RUN: %clang_cl /Tc%s nonexistent.obj -fuse-ld=link -### 2>&1 | FileCheck --check-prefix=NONEXISTENT %s
61 // RUN: %clang_cl /Tc%s nonexistent.lib -fuse-ld=link -### 2>&1 | FileCheck --check-prefix=NONEXISTENT %s
62 // NONEXISTENT-NOT: no such file
63 // NONEXISTENT: link.exe
64 // NONEXISTENT: nonexistent
66 // RUN: %clang_cl /Tc%s -fuse-ld=lld -### 2>&1 | FileCheck --check-prefix=USE_LLD %s
67 // USE_LLD: lld-link
69 // RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /Tc%s -fuse-ld=link -### -fsanitize=address 2>&1 | FileCheck --check-prefix=INFER-LINK %s
70 // INFER-LINK: link.exe
71 // INFER-LINK: /INFERASANLIBS:NO
73 // RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /Tc%s -fuse-ld=lld -### -fsanitize=address 2>&1 | FileCheck --check-prefix=INFER-LLD %s
74 // INFER-LLD: lld-link
75 // INFER-LLD-NOT: INFERASANLIBS