xref: /llvm-project/llvm/test/Transforms/ThinLTOBitcodeWriter/unsplittable.ll (revision 9950ea66203849df25352b8db8f4ea108ef47a5a)
1; RUN: opt -thinlto-bc -thin-link-bitcode-file=%t2 -thinlto-split-lto-unit -o %t %s
2; RUN: llvm-dis -o - %t | FileCheck %s
3; RUN: llvm-bcanalyzer -dump %t | FileCheck --check-prefix=BCA %s
4; When not splitting the module, the thin link bitcode file should simply be a
5; copy of the regular module.
6; RUN: diff %t %t2
7
8; BCA: <FULL_LTO_GLOBALVAL_SUMMARY_BLOCK
9; BCA-NOT: <GLOBALVAL_SUMMARY_BLOCK
10
11; CHECK: @llvm.global_ctors = appending global
12@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @f, ptr null }]
13
14; CHECK: @g = internal global i8 42, !type !0
15@g = internal global i8 42, !type !0
16
17declare void @sink(ptr)
18
19; CHECK: define internal void @f()
20define internal void @f() {
21  call void @sink(ptr @g)
22  ret void
23}
24
25$h = comdat any
26; CHECK: define void @h() comdat
27define void @h() comdat {
28  ret void
29}
30
31; CHECK: !llvm.module.flags = !{![[FLAG1:[0-9]+]], ![[FLAG2:[0-9]+]]}
32; CHECK: ![[FLAG1]] = !{i32 1, !"EnableSplitLTOUnit", i32 1}
33; CHECK: ![[FLAG2]] = !{i32 1, !"ThinLTO", i32 0}
34
35!0 = !{i32 0, !"typeid"}
36