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