Always treat DISubprogram reached by DIImportedEntity as needed.
[oota-llvm.git] / test / Linker / pr26037.ll
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: distinct !DISubprogram(name: "a"
6 ; CHECK: !DIImportedEntity({{.*}}, entity:
7
8 define void @_ZN1A1aEv() #0 !dbg !4 {
9 entry:
10   ret void, !dbg !13
11 }
12
13 !llvm.dbg.cu = !{!0}
14 !llvm.module.flags = !{!10, !11}
15 !llvm.ident = !{!12}
16
17 !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: 1, enums: !2, subprograms: !3, imports: !8)
18 !1 = !DIFile(filename: "a2.cc", directory: "")
19 !2 = !{}
20 !3 = !{!4}
21 !4 = distinct !DISubprogram(name: "a", linkageName: "_ZN1A1aEv", scope: !5, file: !1, line: 5, type: !6, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
22 !5 = !DINamespace(name: "A", scope: null, file: !1, line: 1)
23 !6 = !DISubroutineType(types: !7)
24 !7 = !{null}
25 !8 = !{!9}
26 !9 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !4, line: 2)
27 !10 = !{i32 2, !"Dwarf Version", i32 4}
28 !11 = !{i32 2, !"Debug Info Version", i32 3}
29 !12 = !{!"clang version 3.8.0 (trunk 256934) (llvm/trunk 256936)"}
30 !13 = !DILocation(line: 6, column: 1, scope: !4)