xref: /llvm-project/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll (revision 9950ea66203849df25352b8db8f4ea108ef47a5a)
17ce1c4daSSami Tolvanen; REQUIRES: x86-registered-target
2cee313d2SEric Christopher; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s
3cee313d2SEric Christopher; RUN: llvm-modextract -b -n 0 -o %t0 %t
4cee313d2SEric Christopher; RUN: llvm-modextract -b -n 1 -o %t1 %t
5cee313d2SEric Christopher; RUN: not llvm-modextract -b -n 2 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s
6cee313d2SEric Christopher; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=M0 %s
7cee313d2SEric Christopher; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=M1 %s
8cee313d2SEric Christopher; RUN: llvm-bcanalyzer -dump %t0 | FileCheck --check-prefix=BCA0 %s
9cee313d2SEric Christopher; RUN: llvm-bcanalyzer -dump %t1 | FileCheck --check-prefix=BCA1 %s
10cee313d2SEric Christopher
117ce1c4daSSami Tolvanentarget triple = "x86_64-unknown-linux-gnu"
127ce1c4daSSami Tolvanen
13cee313d2SEric Christopher; ERROR: llvm-modextract: error: module index out of range; bitcode file contains 2 module(s)
14cee313d2SEric Christopher
15cee313d2SEric Christopher; BCA0: <GLOBALVAL_SUMMARY_BLOCK
16cee313d2SEric Christopher; BCA1-NOT: <GLOBALVAL_SUMMARY_BLOCK
17cee313d2SEric Christopher
18*9950ea66SNikita Popov; M0: @g = external global ptr{{$}}
19*9950ea66SNikita Popov; M1: @g = global ptr @f.13757e0fb71915e385efa4dc9d1e08fd, !type !0
20*9950ea66SNikita Popov@g = global ptr @f, !type !0
21cee313d2SEric Christopher
22c6e5c465SHans Wennborg; M0: define hidden void @f.13757e0fb71915e385efa4dc9d1e08fd()
23c6e5c465SHans Wennborg; M1: declare hidden void @f.13757e0fb71915e385efa4dc9d1e08fd()
24cee313d2SEric Christopherdefine internal void @f() {
25cee313d2SEric Christopher  call void @f2()
26cee313d2SEric Christopher  ret void
27cee313d2SEric Christopher}
28cee313d2SEric Christopher
29cee313d2SEric Christopher; M0: define internal void @f2()
30cee313d2SEric Christopherdefine internal void @f2() {
31cee313d2SEric Christopher  ret void
32cee313d2SEric Christopher}
33cee313d2SEric Christopher
34cee313d2SEric Christopher; M1: !0 = !{i32 0, !"typeid"}
35cee313d2SEric Christopher!0 = !{i32 0, !"typeid"}
36