xref: /llvm-project/llvm/test/ThinLTO/X86/dicompositetype-unique2.ll (revision d5d3eb16b7ab72529c83dacb2889811491e48909)
1; RUN: opt -module-summary -o %t1.bc %s
2; RUN: opt -module-summary -o %t2.bc %S/Inputs/dicompositetype-unique2.ll
3; RUN: llvm-lto --thinlto-action=run %t1.bc %t2.bc -thinlto-save-temps=%t3.
4; RUN: llvm-dis %t3.0.3.imported.bc -o - | FileCheck %s
5; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t --save-temps \
6; RUN: -r %t1.bc,_ZN1CD2Ev,pl \
7; RUN: -r %t1.bc,_ZN4CFVSD2Ev,l \
8; RUN: -r %t1.bc,_Z3Getv,l \
9; RUN: -r %t2.bc,_ZN4CFVSD2Ev,pl \
10; RUN: -r %t2.bc,_Z3Getv,l
11; RUN: llvm-dis %t.1.3.import.bc -o - | FileCheck %s
12
13; Only llvm-lto2 adds the dso_local keyword, hence the {{.*}}
14; CHECK: define available_externally{{.*}} void @_ZN4CFVSD2Ev
15
16target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
17target triple = "x86_64-scei-ps4"
18
19%class.C = type <{ ptr, %class.A, %struct.CFVS, [6 x i8] }>
20%class.A = type { %struct.Vec }
21%struct.Vec = type { i8 }
22%struct.CFVS = type { %struct.Vec }
23%struct.S = type { i8 }
24
25define void @_ZN1CD2Ev(ptr %this) unnamed_addr align 2 !dbg !8 {
26entry:
27  %this.addr = alloca ptr, align 8
28  %this1 = load ptr, ptr %this.addr, align 8
29  %m = getelementptr inbounds %class.C, ptr %this1, i32 0, i32 2
30  call void @_ZN4CFVSD2Ev(ptr %m), !dbg !50
31  ret void
32}
33
34declare void @_ZN4CFVSD2Ev(ptr) unnamed_addr
35
36declare dereferenceable(1) ptr @_Z3Getv()
37
38!llvm.dbg.cu = !{!0}
39!llvm.module.flags = !{!3, !4, !5, !6}
40
41!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 6.0.0 (trunk 321360) (llvm/trunk 321359)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
42!1 = !DIFile(filename: "bz188598-a.cpp", directory: ".")
43!2 = !{}
44!3 = !{i32 2, !"Dwarf Version", i32 4}
45!4 = !{i32 2, !"Debug Info Version", i32 3}
46!5 = !{i32 1, !"wchar_size", i32 2}
47!6 = !{i32 7, !"PIC Level", i32 2}
48!8 = distinct !DISubprogram(name: "~C", linkageName: "_ZN1CD2Ev", scope: !9, file: !1, line: 9, type: !47, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !46, retainedNodes: !2)
49!9 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C", file: !1, line: 5, size: 128, elements: !10, vtableHolder: !9, identifier: "_ZTS1C")
50!10 = !{!38, !46}
51!15 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Vec<&Get>", file: !16, line: 4, size: 8, elements: !17, templateParams: !22, identifier: "_ZTS3VecIXadL_Z3GetvEEE")
52!16 = !DIFile(filename: "./bz188598.h", directory: ".")
53!17 = !{!55}
54!22 = !{!23}
55!23 = !DITemplateValueParameter(name: "F", type: !24, value: ptr @_Z3Getv)
56!24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !25, size: 64)
57!25 = !DIDerivedType(tag: DW_TAG_typedef, name: "Func", file: !16, line: 2, baseType: !26)
58!26 = !DISubroutineType(types: !27)
59!27 = !{!55}
60!38 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !9, file: !1, line: 7, baseType: !39, size: 8, offset: 72)
61!39 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "CFVS", file: !16, line: 7, size: 8, elements: !40, identifier: "_ZTS4CFVS")
62!40 = !{!41}
63!41 = !DIDerivedType(tag: DW_TAG_member, name: "m_val", scope: !39, file: !16, line: 9, baseType: !15, size: 8)
64!46 = !DISubprogram(name: "~C", scope: !9, file: !1, line: 6, type: !47, isLocal: false, isDefinition: false, scopeLine: 6, containingType: !9, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: false)
65!47 = !DISubroutineType(types: !48)
66!48 = !{!55}
67!50 = !DILocation(line: 9, scope: !51)
68!51 = distinct !DILexicalBlock(scope: !8, file: !1, line: 9)
69!55 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
70