1 ; REQUIRES: object-emission
2 ; RUN: %llc_dwarf -accel-tables=Dwarf -dwarf-linkage-names=All -filetype=obj -o %t < %s
3 ; RUN: llvm-dwarfdump -debug-names %t | FileCheck %s
4 ; RUN: llvm-dwarfdump -debug-names -verify %t | FileCheck --check-prefix=VERIFY %s
6 ; Generated from the following C code using
7 ; clang -S -emit-llvm col.cc
9 ; namespace foo { struct foo {}; struct foo foo; }
10 ; namespace bar { struct bar {}; struct bar bar; }
11 ; namespace baz { struct baz {}; struct baz baz; }
13 ; We have 6 names: foo, bar, baz and three mangled names of the variables.
14 ; CHECK: Name count: 6
16 ; Check that all the names are present in the output correct number of times.
17 ; CHECK: String: 0x{{[0-9a-f]*}} "bar"
18 ; CHECK-DAG: Tag: DW_TAG_namespace
19 ; CHECK-DAG: Tag: DW_TAG_variable
20 ; CHECK-DAG: Tag: DW_TAG_structure_type
21 ; CHECK: String: 0x{{[0-9a-f]*}} "baz"
22 ; CHECK-DAG: Tag: DW_TAG_namespace
23 ; CHECK-DAG: Tag: DW_TAG_variable
24 ; CHECK-DAG: Tag: DW_TAG_structure_type
25 ; CHECK: String: 0x{{[0-9a-f]*}} "foo"
26 ; CHECK-DAG: Tag: DW_TAG_namespace
27 ; CHECK-DAG: Tag: DW_TAG_variable
28 ; CHECK-DAG: Tag: DW_TAG_structure_type
29 ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN3foo3fooE"
30 ; CHECK: Tag: DW_TAG_variable
31 ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN3bar3barE"
32 ; CHECK: Tag: DW_TAG_variable
33 ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN3baz3bazE"
34 ; CHECK: Tag: DW_TAG_variable
38 %"struct.foo::foo" = type { i8 }
39 %"struct.bar::bar" = type { i8 }
40 %"struct.baz::baz" = type { i8 }
42 @_ZN3foo3fooE = dso_local global %"struct.foo::foo" zeroinitializer, align 1, !dbg !0
43 @_ZN3bar3barE = dso_local global %"struct.bar::bar" zeroinitializer, align 1, !dbg !6
44 @_ZN3baz3bazE = dso_local global %"struct.baz::baz" zeroinitializer, align 1, !dbg !10
47 !llvm.module.flags = !{!16, !17, !18}
50 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
51 !1 = distinct !DIGlobalVariable(name: "foo", linkageName: "_ZN3foo3fooE", scope: !2, file: !3, line: 1, type: !4, isLocal: false, isDefinition: true)
52 !2 = !DINamespace(name: "foo", scope: null)
53 !3 = !DIFile(filename: "/tmp/col.cc", directory: "/tmp")
54 !4 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "foo", scope: !2, file: !3, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !5, identifier: "_ZTSN3foo3fooE")
56 !6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
57 !7 = distinct !DIGlobalVariable(name: "bar", linkageName: "_ZN3bar3barE", scope: !8, file: !3, line: 2, type: !9, isLocal: false, isDefinition: true)
58 !8 = !DINamespace(name: "bar", scope: null)
59 !9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "bar", scope: !8, file: !3, line: 2, size: 8, flags: DIFlagTypePassByValue, elements: !5, identifier: "_ZTSN3bar3barE")
60 !10 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression())
61 !11 = distinct !DIGlobalVariable(name: "baz", linkageName: "_ZN3baz3bazE", scope: !12, file: !3, line: 3, type: !13, isLocal: false, isDefinition: true)
62 !12 = !DINamespace(name: "baz", scope: null)
63 !13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "baz", scope: !12, file: !3, line: 3, size: 8, flags: DIFlagTypePassByValue, elements: !5, identifier: "_ZTSN3baz3bazE")
64 !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)
66 !16 = !{i32 2, !"Dwarf Version", i32 4}
67 !17 = !{i32 2, !"Debug Info Version", i32 3}
68 !18 = !{i32 1, !"wchar_size", i32 4}
69 !19 = !{!"clang version 7.0.0 (trunk 325496) (llvm/trunk 325732)"}