1; XFAIL: target={{.*}}-aix{{.*}}, target={{.*}}-zos{{.*}} 2; RUN: %llc_dwarf -debugger-tune=lldb -accel-tables=Dwarf -filetype=obj -o %t < %s 3; RUN: llvm-dwarfdump %t | FileCheck %s 4; RUN: llvm-dwarfdump -debug-names %t | FileCheck --check-prefix=SAME-NAME %s 5; RUN: llvm-dwarfdump -debug-names %t | FileCheck --check-prefix=DIFFERENT-NAME %s 6; RUN: llvm-dwarfdump -debug-names %t | FileCheck --check-prefix=UNIQUE-DIFFERENT-NAME %s 7; RUN: llvm-dwarfdump -debug-names -verify %t | FileCheck --check-prefix=VERIFY %s 8 9 10; CHECK: DW_TAG_structure_type 11; CHECK: DW_AT_name ("SameName") 12; CHECK: DW_AT_linkage_name ("SameName") 13 14; CHECK: DW_TAG_structure_type 15; CHECK: DW_AT_name ("DifferentName") 16; CHECK: DW_AT_linkage_name ("UniqueDifferentName") 17 18; The name count should be 5 (the two variables, the two human readable names, one mangled name). 19; SAME-NAME: Name count: 5 20 21; The accelarator should only have one entry for the three following names. 22; SAME-NAME: "SameName" 23; SAME-NAME-NOT: "SameName" 24 25; DIFFERENT-NAME: "DifferentName" 26; DIFFERENT-NAME-NOT: "DifferentName" 27 28; UNIQUE-DIFFERENT-NAME: "UniqueDifferentName" 29; UNIQUE-DIFFERENT-NAME-NOT: "UniqueDifferentName" 30 31; Verification should succeed. 32; VERIFY: No errors. 33 34target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" 35 36@q = common global i8* null, align 8, !dbg !102 37@r = common global i8* null, align 8, !dbg !105 38 39!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()) 57