Debian Codegraph @

cross-project-tests/dtlto/ld-dtlto.c

raw
1 // REQUIRES: ld.lld
2
3 /// Simple test that DTLTO works with a single input bitcode file and that
4 /// --save-temps can be applied to the remote compilation.
5
6 // RUN: rm -rf %t && mkdir %t && cd %t
7
8 // RUN: %clang --target=x86_64-linux-gnu %s -flto=thin -fuse-ld=lld \
9 // RUN: -fthinlto-distributor=%python \
10 // RUN: -Xthinlto-distributor=%llvm_src_root/utils/dtlto/local.py \
11 // RUN: -Wl,--thinlto-remote-compiler-arg=--save-temps \
12 // RUN: -nostdlib -Werror
13
14 /// Check that the required output files have been created.
15 // RUN: ls | sort | FileCheck %s
16
17 /// No files are expected before.
18 // CHECK-NOT: {{.}}
19
20 /// Linked ELF.
21 // CHECK: {{^}}a.out{{$}}
22
23 /// --save-temps output for the backend compilation.
24 // CHECK-NEXT: {{^}}ld-dtlto-[[TMP:[a-zA-Z0-9_]+]].s{{$}}
25 // CHECK-NEXT: {{^}}ld-dtlto-[[TMP]].s.0.preopt.bc{{$}}
26 // CHECK-NEXT: {{^}}ld-dtlto-[[TMP]].s.1.promote.bc{{$}}
27 // CHECK-NEXT: {{^}}ld-dtlto-[[TMP]].s.2.internalize.bc{{$}}
28 // CHECK-NEXT: {{^}}ld-dtlto-[[TMP]].s.3.import.bc{{$}}
29 // CHECK-NEXT: {{^}}ld-dtlto-[[TMP]].s.4.opt.bc{{$}}
30 // CHECK-NEXT: {{^}}ld-dtlto-[[TMP]].s.5.precodegen.bc{{$}}
31 // CHECK-NEXT: {{^}}ld-dtlto-[[TMP]].s.resolution.txt{{$}}
32
33 /// No files are expected after.
34 // CHECK-NOT: {{.}}
35
36 int _start() { return 0; }