blob: b5b33aa39be373e1f605dec32c5413f1e71fdaea [file] [log] [blame]
Bruno Cardoso Lopesa5efe3a2015-10-02 15:10:33 +00001// REQUIRES: system-darwin
2
Nico Weber9b3baaa2016-11-22 19:38:07 +00003// Check that ld gets "-lto_library".
Bruno Cardoso Lopesa5efe3a2015-10-02 15:10:33 +00004
Kuba Mracek5b576332017-08-15 19:47:06 +00005// RUN: mkdir -p %t/bin
6// RUN: mkdir -p %t/lib
7// RUN: touch %t/lib/libLTO.dylib
Bruno Cardoso Lopesa5efe3a2015-10-02 15:10:33 +00008// RUN: %clang -target x86_64-apple-darwin10 -### %s \
Kuba Mracek5b576332017-08-15 19:47:06 +00009// RUN: -ccc-install-dir %t/bin -mlinker-version=133 2> %t.log
Vedant Kumarb7df1e22016-08-30 20:36:50 +000010// RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log
Bruno Cardoso Lopesa5efe3a2015-10-02 15:10:33 +000011//
12// LINK_LTOLIB_PATH: {{ld(.exe)?"}}
13// LINK_LTOLIB_PATH: "-lto_library"
14
Nico Weber9b3baaa2016-11-22 19:38:07 +000015// Also pass -lto_library even if the file doesn't exist; if it's needed at
16// link time, ld will complain instead.
Bruno Cardoso Lopesa5efe3a2015-10-02 15:10:33 +000017// RUN: %clang -target x86_64-apple-darwin10 -### %s \
Mehdi Amini5ee58d32016-10-26 23:23:08 +000018// RUN: -ccc-install-dir %S/dummytestdir -mlinker-version=133 2> %t.log
Nico Weber9b3baaa2016-11-22 19:38:07 +000019// RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log
Steven Wuc3399db62019-01-11 21:16:04 +000020
21
22// Check that -object_lto_path is passed correctly to ld64
23// RUN: %clang -target x86_64-apple-darwin10 %s -flto=full -### 2>&1 | \
24// RUN: FileCheck -check-prefix=FULL_LTO_OBJECT_PATH %s
Steven Wu6159e862019-01-29 20:13:02 +000025// FULL_LTO_OBJECT_PATH: {{ld(.exe)?"}}
Steven Wuc3399db62019-01-11 21:16:04 +000026// FULL_LTO_OBJECT_PATH-SAME: "-object_path_lto" "{{[a-zA-Z0-9_\/]+\/cc\-[a-zA-Z0-9_]+.o}}"
27// RUN: %clang -target x86_64-apple-darwin10 %s -flto=thin -### 2>&1 | \
28// RUN: FileCheck -check-prefix=THIN_LTO_OBJECT_PATH %s
Steven Wu6159e862019-01-29 20:13:02 +000029// THIN_LTO_OBJECT_PATH: {{ld(.exe)?"}}
Steven Wuc3399db62019-01-11 21:16:04 +000030// THIN_LTO_OBJECT_PATH-SAME: "-object_path_lto" "{{[a-zA-Z0-9_\/]+\/thinlto\-[a-zA-Z0-9_]+}}"