77 lines · c
1// Note: %s must be preceded by -- or bound to another option, otherwise it may2// be interpreted as a command-line option, e.g. on Mac where %s is commonly3// under /Users.4 5// RUN: %clang_cl /Tc%s -fuse-ld=link -### /link foo bar baz 2>&1 | FileCheck --check-prefix=LINK %s6// RUN: %clang_cl /Tc%s -fuse-ld=link -### /linkfoo bar baz 2>&1 | FileCheck --check-prefix=LINK %s7// LINK: link.exe8// LINK: "foo"9// LINK: "bar"10// LINK: "baz"11 12// RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /Tc%s -fuse-ld=link -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN %s13// ASAN: link.exe14// ASAN: "-debug"15// ASAN: "-incremental:no"16// ASAN: "{{[^"]*}}clang_rt.asan_dynamic{{(-i386)?}}.lib"17// ASAN: "-wholearchive:{{.*}}clang_rt.asan_static_runtime_thunk{{(-i386)?}}.lib"18// ASAN: "{{.*}}cl-link{{.*}}.obj"19 20// 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 %s21// ASAN-MD: link.exe22// ASAN-MD: "-debug"23// ASAN-MD: "-incremental:no"24// ASAN-MD: "{{.*}}clang_rt.asan_dynamic{{(-i386)?}}.lib"25// ASAN-MD: "-include:___asan_seh_interceptor"26// ASAN-MD: "-wholearchive:{{.*}}clang_rt.asan_dynamic_runtime_thunk{{(-i386)?}}.lib"27// ASAN-MD: "{{.*}}cl-link{{.*}}.obj"28 29// RUN: %clang_cl /LD -fuse-ld=link -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s30// RUN: %clang_cl /LDd -fuse-ld=link -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s31// DLL: link.exe32// "-dll"33 34// 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 %s35// 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 %s36// ASAN-DLL: link.exe37// ASAN-DLL: "-dll"38// ASAN-DLL: "-debug"39// ASAN-DLL: "-incremental:no"40// ASAN-DLL: "{{.*}}clang_rt.asan_dynamic{{(-i386)?}}.lib"41// ASAN-DLL: "-wholearchive:{{.*}}clang_rt.asan_static_runtime_thunk{{(-i386)?}}.lib"42// ASAN-DLL: "{{.*}}cl-link{{.*}}.obj"43 44// RUN: %clang_cl /Zi /Tc%s -fuse-ld=link -### 2>&1 | FileCheck --check-prefix=DEBUG %s45// DEBUG: link.exe46// DEBUG: "-debug"47 48// Don't pass through /libpath: if it's not after a /link flag:49// RUN: not %clang_cl /Tc%s /libpath:foo -fuse-ld=link -### /link /libpath:bar 2>&1 | FileCheck --check-prefix=LIBPATH %s50// LIBPATH: error: no such file or directory: '/libpath:foo'51// LIBPATH: libpath:bar52 53// PR2723454// RUN: %clang_cl /Tc%s nonexistent.obj -fuse-ld=link -### /link /libpath:somepath 2>&1 | FileCheck --check-prefix=NONEXISTENT %s55// RUN: %clang_cl /Tc%s nonexistent.lib -fuse-ld=link -### /link /libpath:somepath 2>&1 | FileCheck --check-prefix=NONEXISTENT %s56// RUN: %clang_cl /Tc%s nonexistent.obj -fuse-ld=link -### /winsysroot somepath 2>&1 | FileCheck --check-prefix=NONEXISTENT %s57// RUN: %clang_cl /Tc%s nonexistent.lib -fuse-ld=link -### /winsysroot somepath 2>&1 | FileCheck --check-prefix=NONEXISTENT %s58// RUN: %clang_cl /Tc%s nonexistent.obj -fuse-ld=link -### 2>&1 | FileCheck --check-prefix=NONEXISTENT %s59// RUN: %clang_cl /Tc%s nonexistent.lib -fuse-ld=link -### 2>&1 | FileCheck --check-prefix=NONEXISTENT %s60// NONEXISTENT-NOT: no such file61// NONEXISTENT: link.exe62// NONEXISTENT: nonexistent63 64// RUN: %clang_cl /Tc%s -fuse-ld=lld -### 2>&1 | FileCheck --check-prefix=USE_LLD %s65// USE_LLD: lld-link66 67// RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /Tc%s -fuse-ld=link -### -fsanitize=address 2>&1 | FileCheck --check-prefix=INFER-LINK %s68// INFER-LINK: link.exe69// INFER-LINK: /INFERASANLIBS:NO70 71// RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /Tc%s -fuse-ld=lld -### -fsanitize=address 2>&1 | FileCheck --check-prefix=INFER-LLD %s72// INFER-LLD: lld-link73// INFER-LLD-NOT: INFERASANLIBS74 75// RUN: %clang_cl --target=x86_64-unknown-windows-msvc /Tc%s -flto -fuse-ld=lld -### -fprofile-sample-use=%S/Inputs/file.prof 2>&1 | FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s76// CHECK-SAMPLE-PROFILE: "-lto-sample-profile:{{.*}}/file.prof"77