File: debug-names-parents-same-offset.ll

package info (click to toggle)
llvm-toolchain-18 1%3A18.1.8-18
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,908,340 kB
  • sloc: cpp: 6,667,937; ansic: 1,440,452; asm: 883,619; python: 230,549; objc: 76,880; f90: 74,238; lisp: 35,989; pascal: 16,571; sh: 10,229; perl: 7,459; ml: 5,047; awk: 3,523; makefile: 2,987; javascript: 2,149; xml: 892; fortran: 649; cs: 573
file content (66 lines) | stat: -rw-r--r-- 3,350 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
; RUN: llc -mtriple=x86_64 -generate-type-units -dwarf-version=5 -filetype=obj %s -o %t
; RUN: llvm-dwarfdump -debug-names %t | FileCheck %s

; Two structs that have different names but are structurally identical:
;    namespace MyNamespace {
;      struct MyStruct1 {
;          char c1;
;      };
;      struct MyStruct2 {
;          char c2;
;      };
;    } // namespace MyNamespace
;    MyNamespace::MyStruct1 gv1;
;    MyNamespace::MyStruct2 gv2;

; Using two TUs, this should produce DIE structures with the same offset.
; We test that accelerator table generation works with this.

; CHECK:      String: {{.*}} "MyStruct2"
; CHECK-NEXT:      Entry @ {{.*}} {
; CHECK-NEXT:        Abbrev: [[ABBREV:0x.*]]
; CHECK-NEXT:        Tag: DW_TAG_structure_type
; CHECK-NEXT:        DW_IDX_type_unit: 0x01
; CHECK-NEXT:        DW_IDX_die_offset: [[DieOffset:0x.*]]
; CHECK-NEXT:        DW_IDX_parent: [[Parent1:0x.*]]
; CHECK:      String: {{.*}} "MyStruct1"
; CHECK-NEXT:      Entry @ {{.*}} {
; CHECK-NEXT:        Abbrev: [[ABBREV]]
; CHECK-NEXT:        Tag: DW_TAG_structure_type
; CHECK-NEXT:        DW_IDX_type_unit: 0x00
; CHECK-NEXT:        DW_IDX_die_offset: [[DieOffset:0x.*]]
; CHECK-NOT:         DW_IDX_parent: [[Parent1]]
; CHECK-NEXT:        DW_IDX_parent: 0x{{.*}}


%"struct.MyNamespace::MyStruct1" = type { i8 }
%"struct.MyNamespace::MyStruct2" = type { i8 }

@gv1 = dso_local global %"struct.MyNamespace::MyStruct1" zeroinitializer, align 1, !dbg !0
@gv2 = dso_local global %"struct.MyNamespace::MyStruct2" zeroinitializer, align 1, !dbg !5

!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!15, !16, !17, !18, !19}
!llvm.ident = !{!20}

!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "gv1", scope: !2, file: !3, line: 10, type: !12, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "blah", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false)
!3 = !DIFile(filename: "two_tus.cpp", directory: "blah", checksumkind: CSK_MD5, checksum: "69acf04f32811fe7fd35449b58c3f5b1")
!4 = !{!0, !5}
!5 = !DIGlobalVariableExpression(var: !6, expr: !DIExpression())
!6 = distinct !DIGlobalVariable(name: "gv2", scope: !2, file: !3, line: 11, type: !7, isLocal: false, isDefinition: true)
!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "MyStruct2", scope: !8, file: !3, line: 5, size: 8, flags: DIFlagTypePassByValue, elements: !9, identifier: "_ZTSN11MyNamespace9MyStruct2E")
!8 = !DINamespace(name: "MyNamespace", scope: null)
!9 = !{!10}
!10 = !DIDerivedType(tag: DW_TAG_member, name: "c2", scope: !7, file: !3, line: 6, baseType: !11, size: 8)
!11 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "MyStruct1", scope: !8, file: !3, line: 2, size: 8, flags: DIFlagTypePassByValue, elements: !13, identifier: "_ZTSN11MyNamespace9MyStruct1E")
!13 = !{!14}
!14 = !DIDerivedType(tag: DW_TAG_member, name: "c1", scope: !12, file: !3, line: 3, baseType: !11, size: 8)
!15 = !{i32 7, !"Dwarf Version", i32 5}
!16 = !{i32 2, !"Debug Info Version", i32 3}
!17 = !{i32 1, !"wchar_size", i32 4}
!18 = !{i32 7, !"uwtable", i32 2}
!19 = !{i32 7, !"frame-pointer", i32 2}
!20 = !{!"blah"}