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