1*fde55a9cSTeresa Johnson; Test to ensure that @llvm[.compiler].used is cloned to the split module for
2*fde55a9cSTeresa Johnson; any globals whose defs were cloned to that module.
3*fde55a9cSTeresa Johnson
4*fde55a9cSTeresa Johnson; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s
5*fde55a9cSTeresa Johnson; RUN: llvm-modextract -b -n 0 -o %t0.bc %t
6*fde55a9cSTeresa Johnson; RUN: llvm-modextract -b -n 1 -o %t1.bc %t
7*fde55a9cSTeresa Johnson; RUN: llvm-dis -o - %t0.bc | FileCheck --check-prefix=M0 %s
8*fde55a9cSTeresa Johnson; RUN: llvm-dis -o - %t1.bc | FileCheck --check-prefix=M1 %s
9*fde55a9cSTeresa Johnson
10*fde55a9cSTeresa Johnson; M0: @g1 = external global i8
11*fde55a9cSTeresa Johnson; M0: @g2 = external global i8
12*fde55a9cSTeresa Johnson; M0: @g3 = global i8 42
13*fde55a9cSTeresa Johnson; M0: @g4 = global i8 42
14*fde55a9cSTeresa Johnson; M1: @g1 = global i8 42, !type !0
15*fde55a9cSTeresa Johnson; M1: @g2 = global i8 42, !type !0
16*fde55a9cSTeresa Johnson; M1-NOT: @g
17*fde55a9cSTeresa Johnson@g1 = global i8 42, !type !0
18*fde55a9cSTeresa Johnson@g2 = global i8 42, !type !0
19*fde55a9cSTeresa Johnson@g3 = global i8 42
20*fde55a9cSTeresa Johnson@g4 = global i8 42
21*fde55a9cSTeresa Johnson
22*fde55a9cSTeresa Johnson; M0: @llvm.used = appending global [2 x i8*] [i8* @g1, i8* @g3]
23*fde55a9cSTeresa Johnson; M0: @llvm.compiler.used = appending global [2 x i8*] [i8* @g2, i8* @g4]
24*fde55a9cSTeresa Johnson; M1: @llvm.used = appending global [1 x i8*] [i8* @g1]
25*fde55a9cSTeresa Johnson; M1: @llvm.compiler.used = appending global [1 x i8*] [i8* @g2]
26*fde55a9cSTeresa Johnson@llvm.used = appending global [2 x i8*] [ i8* @g1, i8* @g3]
27*fde55a9cSTeresa Johnson@llvm.compiler.used = appending global [2 x i8*] [ i8* @g2, i8* @g4]
28*fde55a9cSTeresa Johnson
29*fde55a9cSTeresa Johnson; M1: !0 = !{i32 0, !"typeid"}
30*fde55a9cSTeresa Johnson!0 = !{i32 0, !"typeid"}
31