| 1 |
// RUN: %clang --target=x86_64-unknown-linux -### %s -flto=full -funified-lto 2>&1 | FileCheck --check-prefix=UNIT %s |
| 2 |
// RUN: %clang --target=x86_64-unknown-linux -### %s -flto=thin -funified-lto 2>&1 | FileCheck --check-prefix=UNIT %s |
| 3 |
// RUN: %clang --target=x86_64-scei-ps4 -### %s -flto=full -funified-lto 2>&1 | FileCheck --check-prefix=UNIT %s |
| 4 |
// RUN: %clang --target=x86_64-scei-ps4 -### %s -flto=thin -funified-lto 2>&1 | FileCheck --check-prefix=NOUNIT %s |
| 5 |
|
| 6 |
// UNIT: "-flto-unit" |
| 7 |
// NOUNIT-NOT: "-flto-unit" |
| 8 |
|
| 9 |
// RUN: %clang --target=x86_64-sie-ps5 -### %s -funified-lto 2>&1 | FileCheck --check-prefix=NOUNILTO %s |
| 10 |
// NOUNILTO: "-cc1" |
| 11 |
// NOUNILTO-NOT: "-funified-lto |
| 12 |
|
| 13 |
// On PlayStation -funified-lto is the default. `-flto(=...)` influences the |
| 14 |
// `--lto=...` option passed to linker, unless `-fno-unified-lto` is supplied. |
| 15 |
// PS4: |
| 16 |
// RUN: %clang --target=x86_64-sie-ps4 -### %s 2>&1 | FileCheck --check-prefixes=LD,LTOFULL %s |
| 17 |
// RUN: %clang --target=x86_64-sie-ps4 -### %s -flto 2>&1 | FileCheck --check-prefixes=LD,LTOFULL %s |
| 18 |
// RUN: %clang --target=x86_64-sie-ps4 -### %s -flto=full 2>&1 | FileCheck --check-prefixes=LD,LTOFULL %s |
| 19 |
// RUN: %clang --target=x86_64-sie-ps4 -### %s -flto=thin 2>&1 | FileCheck --check-prefixes=LD,LTOTHIN %s |
| 20 |
// RUN: %clang --target=x86_64-sie-ps4 -### %s -fno-unified-lto -flto=full 2>&1 | FileCheck --check-prefixes=LD,NOLTO %s |
| 21 |
// RUN: %clang --target=x86_64-sie-ps4 -### %s -fno-unified-lto -flto=thin 2>&1 | FileCheck --check-prefixes=LD,NOLTO %s |
| 22 |
// PS5: |
| 23 |
// RUN: %clang --target=x86_64-sie-ps5 -### %s 2>&1 | FileCheck --check-prefixes=LD,LTOFULL %s |
| 24 |
// RUN: %clang --target=x86_64-sie-ps5 -### %s -flto 2>&1 | FileCheck --check-prefixes=LD,LTOFULL %s |
| 25 |
// RUN: %clang --target=x86_64-sie-ps5 -### %s -flto=full 2>&1 | FileCheck --check-prefixes=LD,LTOFULL %s |
| 26 |
// RUN: %clang --target=x86_64-sie-ps5 -### %s -flto=thin 2>&1 | FileCheck --check-prefixes=LD,LTOTHIN %s |
| 27 |
// RUN: %clang --target=x86_64-sie-ps5 -### %s -fno-unified-lto -flto=full 2>&1 | FileCheck --check-prefixes=LD,NOLTO %s |
| 28 |
// RUN: %clang --target=x86_64-sie-ps5 -### %s -fno-unified-lto -flto=thin 2>&1 | FileCheck --check-prefixes=LD,NOLTO %s |
| 29 |
|
| 30 |
// LD: {{.*ld(\.exe)?}}" |
| 31 |
// LTOFULL-SAME: "--lto=full" |
| 32 |
// LTOTHIN-SAME: "--lto=thin" |
| 33 |
// NOLTO-NOT: "--lto |