Debian Codegraph @

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

raw
1 // REQUIRES: lld-link
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-pc-windows-msvc -c -flto=thin %s -o dtlto.obj
9
10 // RUN: lld-link /subsystem:console /entry:_start dtlto.obj \
11 // RUN: -thinlto-distributor:%python \
12 // RUN: -thinlto-distributor-arg:%llvm_src_root/utils/dtlto/local.py \
13 // RUN: -thinlto-remote-compiler:%clang \
14 // RUN: -thinlto-remote-compiler-arg:--save-temps
15
16 /// Check that the required output files have been created.
17 // RUN: ls | sort | FileCheck %s
18
19 /// No files are expected before.
20 // CHECK-NOT: {{.}}
21
22 /// Linked ELF.
23 // CHECK: {{^}}dtlto.exe{{$}}
24
25 /// Produced by the bitcode compilation.
26 // CHECK-NEXT: {{^}}dtlto.obj{{$}}
27
28 /// --save-temps output for the backend compilation.
29 // CHECK-NEXT: {{^}}dtlto.s{{$}}
30 // CHECK-NEXT: {{^}}dtlto.s.0.preopt.bc{{$}}
31 // CHECK-NEXT: {{^}}dtlto.s.1.promote.bc{{$}}
32 // CHECK-NEXT: {{^}}dtlto.s.2.internalize.bc{{$}}
33 // CHECK-NEXT: {{^}}dtlto.s.3.import.bc{{$}}
34 // CHECK-NEXT: {{^}}dtlto.s.4.opt.bc{{$}}
35 // CHECK-NEXT: {{^}}dtlto.s.5.precodegen.bc{{$}}
36 // CHECK-NEXT: {{^}}dtlto.s.resolution.txt{{$}}
37
38 /// No files are expected after.
39 // CHECK-NOT: {{.}}
40
41 int _start() { return 0; }