1; UNSUPPORTED: system-windows 2 3;; This test checks that DW_IDX_parent is generated correctly when there is DIE relative offset collision between CU and TU. 4 5; RUN: llc -mtriple=x86_64 -generate-type-units -dwarf-version=5 -filetype=obj %s -o %t 6; RUN: llvm-dwarfdump -debug-info -debug-names %t | FileCheck %s 7 8; CHECK: .debug_info contents: 9; CHECK: 0x00000023: DW_TAG_namespace 10; CHECK-NEXT: DW_AT_name ("B") 11; CHECK: 0x00000023: DW_TAG_subprogram 12; CHECK-NEXT: DW_AT_low_pc 13; CHECK-NEXT: DW_AT_high_pc 14; CHECK-NEXT: DW_AT_frame_base 15; CHECK-NEXT: DW_AT_linkage_name ("_Z9get_statev") 16; CHECK-NEXT: DW_AT_name ("get_state") 17 18; CHECK: .debug_names contents: 19; CHECK: String: {{.*}} "B" 20; CHECK: Entry @ [[ENTRY:0x[0-9a-f]*]] 21; CHECK: String: {{.*}} "State" 22; CHECK: Entry @ 0xd3 { 23; CHECK: Abbrev: 0x4 24; CHECK: Tag: DW_TAG_structure_type 25; CHECK: DW_IDX_type_unit: 0x00 26; CHECK: DW_IDX_die_offset: 0x00000025 27; CHECK: DW_IDX_parent: Entry @ [[ENTRY:0x[0-9a-f]*]] 28; CHECK: } 29 30 31;; namespace B { struct State { class InnerState{}; }; } 32;; B::State::InnerState get_state() { return B::State::InnerState(); } 33;; clang++ main.cpp -g2 -O0 -fdebug-types-section -gpubnames 34 35; ModuleID = 'main.cpp' 36source_filename = "main.cpp" 37target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" 38target triple = "x86_64-unknown-linux-gnu" 39 40; Function Attrs: mustprogress noinline nounwind optnone uwtable 41define dso_local void @_Z9get_statev() #0 !dbg !10 { 42entry: 43 ret void, !dbg !17 44} 45 46attributes #0 = { mustprogress noinline nounwind optnone uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } 47 48!llvm.dbg.cu = !{!0} 49!llvm.module.flags = !{!2, !3, !4, !5, !6, !7, !8} 50!llvm.ident = !{!9} 51 52!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 19.0.0git", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false) 53!1 = !DIFile(filename: "main.cpp", directory: "/folder", checksumkind: CSK_MD5, checksum: "a84fe2e4ecb77633f6c33f3b6833b9e7") 54!2 = !{i32 7, !"Dwarf Version", i32 5} 55!3 = !{i32 2, !"Debug Info Version", i32 3} 56!4 = !{i32 1, !"wchar_size", i32 4} 57!5 = !{i32 8, !"PIC Level", i32 2} 58!6 = !{i32 7, !"PIE Level", i32 2} 59!7 = !{i32 7, !"uwtable", i32 2} 60!8 = !{i32 7, !"frame-pointer", i32 2} 61!9 = !{!"clang version 19.0.0git"} 62!10 = distinct !DISubprogram(name: "get_state", linkageName: "_Z9get_statev", scope: !1, file: !1, line: 2, type: !11, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0) 63!11 = !DISubroutineType(types: !12) 64!12 = !{!13} 65!13 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "InnerState", scope: !14, file: !1, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !16, identifier: "_ZTSN1B5State10InnerStateE") 66!14 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "State", scope: !15, file: !1, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !16, identifier: "_ZTSN1B5StateE") 67!15 = !DINamespace(name: "B", scope: null) 68!16 = !{} 69!17 = !DILocation(line: 2, column: 36, scope: !10) 70