1; REQUIRES: x86-registered-target 2; RUN: %llc_dwarf -split-dwarf-file=%t.dwo < %s | FileCheck %s 3 4; Ensure function-local DW_TAG_imported_declaration get skipped if its parent subprogram was not emitted. 5; CHECK-NOT: DW_TAG_imported_declaration 6 7target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8target triple = "x86_64-unknown-linux-gnu" 9 10define void @f1() !dbg !13 { 11lbl: 12 ret void, !dbg !16 13} 14 15define void @f2() !dbg !22 { 16lbl: 17 ret void, !dbg !23 18} 19 20!llvm.dbg.cu = !{!0, !2, !10} 21!llvm.module.flags = !{!12} 22 23!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, emissionKind: FullDebug) 24!1 = !DIFile(filename: "a.cc", directory: "") 25!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, emissionKind: FullDebug) 26!3 = !DIFile(filename: "b.cc", directory: "") 27!4 = !{!5} 28!5 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !6, entity: !7) 29!6 = !DISubprogram(scope: null, spFlags: DISPFlagOptimized, retainedNodes: !4) 30!7 = !DINamespace(scope: !2) 31!8 = !DISubroutineType(types: !9) 32!9 = !{} 33!10 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !11, emissionKind: FullDebug) 34!11 = !DIFile(filename: "c.cc", directory: "") 35!12 = !{i32 2, !"Debug Info Version", i32 3} 36!13 = distinct !DISubprogram(scope: null, type: !8, spFlags: DISPFlagDefinition, unit: !0) 37!16 = !DILocation(line: 0, scope: !17, inlinedAt: !18) 38!17 = distinct !DISubprogram(scope: null, unit: !10) 39!18 = !DILocation(line: 0, scope: !21) 40!21 = !DILexicalBlockFile(scope: !13, discriminator: 0) 41!22 = distinct !DISubprogram(scope: null, type: !8, spFlags: DISPFlagDefinition, unit: !0) 42!23 = !DILocation(line: 0, scope: !24, inlinedAt: !25) 43!24 = distinct !DISubprogram(scope: null, unit: !2) 44!25 = !DILocation(line: 0, scope: !22) 45