| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| ; REQUIRES: object-emission | ||
| ; RUN: %llc_dwarf -accel-tables=Dwarf -filetype=obj -o %t < %s | ||
| ; RUN: llvm-dwarfdump -debug-names %t | FileCheck %s | ||
| ; RUN: llvm-dwarfdump -debug-names -verify %t | FileCheck --check-prefix=VERIFY %s | ||
|
|
||
| ; Generated from the following C code using | ||
| ; clang -S -emit-llvm -g col.c | ||
| ; | ||
| ; These names were carefully chosen to cause hash collisions. Each type-variable | ||
| ; pair will hash to the same value. The also happen to demonstrate a flaw in the | ||
| ; DWARF v5 hash function: A copy constructor and an assignment operator for a | ||
| ; class will always hash to the same value. | ||
| ; | ||
| ; typedef void *_ZN4lldb7SBBlockaSERKS0_; | ||
| ; _ZN4lldb7SBBlockaSERKS0_ _ZN4lldb7SBBlockC1ERKS0_; | ||
| ; typedef void *_ZN4lldb7SBErroraSERKS0_; | ||
| ; _ZN4lldb7SBErroraSERKS0_ _ZN4lldb7SBErrorC1ERKS0_; | ||
| ; typedef void *_ZN4lldb7SBValueaSERKS0_; | ||
| ; _ZN4lldb7SBValueaSERKS0_ _ZN4lldb7SBValueC1ERKS0_; | ||
| ; typedef void *_ZL11numCommutes; | ||
| ; _ZL11numCommutes _ZL11NumCommutes; | ||
| ; typedef void *_ZL9NumRemats; | ||
| ; _ZL9NumRemats _ZL9NumReMats; | ||
|
|
||
| ; Check that we have the right amount of hashes and names. | ||
| ; CHECK: Bucket count: 5 | ||
| ; CHECK: Name count: 10 | ||
|
|
||
| ; Check that all the names are present in the output | ||
| ; CHECK: Bucket 0 | ||
| ; CHECK: Hash: 0xF8CF70D | ||
| ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZN4lldb7SBBlockaSERKS0_" | ||
| ; CHECK: Hash: 0xF8CF70D | ||
| ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZN4lldb7SBBlockC1ERKS0_" | ||
| ; CHECK: Hash: 0x135A482C | ||
| ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZN4lldb7SBErroraSERKS0_" | ||
| ; CHECK: Hash: 0x135A482C | ||
| ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZN4lldb7SBErrorC1ERKS0_" | ||
| ; CHECK-NOT: String: | ||
| ; CHECK: Bucket 1 | ||
| ; CHECK-NEXT: EMPTY | ||
| ; CHECK: Bucket 2 | ||
| ; CHECK: Hash: 0x2841B989 | ||
| ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZL11numCommutes" | ||
| ; CHECK: Hash: 0x2841B989 | ||
| ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZL11NumCommutes" | ||
| ; CHECK: Hash: 0x3E190F5F | ||
| ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZL9NumRemats" | ||
| ; CHECK: Hash: 0x3E190F5F | ||
| ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZL9NumReMats" | ||
| ; CHECK-NOT: String: | ||
| ; CHECK: Bucket 3 | ||
| ; CHECK: Hash: 0x2642207F | ||
| ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZN4lldb7SBValueaSERKS0_" | ||
| ; CHECK: Hash: 0x2642207F | ||
| ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZN4lldb7SBValueC1ERKS0_" | ||
| ; CHECK-NOT: String: | ||
| ; CHECK: Bucket 4 | ||
| ; CHECK-NEXT: EMPTY | ||
|
|
||
| ; VERIFY: No errors. | ||
|
|
||
| ; ModuleID = '/tmp/col.c' | ||
| source_filename = "/tmp/col.c" | ||
| target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
| target triple = "x86_64-unknown-linux-gnu" | ||
|
|
||
| @_ZN4lldb7SBBlockC1ERKS0_ = common dso_local global i8* null, align 8, !dbg !0 | ||
| @_ZN4lldb7SBErrorC1ERKS0_ = common dso_local global i8* null, align 8, !dbg !6 | ||
| @_ZN4lldb7SBValueC1ERKS0_ = common dso_local global i8* null, align 8, !dbg !10 | ||
| @_ZL11NumCommutes = common dso_local global i8* null, align 8, !dbg !13 | ||
| @_ZL9NumReMats = common dso_local global i8* null, align 8, !dbg !16 | ||
|
|
||
| !llvm.dbg.cu = !{!2} | ||
| !llvm.module.flags = !{!20, !21, !22} | ||
| !llvm.ident = !{!23} | ||
|
|
||
| !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) | ||
| !1 = distinct !DIGlobalVariable(name: "_ZN4lldb7SBBlockC1ERKS0_", scope: !2, file: !3, line: 1, type: !19, isLocal: false, isDefinition: true) | ||
| !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (trunk 325496) (llvm/trunk 325732)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5) | ||
| !3 = !DIFile(filename: "/tmp/col.c", directory: "/tmp") | ||
| !4 = !{} | ||
| !5 = !{!0, !6, !10, !13, !16} | ||
| !6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression()) | ||
| !7 = distinct !DIGlobalVariable(name: "_ZN4lldb7SBErrorC1ERKS0_", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true) | ||
| !8 = !DIDerivedType(tag: DW_TAG_typedef, name: "_ZN4lldb7SBErroraSERKS0_", file: !3, line: 2, baseType: !9) | ||
| !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) | ||
| !10 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression()) | ||
| !11 = distinct !DIGlobalVariable(name: "_ZN4lldb7SBValueC1ERKS0_", scope: !2, file: !3, line: 3, type: !12, isLocal: false, isDefinition: true) | ||
| !12 = !DIDerivedType(tag: DW_TAG_typedef, name: "_ZN4lldb7SBValueaSERKS0_", file: !3, line: 3, baseType: !9) | ||
| !13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression()) | ||
| !14 = distinct !DIGlobalVariable(name: "_ZL11NumCommutes", scope: !2, file: !3, line: 4, type: !15, isLocal: false, isDefinition: true) | ||
| !15 = !DIDerivedType(tag: DW_TAG_typedef, name: "_ZL11numCommutes", file: !3, line: 4, baseType: !9) | ||
| !16 = !DIGlobalVariableExpression(var: !17, expr: !DIExpression()) | ||
| !17 = distinct !DIGlobalVariable(name: "_ZL9NumReMats", scope: !2, file: !3, line: 5, type: !18, isLocal: false, isDefinition: true) | ||
| !18 = !DIDerivedType(tag: DW_TAG_typedef, name: "_ZL9NumRemats", file: !3, line: 5, baseType: !9) | ||
| !19 = !DIDerivedType(tag: DW_TAG_typedef, name: "_ZN4lldb7SBBlockaSERKS0_", file: !3, line: 1, baseType: !9) | ||
| !20 = !{i32 2, !"Dwarf Version", i32 4} | ||
| !21 = !{i32 2, !"Debug Info Version", i32 3} | ||
| !22 = !{i32 1, !"wchar_size", i32 4} | ||
| !23 = !{!"clang version 7.0.0 (trunk 325496) (llvm/trunk 325732)"} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| ; REQUIRES: object-emission | ||
| ; RUN: %llc_dwarf -accel-tables=Dwarf -filetype=obj -o %t < %s | ||
| ; RUN: llvm-dwarfdump -debug-names %t | FileCheck %s | ||
| ; RUN: llvm-dwarfdump -debug-names -verify %t | FileCheck --check-prefix=VERIFY %s | ||
|
|
||
| ; Generated from the following C code using | ||
| ; clang -S -emit-llvm col.cc | ||
| ; | ||
| ; namespace foo { struct foo {}; struct foo foo; } | ||
| ; namespace bar { struct bar {}; struct bar bar; } | ||
| ; namespace baz { struct baz {}; struct baz baz; } | ||
|
|
||
| ; We have 6 names: foo, bar, baz and three mangled names of the variables. | ||
| ; CHECK: Name count: 6 | ||
|
|
||
| ; Check that all the names are present in the output correct number of times. | ||
| ; CHECK: String: 0x{{[0-9a-f]*}} "bar" | ||
| ; CHECK-DAG: Tag: DW_TAG_namespace | ||
| ; CHECK-DAG: Tag: DW_TAG_variable | ||
| ; CHECK-DAG: Tag: DW_TAG_structure_type | ||
| ; CHECK: String: 0x{{[0-9a-f]*}} "baz" | ||
| ; CHECK-DAG: Tag: DW_TAG_namespace | ||
| ; CHECK-DAG: Tag: DW_TAG_variable | ||
| ; CHECK-DAG: Tag: DW_TAG_structure_type | ||
| ; CHECK: String: 0x{{[0-9a-f]*}} "foo" | ||
| ; CHECK-DAG: Tag: DW_TAG_namespace | ||
| ; CHECK-DAG: Tag: DW_TAG_variable | ||
| ; CHECK-DAG: Tag: DW_TAG_structure_type | ||
| ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN3foo3fooE" | ||
| ; CHECK: Tag: DW_TAG_variable | ||
| ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN3bar3barE" | ||
| ; CHECK: Tag: DW_TAG_variable | ||
| ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN3baz3bazE" | ||
| ; CHECK: Tag: DW_TAG_variable | ||
|
|
||
| ; VERIFY: No errors. | ||
|
|
||
| ; ModuleID = '/tmp/col.cc' | ||
| source_filename = "/tmp/col.cc" | ||
| target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
| target triple = "x86_64-unknown-linux-gnu" | ||
|
|
||
| %"struct.foo::foo" = type { i8 } | ||
| %"struct.bar::bar" = type { i8 } | ||
| %"struct.baz::baz" = type { i8 } | ||
|
|
||
| @_ZN3foo3fooE = dso_local global %"struct.foo::foo" zeroinitializer, align 1, !dbg !0 | ||
| @_ZN3bar3barE = dso_local global %"struct.bar::bar" zeroinitializer, align 1, !dbg !6 | ||
| @_ZN3baz3bazE = dso_local global %"struct.baz::baz" zeroinitializer, align 1, !dbg !10 | ||
|
|
||
| !llvm.dbg.cu = !{!14} | ||
| !llvm.module.flags = !{!16, !17, !18} | ||
| !llvm.ident = !{!19} | ||
|
|
||
| !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) | ||
| !1 = distinct !DIGlobalVariable(name: "foo", linkageName: "_ZN3foo3fooE", scope: !2, file: !3, line: 1, type: !4, isLocal: false, isDefinition: true) | ||
| !2 = !DINamespace(name: "foo", scope: null) | ||
| !3 = !DIFile(filename: "/tmp/col.cc", directory: "/tmp") | ||
| !4 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "foo", scope: !2, file: !3, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !5, identifier: "_ZTSN3foo3fooE") | ||
| !5 = !{} | ||
| !6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression()) | ||
| !7 = distinct !DIGlobalVariable(name: "bar", linkageName: "_ZN3bar3barE", scope: !8, file: !3, line: 2, type: !9, isLocal: false, isDefinition: true) | ||
| !8 = !DINamespace(name: "bar", scope: null) | ||
| !9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "bar", scope: !8, file: !3, line: 2, size: 8, flags: DIFlagTypePassByValue, elements: !5, identifier: "_ZTSN3bar3barE") | ||
| !10 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression()) | ||
| !11 = distinct !DIGlobalVariable(name: "baz", linkageName: "_ZN3baz3bazE", scope: !12, file: !3, line: 3, type: !13, isLocal: false, isDefinition: true) | ||
| !12 = !DINamespace(name: "baz", scope: null) | ||
| !13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "baz", scope: !12, file: !3, line: 3, size: 8, flags: DIFlagTypePassByValue, elements: !5, identifier: "_ZTSN3baz3bazE") | ||
| !14 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.0 (trunk 325496) (llvm/trunk 325732)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !15) | ||
| !15 = !{!0, !6, !10} | ||
| !16 = !{i32 2, !"Dwarf Version", i32 4} | ||
| !17 = !{i32 2, !"Debug Info Version", i32 3} | ||
| !18 = !{i32 1, !"wchar_size", i32 4} | ||
| !19 = !{!"clang version 7.0.0 (trunk 325496) (llvm/trunk 325732)"} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| ; REQUIRES: object-emission | ||
| ; RUN: %llc_dwarf -accel-tables=Dwarf -filetype=obj -o %t < %s | ||
| ; RUN: llvm-dwarfdump -debug-names %t | FileCheck %s | ||
| ; RUN: llvm-dwarfdump -debug-names -verify %t | FileCheck --check-prefix=VERIFY %s | ||
|
|
||
| ; Check the header | ||
| ; CHECK: CU count: 1 | ||
| ; CHECK: Local TU count: 0 | ||
| ; CHECK: Foreign TU count: 0 | ||
| ; CHECK: Name count: 1 | ||
| ; CHECK: CU[0]: 0x{{[0-9a-f]*}} | ||
|
|
||
| ; CHECK: Abbreviation [[ABBREV:0x[0-9a-f]*]] | ||
| ; CHECK-NEXT: Tag: DW_TAG_variable | ||
| ; CHECK-NEXT: DW_IDX_die_offset: DW_FORM_ref4 | ||
|
|
||
| ; CHECK: String: 0x{{[0-9a-f]*}} "foobar" | ||
| ; CHECK-NEXT: Entry | ||
| ; CHECK-NEXT: Abbrev: [[ABBREV]] | ||
| ; CHECK-NEXT: Tag: DW_TAG_variable | ||
| ; CHECK-NEXT: DW_IDX_die_offset: 0x{{[0-9a-f]*}} | ||
|
|
||
| ; VERIFY: No errors. | ||
|
|
||
| target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
| target triple = "x86_64-unknown-linux-gnu" | ||
|
|
||
| @foobar = common dso_local global i8* null, align 8, !dbg !0 | ||
|
|
||
| !llvm.dbg.cu = !{!2} | ||
| !llvm.module.flags = !{!7, !8, !9} | ||
| !llvm.ident = !{!10} | ||
|
|
||
| !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) | ||
| !1 = distinct !DIGlobalVariable(name: "foobar", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true) | ||
| !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (trunk 325496) (llvm/trunk 325732)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5) | ||
| !3 = !DIFile(filename: "/tmp/cu1.c", directory: "/tmp") | ||
| !4 = !{} | ||
| !5 = !{!0} | ||
| !6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) | ||
| !7 = !{i32 2, !"Dwarf Version", i32 4} | ||
| !8 = !{i32 2, !"Debug Info Version", i32 3} | ||
| !9 = !{i32 1, !"wchar_size", i32 4} | ||
| !10 = !{!"clang version 7.0.0 (trunk 325496) (llvm/trunk 325732)"} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| ; REQUIRES: object-emission | ||
| ; RUN: %llc_dwarf -accel-tables=Dwarf -filetype=obj -o %t < %s | ||
| ; RUN: llvm-dwarfdump -debug-names %t | FileCheck %s | ||
| ; RUN: llvm-dwarfdump -debug-names -verify %t | FileCheck --check-prefix=VERIFY %s | ||
|
|
||
| ; Check the header | ||
| ; CHECK: CU count: 2 | ||
| ; CHECK: Local TU count: 0 | ||
| ; CHECK: Foreign TU count: 0 | ||
| ; CHECK: Name count: 2 | ||
| ; CHECK: CU[0]: 0x{{[0-9a-f]*}} | ||
| ; CHECK: CU[1]: 0x{{[0-9a-f]*}} | ||
|
|
||
| ; CHECK: Abbreviation [[ABBREV:0x[0-9a-f]*]] | ||
| ; CHECK-NEXT: Tag: DW_TAG_variable | ||
| ; CHECK-NEXT: DW_IDX_compile_unit: DW_FORM_data1 | ||
| ; CHECK-NEXT: DW_IDX_die_offset: DW_FORM_ref4 | ||
|
|
||
| ; CHECK: String: 0x{{[0-9a-f]*}} "foobar2" | ||
| ; CHECK-NEXT: Entry | ||
| ; CHECK-NEXT: Abbrev: [[ABBREV]] | ||
| ; CHECK-NEXT: Tag: DW_TAG_variable | ||
| ; CHECK-NEXT: DW_IDX_compile_unit: 0x01 | ||
| ; CHECK-NEXT: DW_IDX_die_offset: 0x{{[0-9a-f]*}} | ||
|
|
||
| ; CHECK: String: 0x{{[0-9a-f]*}} "foobar1" | ||
| ; CHECK-NEXT: Entry | ||
| ; CHECK-NEXT: Abbrev: [[ABBREV]] | ||
| ; CHECK-NEXT: Tag: DW_TAG_variable | ||
| ; CHECK-NEXT: DW_IDX_compile_unit: 0x00 | ||
| ; CHECK-NEXT: DW_IDX_die_offset: 0x{{[0-9a-f]*}} | ||
|
|
||
| ; VERIFY: No errors. | ||
|
|
||
| target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
| target triple = "x86_64-unknown-linux-gnu" | ||
|
|
||
| !llvm.dbg.cu = !{!12, !22} | ||
| !llvm.module.flags = !{!7, !8, !9} | ||
| !llvm.ident = !{!0} | ||
| !7 = !{i32 2, !"Dwarf Version", i32 4} | ||
| !8 = !{i32 2, !"Debug Info Version", i32 3} | ||
| !9 = !{i32 1, !"wchar_size", i32 4} | ||
| !0 = !{!"clang version 7.0.0 (trunk 325496) (llvm/trunk 325732)"} | ||
| !4 = !{} | ||
| !6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) | ||
| !3 = !DIFile(filename: "/tmp/cu2.c", directory: "/tmp") | ||
|
|
||
| @foobar1 = common dso_local global i8* null, align 8, !dbg !10 | ||
| !10 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression()) | ||
| !11 = distinct !DIGlobalVariable(name: "foobar1", scope: !12, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true) | ||
| !12 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (trunk 325496) (llvm/trunk 325732)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !15) | ||
| !15 = !{!10} | ||
|
|
||
| @foobar2 = common dso_local global i8* null, align 8, !dbg !20 | ||
| !20 = !DIGlobalVariableExpression(var: !21, expr: !DIExpression()) | ||
| !21 = distinct !DIGlobalVariable(name: "foobar2", scope: !22, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true) | ||
| !22 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (trunk 325496) (llvm/trunk 325732)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !25) | ||
| !25 = !{!20} |