|
| 1 | +// REQUIRES: lld |
| 2 | + |
| 3 | +/// Check DTLTO options are forwarded to the linker. |
| 4 | + |
| 5 | +/// Check that options are forwarded as expected with --thinlto-distributor=. |
| 6 | +// RUN: %clang -flto=thin %s -### --target=x86_64-sie-ps5 \ |
| 7 | +// RUN: -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3 \ |
| 8 | +// RUN: -fthinlto-distributor=d.exe -Werror 2>&1 | \ |
| 9 | +// RUN: FileCheck %s --check-prefix=FORWARD |
| 10 | + |
| 11 | +// FORWARD: prospero-lld |
| 12 | +// FORWARD-SAME: "--thinlto-distributor=d.exe" |
| 13 | +// FORWARD-SAME: "--thinlto-remote-compiler={{[^"]+}}" |
| 14 | +// FORWARD-SAME: "--thinlto-distributor-arg=a1" |
| 15 | +// FORWARD-SAME: "--thinlto-distributor-arg=a2" |
| 16 | +// FORWARD-SAME: "--thinlto-distributor-arg=a3" |
| 17 | + |
| 18 | +/// Check that options are not added without --thinlto-distributor= and |
| 19 | +/// that a warning is issued for unused -Xthinlto-distributor options. |
| 20 | +// RUN: %clang -flto=thin %s -### --target=x86_64-sie-ps5 \ |
| 21 | +// RUN: -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3 2>&1 | \ |
| 22 | +// RUN: FileCheck %s --check-prefix=NODIST --implicit-check-not=distributor \ |
| 23 | +// RUN: --implicit-check-not=remote-compiler |
| 24 | + |
| 25 | +// NODIST: warning: argument unused during compilation: '-Xthinlto-distributor=a1' |
| 26 | +// NODIST: warning: argument unused during compilation: '-Xthinlto-distributor=a2,a3' |
| 27 | +// NODIST: prospero-lld |
| 28 | + |
| 29 | +/// Check the expected arguments are forwarded by default with only |
| 30 | +/// --thinlto-distributor=. |
| 31 | +// RUN: %clang -flto=thin %s -### --target=x86_64-sie-ps5 \ |
| 32 | +// RUN: -fthinlto-distributor=d.exe -Werror 2>&1 | \ |
| 33 | +// RUN: FileCheck %s --check-prefix=DEFAULT --implicit-check-not=distributor \ |
| 34 | +// RUN: --implicit-check-not=remote-compiler |
| 35 | + |
| 36 | +// DEFAULT: prospero-lld |
| 37 | +// DEFAULT-SAME: "--thinlto-distributor=d.exe" |
| 38 | +// DEFAULT-SAME: "--thinlto-remote-compiler={{.*}}clang{{[^\"]*}}" |
| 39 | + |
| 40 | +/// Check that the arguments are forwarded unconditionally even when the |
| 41 | +/// compiler is not in LTO mode. |
| 42 | +// RUN: %clang %s -### --target=x86_64-sie-ps5 \ |
| 43 | +// RUN: -fthinlto-distributor=d.exe -Werror 2>&1 | \ |
| 44 | +// RUN: FileCheck %s --check-prefix=DEFAULT --implicit-check-not=distributor \ |
| 45 | +// RUN: --implicit-check-not=remote-compiler |
0 commit comments