74 lines · plain
1; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck --implicit-check-not "{{DW_TAG|NULL}}" %s2 3 4; namespace ns {5; inline __attribute__((always_inline))6; void foo() { int a = 4; }7; }8;9; void goo() {10; using ns::foo;11; foo();12; }13 14; Ensure that imported declarations reference the correct subprograms even if15; those subprograms are inlined.16 17; CHECK: DW_TAG_compile_unit18; CHECK: DW_TAG_namespace19; CHECK: DW_AT_name ("ns")20; CHECK: [[FOO:0x.*]]: DW_TAG_subprogram21; CHECK: DW_AT_name ("foo")22; CHECK: DW_TAG_variable23; CHECK: NULL24; CHECK: NULL25; CHECK: DW_TAG_base_type26; CHECK: DW_TAG_subprogram27; CHECK: DW_AT_name ("goo")28; CHECK: DW_TAG_inlined_subroutine29; CHECK: DW_AT_abstract_origin ([[FOO]]30; CHECK: DW_TAG_variable31; CHECK: NULL32; CHECK: DW_TAG_imported_declaration33; CHECK: DW_AT_import ([[FOO]])34; CHECK: NULL35; CHECK: NULL36 37; Function Attrs: mustprogress noinline optnone uwtable38define dso_local void @_Z3goov() !dbg !4 {39entry:40 %a.i = alloca i32, align 441 call void @llvm.dbg.declare(metadata ptr %a.i, metadata !16, metadata !DIExpression()), !dbg !1842 store i32 4, ptr %a.i, align 4, !dbg !1843 ret void, !dbg !2044}45 46; Function Attrs: nofree nosync nounwind readnone speculatable willreturn47declare void @llvm.dbg.declare(metadata, metadata, metadata)48 49!llvm.dbg.cu = !{!0}50!llvm.module.flags = !{!10, !11, !12, !13, !14}51!llvm.ident = !{!15}52 53!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 14.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)54!1 = !DIFile(filename: "imported-inlined-declaration.cpp", directory: "")55!2 = !{!3}56!3 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !4, entity: !8, file: !1, line: 7)57!4 = distinct !DISubprogram(name: "goo", linkageName: "_Z3goov", scope: !1, file: !1, line: 6, type: !5, scopeLine: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)58!5 = !DISubroutineType(types: !6)59!6 = !{null}60!7 = !{}61!8 = distinct !DISubprogram(name: "foo", linkageName: "_ZN2ns3fooEv", scope: !9, file: !1, line: 3, type: !5, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !7)62!9 = !DINamespace(name: "ns", scope: null)63!10 = !{i32 7, !"Dwarf Version", i32 4}64!11 = !{i32 2, !"Debug Info Version", i32 3}65!12 = !{i32 1, !"wchar_size", i32 4}66!13 = !{i32 7, !"uwtable", i32 1}67!14 = !{i32 7, !"frame-pointer", i32 2}68!15 = !{!"clang version 14.0.0"}69!16 = !DILocalVariable(name: "a", scope: !8, file: !1, line: 3, type: !17)70!17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)71!18 = !DILocation(line: 3, column: 18, scope: !8, inlinedAt: !19)72!19 = distinct !DILocation(line: 8, column: 2, scope: !4)73!20 = !DILocation(line: 9, column: 1, scope: !4)74