Bruno Cardoso Lopes | a5efe3a | 2015-10-02 15:10:33 +0000 | [diff] [blame] | 1 | // REQUIRES: system-darwin |
| 2 | |
Nico Weber | 9b3baaa | 2016-11-22 19:38:07 +0000 | [diff] [blame] | 3 | // Check that ld gets "-lto_library". |
Bruno Cardoso Lopes | a5efe3a | 2015-10-02 15:10:33 +0000 | [diff] [blame] | 4 | |
Kuba Mracek | 5b57633 | 2017-08-15 19:47:06 +0000 | [diff] [blame] | 5 | // RUN: mkdir -p %t/bin |
| 6 | // RUN: mkdir -p %t/lib |
| 7 | // RUN: touch %t/lib/libLTO.dylib |
Bruno Cardoso Lopes | a5efe3a | 2015-10-02 15:10:33 +0000 | [diff] [blame] | 8 | // RUN: %clang -target x86_64-apple-darwin10 -### %s \ |
Kuba Mracek | 5b57633 | 2017-08-15 19:47:06 +0000 | [diff] [blame] | 9 | // RUN: -ccc-install-dir %t/bin -mlinker-version=133 2> %t.log |
Vedant Kumar | b7df1e2 | 2016-08-30 20:36:50 +0000 | [diff] [blame] | 10 | // RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log |
Bruno Cardoso Lopes | a5efe3a | 2015-10-02 15:10:33 +0000 | [diff] [blame] | 11 | // |
| 12 | // LINK_LTOLIB_PATH: {{ld(.exe)?"}} |
| 13 | // LINK_LTOLIB_PATH: "-lto_library" |
| 14 | |
Nico Weber | 9b3baaa | 2016-11-22 19:38:07 +0000 | [diff] [blame] | 15 | // 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 Lopes | a5efe3a | 2015-10-02 15:10:33 +0000 | [diff] [blame] | 17 | // RUN: %clang -target x86_64-apple-darwin10 -### %s \ |
Mehdi Amini | 5ee58d3 | 2016-10-26 23:23:08 +0000 | [diff] [blame] | 18 | // RUN: -ccc-install-dir %S/dummytestdir -mlinker-version=133 2> %t.log |
Nico Weber | 9b3baaa | 2016-11-22 19:38:07 +0000 | [diff] [blame] | 19 | // RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log |
Steven Wu | c3399db6 | 2019-01-11 21:16:04 +0000 | [diff] [blame] | 20 | |
| 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 Wu | 6159e86 | 2019-01-29 20:13:02 +0000 | [diff] [blame] | 25 | // FULL_LTO_OBJECT_PATH: {{ld(.exe)?"}} |
Steven Wu | c3399db6 | 2019-01-11 21:16:04 +0000 | [diff] [blame] | 26 | // 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 Wu | 6159e86 | 2019-01-29 20:13:02 +0000 | [diff] [blame] | 29 | // THIN_LTO_OBJECT_PATH: {{ld(.exe)?"}} |
Steven Wu | c3399db6 | 2019-01-11 21:16:04 +0000 | [diff] [blame] | 30 | // THIN_LTO_OBJECT_PATH-SAME: "-object_path_lto" "{{[a-zA-Z0-9_\/]+\/thinlto\-[a-zA-Z0-9_]+}}" |