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.
8 ; BCA: <FULL_LTO_GLOBALVAL_SUMMARY_BLOCK
9 ; BCA-NOT: <GLOBALVAL_SUMMARY_BLOCK
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 }]
14 ; CHECK: @g = internal global i8 42, !type !0
15 @g = internal global i8 42, !type !0
17 declare void @sink(ptr)
19 ; CHECK: define internal void @f()
20 define internal void @f() {
21 call void @sink(ptr @g)
26 ; CHECK: define void @h() comdat
27 define void @h() comdat {
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}
35 !0 = !{i32 0, !"typeid"}