Skip to content

Commit 5141bea

Browse files
committed
Fix test
1 parent 47a8ef3 commit 5141bea

File tree

2 files changed

+35
-22
lines changed

2 files changed

+35
-22
lines changed

llvm/lib/DWARFLinker/Classic/DWARFLinker.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,6 +1853,7 @@ DIE *DWARFLinker::DIECloner::cloneDIE(const DWARFDie &InputDIE,
18531853
Hash);
18541854
}
18551855

1856+
// For Swift, mangled names are put into DW_AT_linkage_name.
18561857
if (Success && AttrInfo.MangledName &&
18571858
RuntimeLang == dwarf::DW_LANG_Swift &&
18581859
!AttrInfo.MangledName.getString().empty() &&

llvm/test/tools/dsymutil/debug-names-accel-table-types.test

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
; CHECK: DW_AT_name ("DifferentName")
1616
; CHECK: DW_AT_linkage_name ("UniqueDifferentName")
1717

18-
; The name count should be 5 (the two variables, the two human readable names, one mangled name).
19-
; SAME-NAME: Name count: 5
18+
; The name count should be 5 (the two variables, "int", "SameName", "DifferentName", "UniqueDifferentName").
19+
; SAME-NAME: Name count: 6
2020

2121
; The accelarator should only have one entry for the three following names.
2222
; SAME-NAME: "SameName"
@@ -31,26 +31,38 @@
3131
; Verification should succeed.
3232
; VERIFY: No errors.
3333

34-
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
34+
; ModuleID = 't.c'
35+
source_filename = "t.c"
36+
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32"
3537

36-
@q = common global i8* null, align 8, !dbg !102
37-
@r = common global i8* null, align 8, !dbg !105
38+
%struct.SameName = type { i32 }
39+
%struct.DifferentName = type { i32 }
3840

41+
@q = global %struct.SameName zeroinitializer, align 4, !dbg !0
42+
@r = global %struct.DifferentName zeroinitializer, align 4, !dbg !5
43+
44+
!llvm.module.flags = !{!14, !15, !16, !17, !18, !19, !20}
3945
!llvm.dbg.cu = !{!2}
40-
!llvm.module.flags = !{!6, !7}
41-
42-
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, emissionKind: FullDebug, globals: !5)
43-
!3 = !DIFile(filename: "/tmp/p.c", directory: "/")
44-
!4 = !{}
45-
!5 = !{!102, !105}
46-
!6 = !{i32 2, !"Dwarf Version", i32 4}
47-
!7 = !{i32 2, !"Debug Info Version", i32 3}
48-
49-
; marking the types as Swift is necessary because we only emit the linkage names for Swift types.
50-
!11 = !DICompositeType(tag: DW_TAG_structure_type, name: "SameName", file: !3, size: 64, runtimeLang: DW_LANG_Swift, identifier: "SameName")
51-
!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "DifferentName", file: !3, size: 64, runtimeLang: DW_LANG_Swift, identifier: "UniqueDifferentName")
52-
53-
!102 = !DIGlobalVariableExpression(var: !103, expr: !DIExpression())
54-
!103 = distinct !DIGlobalVariable(name: "q", scope: !2, file: !3, line: 1, type: !11, isLocal: false, isDefinition: true)
55-
!104 = distinct !DIGlobalVariable(name: "r", scope: !2, file: !3, line: 1, type: !12, isLocal: false, isDefinition: true)
56-
!105 = !DIGlobalVariableExpression(var: !104, expr: !DIExpression())
46+
47+
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
48+
!1 = distinct !DIGlobalVariable(name: "q", scope: !2, file: !3, line: 9, type: !11, isLocal: false, isDefinition: true)
49+
!2 = distinct !DICompileUnit(language: DW_LANG_C11, file: !3, emissionKind: FullDebug, globals: !4)
50+
!3 = !DIFile(filename: "t.c", directory: "/Volumes/External/Developer/llvm-build")
51+
!4 = !{!0, !5}
52+
!5 = !DIGlobalVariableExpression(var: !6, expr: !DIExpression())
53+
!6 = distinct !DIGlobalVariable(name: "r", scope: !2, file: !3, line: 10, type: !7, isLocal: false, isDefinition: true)
54+
!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "DifferentName", file: !3, line: 5, size: 32, runtimeLang: DW_LANG_Swift, identifier: "UniqueDifferentName", elements: !8)
55+
!8 = !{!9}
56+
!9 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !7, file: !3, line: 6, baseType: !10, size: 32)
57+
!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
58+
!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "SameName", file: !3, line: 1, size: 32, runtimeLang: DW_LANG_Swift, identifier: "SameName", elements: !12)
59+
!12 = !{!13}
60+
!13 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !11, file: !3, line: 2, baseType: !10, size: 32)
61+
!14 = !{i32 2, !"SDK Version", [2 x i32] [i32 14, i32 5]}
62+
!15 = !{i32 7, !"Dwarf Version", i32 4}
63+
!16 = !{i32 2, !"Debug Info Version", i32 3}
64+
!17 = !{i32 1, !"wchar_size", i32 4}
65+
!18 = !{i32 8, !"PIC Level", i32 2}
66+
!19 = !{i32 7, !"uwtable", i32 1}
67+
!20 = !{i32 7, !"frame-pointer", i32 1}
68+

0 commit comments

Comments
 (0)