Debian Codegraph @

clang/test/Driver/DTLTO/ps5-dtlto.c

raw
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: %python %S/Inputs/dtlto-helper.py %clang %llvm-driver > %t_forward.log
7 // RUN: %clang -flto=thin %s -### --target=x86_64-sie-ps5 \
8 // RUN: -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3 \
9 // RUN: -fthinlto-distributor=d.exe -Werror >>%t_forward.log 2>&1
10 // RUN: FileCheck %s --input-file=%t_forward.log --check-prefix=FORWARD
11
12 // FORWARD: clang-name:[[CLANG:.*]]
13 // FORWARD-NEXT: prepend-arg:[[PREPEND_ARG:.*]]
14 // FORWARD: prospero-lld
15 // FORWARD-SAME: "--thinlto-distributor=d.exe"
16 // FORWARD-SAME: "--thinlto-remote-compiler={{[^"]*}}[[CLANG]]"
17 // FORWARD-SAME: [[PREPEND_ARG]]
18 // FORWARD-SAME: "--thinlto-distributor-arg=a1"
19 // FORWARD-SAME: "--thinlto-distributor-arg=a2"
20 // FORWARD-SAME: "--thinlto-distributor-arg=a3"
21
22 /// Check that options are not added without --thinlto-distributor= and
23 /// that a warning is issued for unused -Xthinlto-distributor options.
24 // RUN: %clang -flto=thin %s -### --target=x86_64-sie-ps5 \
25 // RUN: -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3 2>&1 | \
26 // RUN: FileCheck %s --check-prefix=NODIST --implicit-check-not=distributor \
27 // RUN: --implicit-check-not=remote-compiler
28
29 // NODIST: warning: argument unused during compilation: '-Xthinlto-distributor=a1'
30 // NODIST: warning: argument unused during compilation: '-Xthinlto-distributor=a2,a3'
31 // NODIST: prospero-lld
32
33 /// Check the expected arguments are forwarded by default with only
34 /// --thinlto-distributor=.
35 // RUN: %python %S/Inputs/dtlto-helper.py %clang %llvm-driver > %t_default.log
36 // RUN: %clang -flto=thin %s -### --target=x86_64-sie-ps5 \
37 // RUN: -fthinlto-distributor=d.exe -Werror >>%t_default.log 2>&1
38 // RUN: FileCheck %s --input-file=%t_default.log --check-prefix=DEFAULT \
39 // RUN: --implicit-check-not=distributor --implicit-check-not=remote-compiler
40
41 // DEFAULT: clang-name:[[CLANG:.*]]
42 // DEFAULT-NEXT: prepend-arg:[[PREPEND_ARG:.*]]
43 // DEFAULT: prospero-lld
44 // DEFAULT-SAME: "--thinlto-distributor=d.exe"
45 // DEFAULT-SAME: "--thinlto-remote-compiler={{[^"]*}}[[CLANG]]"
46 // DEFAULT-SAME: [[PREPEND_ARG]]
47
48 /// Check that the arguments are forwarded unconditionally even when the
49 /// compiler is not in LTO mode.
50 // RUN: %python %S/Inputs/dtlto-helper.py %clang %llvm-driver > %t_noflto.log
51 // RUN: %clang %s -### --target=x86_64-sie-ps5 \
52 // RUN: -fthinlto-distributor=d.exe -Werror >>%t_noflto.log 2>&1
53 // RUN: FileCheck %s --input-file=%t_noflto.log --check-prefix=DEFAULT \
54 // RUN: --implicit-check-not=distributor --implicit-check-not=remote-compiler