xref: /llvm-project/llvm/test/Linker/pr26037.ll (revision 06a0ae652497513398865d9a1b0cc3f95aa82f54)
1; RUN: llvm-as %s -o %t.bc
2; RUN: llvm-as %p/Inputs/pr26037.ll -o %t2.bc
3; RUN: llvm-link -S -only-needed %t2.bc %t.bc | FileCheck %s
4
5; CHECK: ![[CU_MAIN:[0-9]+]] = distinct !DICompileUnit(
6; CHECK: ![[CU:[0-9]+]] = distinct !DICompileUnit(
7; CHECK: !DIImportedEntity({{.*}}, scope: ![[CU]], entity: ![[A:[0-9]+]]
8; CHECK: ![[A]] = distinct !DISubprogram(name: "a"
9; CHECK: !DIImportedEntity({{.*}}, scope: ![[CU]], entity: ![[LBD:[0-9]+]]
10; CHECK: ![[LBD]] = distinct !DILexicalBlock(scope: ![[D:[0-9]+]]
11; CHECK: ![[D]] = distinct !DISubprogram(name: "d"
12
13define void @_ZN1A1aEv() #0 !dbg !4 {
14entry:
15  ret void, !dbg !14
16}
17
18define void @_ZN1A1dEv() #0 !dbg !20 {
19entry:
20  ret void, !dbg !22
21}
22
23!llvm.dbg.cu = !{!0}
24!llvm.module.flags = !{!11, !12}
25!llvm.ident = !{!13}
26
27!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 256934) (llvm/trunk 256936)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, imports: !9)
28!1 = !DIFile(filename: "a2.cc", directory: "")
29!2 = !{}
30!4 = distinct !DISubprogram(name: "a", linkageName: "_ZN1A1aEv", scope: !5, file: !1, line: 7, type: !6, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
31!5 = !DINamespace(name: "A", scope: null)
32!6 = !DISubroutineType(types: !7)
33!7 = !{null}
34!9 = !{!10, !16}
35!10 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !4, file: !1, line: 8)
36!11 = !{i32 2, !"Dwarf Version", i32 4}
37!12 = !{i32 2, !"Debug Info Version", i32 3}
38!13 = !{!"clang version 3.8.0 (trunk 256934) (llvm/trunk 256936)"}
39!14 = !DILocation(line: 7, column: 12, scope: !4)
40!16 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !19, file: !1, line: 8)
41!19 = distinct !DILexicalBlock(scope: !20, file: !1, line: 10, column: 8)
42!20 = distinct !DISubprogram(name: "d", linkageName: "_ZN1A1dEv", scope: !5, file: !1, line: 10, type: !6, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
43!22 = !DILocation(line: 10, column: 8, scope: !20)
44