|
| 1 | +; RUN: %llc_dwarf -debugger-tune=lldb -accel-tables=Dwarf -filetype=obj -o %t < %s |
| 2 | +; RUN: dsymutil %t -o %t.dSYM |
| 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, "int", "SameName", "DifferentName", "UniqueDifferentName"). |
| 19 | +; SAME-NAME: Name count: 6 |
| 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 | + |
| 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" |
| 37 | +target triple = "arm64-apple-macosx14.5.0" |
| 38 | + |
| 39 | +%struct.SameName = type { i32 } |
| 40 | +%struct.DifferentName = type { i32 } |
| 41 | + |
| 42 | +@q = global %struct.SameName zeroinitializer, align 4, !dbg !0 |
| 43 | +@r = global %struct.DifferentName zeroinitializer, align 4, !dbg !5 |
| 44 | + |
| 45 | +!llvm.module.flags = !{!14, !15, !16, !17, !18, !19, !20} |
| 46 | +!llvm.dbg.cu = !{!2} |
| 47 | +!llvm.ident = !{!21} |
| 48 | + |
| 49 | +!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 50 | +!1 = distinct !DIGlobalVariable(name: "q", scope: !2, file: !3, line: 9, type: !11, isLocal: false, isDefinition: true) |
| 51 | +!2 = distinct !DICompileUnit(language: DW_LANG_C11, file: !3, producer: "clang version 1", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: Apple) |
| 52 | +!3 = !DIFile(filename: "t.c", directory: "/") |
| 53 | +!4 = !{!0, !5} |
| 54 | +!5 = !DIGlobalVariableExpression(var: !6, expr: !DIExpression()) |
| 55 | +!6 = distinct !DIGlobalVariable(name: "r", scope: !2, file: !3, line: 10, type: !7, isLocal: false, isDefinition: true) |
| 56 | +!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "DifferentName", file: !3, line: 5, size: 32, runtimeLang: DW_LANG_Swift, identifier: "UniqueDifferentName", elements: !8) |
| 57 | +!8 = !{!9} |
| 58 | +!9 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !7, file: !3, line: 6, baseType: !10, size: 32) |
| 59 | +!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 60 | +!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "SameName", file: !3, line: 1, size: 32, runtimeLang: DW_LANG_Swift, identifier: "SameName", elements: !12) |
| 61 | +!12 = !{!13} |
| 62 | +!13 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !11, file: !3, line: 2, baseType: !10, size: 32) |
| 63 | +!14 = !{i32 2, !"SDK Version", [2 x i32] [i32 14, i32 5]} |
| 64 | +!15 = !{i32 7, !"Dwarf Version", i32 4} |
| 65 | +!16 = !{i32 2, !"Debug Info Version", i32 3} |
| 66 | +!17 = !{i32 1, !"wchar_size", i32 4} |
| 67 | +!18 = !{i32 8, !"PIC Level", i32 2} |
| 68 | +!19 = !{i32 7, !"uwtable", i32 1} |
| 69 | +!20 = !{i32 7, !"frame-pointer", i32 1} |
| 70 | +!21 = !{!"clang version 1"} |
0 commit comments