blob: 0d3e46d0ea92a142039cc383724c7d21d56286ed [file] [log] [blame]
Hans Wennborg2e274592013-08-13 23:38:57 +00001// 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
Hans Wennborg65f17522013-08-27 18:10:21 +00005// RUN: %clang_cl /Tc%s -### /link foo bar baz 2>&1 | FileCheck --check-prefix=LINK %s
Hans Wennborg84ff1d32016-04-15 00:24:15 +00006// RUN: %clang_cl /Tc%s -### /linkfoo bar baz 2>&1 | FileCheck --check-prefix=LINK %s
Hans Wennborg65f17522013-08-27 18:10:21 +00007// LINK: link.exe
8// LINK: "foo"
9// LINK: "bar"
10// LINK: "baz"
11
Peter Collingbournef58ff5b02015-07-02 09:10:31 +000012// RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN %s
Hans Wennborg65f17522013-08-27 18:10:21 +000013// ASAN: link.exe
Hans Wennborg0517e752013-08-28 17:36:07 +000014// ASAN: "-debug"
Hans Wennborgd024c1c2013-08-30 10:50:52 +000015// ASAN: "-incremental:no"
Marcos Pividoribd998822017-01-31 19:05:05 +000016// ASAN: "{{[^"]*}}clang_rt.asan-i386.lib"
Alexey Samsonov6424e022014-05-12 20:20:20 +000017// ASAN: "{{.*}}clang_rt.asan_cxx-i386.lib"
Marcos Pividoribd998822017-01-31 19:05:05 +000018// ASAN: "-wholearchive:{{.*}}clang_rt.asan-i386.lib"
Hans Wennborg65f17522013-08-27 18:10:21 +000019// ASAN: "{{.*}}cl-link{{.*}}.obj"
Hans Wennborgf1a74252013-09-10 20:18:04 +000020
Peter Collingbournef58ff5b02015-07-02 09:10:31 +000021// RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /MD /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-MD %s
Timur Iskhodzhanov6903e102014-08-26 10:08:24 +000022// ASAN-MD: link.exe
23// ASAN-MD: "-debug"
24// ASAN-MD: "-incremental:no"
25// ASAN-MD: "{{.*}}clang_rt.asan_dynamic-i386.lib"
Marcos Pividorib1304692017-01-29 06:03:05 +000026// ASAN-MD: "{{[^"]*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib"
Timur Iskhodzhanov651725e2014-09-12 14:01:30 +000027// ASAN-MD: "-include:___asan_seh_interceptor"
Marcos Pividorib1304692017-01-29 06:03:05 +000028// ASAN-MD: "-wholearchive:{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib"
Timur Iskhodzhanov6903e102014-08-26 10:08:24 +000029// ASAN-MD: "{{.*}}cl-link{{.*}}.obj"
30
Hans Wennborg4e6bec72013-09-10 20:53:34 +000031// 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
Hans Wennborgf1a74252013-09-10 20:18:04 +000033// DLL: link.exe
34// "-dll"
35
Peter Collingbournef58ff5b02015-07-02 09:10:31 +000036// RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /LD /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-DLL %s
37// RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /LDd /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-DLL %s
Hans Wennborgf1a74252013-09-10 20:18:04 +000038// ASAN-DLL: link.exe
39// ASAN-DLL: "-dll"
40// ASAN-DLL: "-debug"
41// ASAN-DLL: "-incremental:no"
Timur Iskhodzhanov3b6adcb62013-09-11 11:45:31 +000042// ASAN-DLL: "{{.*}}clang_rt.asan_dll_thunk-i386.lib"
Hans Wennborgf1a74252013-09-10 20:18:04 +000043// ASAN-DLL: "{{.*}}cl-link{{.*}}.obj"
Hans Wennborgbbb5f072014-04-25 16:24:19 +000044
45// RUN: %clang_cl /Zi /Tc%s -### 2>&1 | FileCheck --check-prefix=DEBUG %s
46// DEBUG: link.exe
47// DEBUG: "-debug"
Hans Wennborg12f4f8b2016-04-15 01:12:32 +000048
49// PR27234
50// RUN: %clang_cl /Tc%s nonexistent.obj -### /link /libpath:somepath 2>&1 | FileCheck --check-prefix=NONEXISTENT %s
51// RUN: %clang_cl /Tc%s nonexistent.lib -### /link /libpath:somepath 2>&1 | FileCheck --check-prefix=NONEXISTENT %s
52// NONEXISTENT-NOT: no such file
53// NONEXISTENT: link.exe
54// NONEXISTENT: "/libpath:somepath"
55// NONEXISTENT: nonexistent
Hans Wennborg2b0eea42016-10-04 21:01:00 +000056
57// RUN: %clang_cl /Tc%s -fuse-ld=lld -### 2>&1 | FileCheck --check-prefix=USE_LLD %s
58// USE_LLD: lld-link.exe