1 ; Test InProcessThinLTO thin link output from llvm-lto2
2 ; Partially copied from distributed_import.ll, and added checks for {dis|en}abling imports
4 ; RUN: rm -f %t1.bc.thinlto.bc %t2.bc.thinlto.bc %t.out.1 %t.out.2 %t1.bc.imports %t2.bc.imports
6 ; Generate bitcode files with summary, as well as minimized bitcode containing just the summary
7 ; RUN: opt -thinlto-bc %s -thin-link-bitcode-file=%t1.thinlink.bc -o %t1.bc
8 ; RUN: opt -thinlto-bc %p/Inputs/distributed_import.ll -thin-link-bitcode-file=%t2.thinlink.bc -o %t2.bc
10 ; First perform the thin link on the normal bitcode file using
11 ; -thinlto-distributed-indexes, collecting outputs to be compared with later.
12 ; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
13 ; RUN: -thinlto-distributed-indexes \
14 ; RUN: -thinlto-emit-imports \
16 ; RUN: -r=%t1.bc,analias, \
17 ; RUN: -r=%t1.bc,f,px \
18 ; RUN: -r=%t2.bc,g,px \
19 ; RUN: -r=%t2.bc,analias,px \
20 ; RUN: -r=%t2.bc,aliasee,px
21 ; RUN: mv %t1.bc.thinlto.bc %t1.bc.thinlto.bc.orig
22 ; RUN: mv %t2.bc.thinlto.bc %t2.bc.thinlto.bc.orig
23 ; RUN: mv %t1.bc.imports %t1.bc.imports.orig
24 ; RUN: mv %t2.bc.imports %t2.bc.imports.orig
26 ; Now use -thinlto-emit-indexes instead.
27 ; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
28 ; RUN: -thinlto-emit-indexes \
30 ; RUN: -r=%t1.bc,analias, \
31 ; RUN: -r=%t1.bc,f,px \
32 ; RUN: -r=%t2.bc,g,px \
33 ; RUN: -r=%t2.bc,analias,px \
34 ; RUN: -r=%t2.bc,aliasee,px \
37 ; Since InProcessThinLTO ran, there should be output
41 ; Ensure imports weren't generated since -thinlto-emit-imports wasn't specified
42 ; RUN: not ls %t1.bc.imports
43 ; RUN: not ls %t2.bc.imports
45 ; Compare the generated index files.
46 ; RUN: diff %t1.bc.thinlto.bc %t1.bc.thinlto.bc.orig
47 ; RUN: diff %t2.bc.thinlto.bc %t2.bc.thinlto.bc.orig
49 ; RUN: rm -f %t1.bc.thinlto.bc %t2.bc.thinlto.bc %t.out.1 %t.out.2
51 ; Do the thin link again but also emit imports files now
52 ; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
53 ; RUN: -thinlto-emit-indexes \
54 ; RUN: -thinlto-emit-imports \
56 ; RUN: -r=%t1.bc,analias, \
57 ; RUN: -r=%t1.bc,f,px \
58 ; RUN: -r=%t2.bc,g,px \
59 ; RUN: -r=%t2.bc,analias,px \
60 ; RUN: -r=%t2.bc,aliasee,px \
66 ; RUN: diff %t1.bc.thinlto.bc %t1.bc.thinlto.bc.orig
67 ; RUN: diff %t2.bc.thinlto.bc %t2.bc.thinlto.bc.orig
68 ; RUN: diff %t1.bc.imports %t1.bc.imports.orig
69 ; RUN: diff %t2.bc.imports %t2.bc.imports.orig
71 target triple = "x86_64-unknown-linux-gnu"
72 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
75 declare void @analias(...)
80 call void (...) @analias()
86 !1 = !{i32 2, !"Debug Info Version", i32 3}
87 !llvm.module.flags = !{!1}