1 ; REQUIRES: object-emission
2 ; RUN: %llc_dwarf -accel-tables=Dwarf -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
8 ; CHECK: Local TU count: 0
9 ; CHECK: Foreign TU count: 0
10 ; CHECK: Name count: 2
11 ; CHECK: CU[0]: 0x{{[0-9a-f]*}}
12 ; CHECK: CU[1]: 0x{{[0-9a-f]*}}
14 ; CHECK: Abbreviation [[ABBREV:0x[0-9a-f]*]]
15 ; CHECK-NEXT: Tag: DW_TAG_variable
16 ; CHECK-NEXT: DW_IDX_compile_unit: DW_FORM_data1
17 ; CHECK-NEXT: DW_IDX_die_offset: DW_FORM_ref4
19 ; CHECK: String: 0x{{[0-9a-f]*}} "foobar2"
21 ; CHECK-NEXT: Abbrev: [[ABBREV]]
22 ; CHECK-NEXT: Tag: DW_TAG_variable
23 ; CHECK-NEXT: DW_IDX_compile_unit: 0x01
24 ; CHECK-NEXT: DW_IDX_die_offset: 0x{{[0-9a-f]*}}
26 ; CHECK: String: 0x{{[0-9a-f]*}} "foobar1"
28 ; CHECK-NEXT: Abbrev: [[ABBREV]]
29 ; CHECK-NEXT: Tag: DW_TAG_variable
30 ; CHECK-NEXT: DW_IDX_compile_unit: 0x00
31 ; CHECK-NEXT: DW_IDX_die_offset: 0x{{[0-9a-f]*}}
35 !llvm.dbg.cu = !{!12, !22}
36 !llvm.module.flags = !{!7, !8, !9}
38 !7 = !{i32 2, !"Dwarf Version", i32 4}
39 !8 = !{i32 2, !"Debug Info Version", i32 3}
40 !9 = !{i32 1, !"wchar_size", i32 4}
41 !0 = !{!"clang version 7.0.0 (trunk 325496) (llvm/trunk 325732)"}
43 !6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
44 !3 = !DIFile(filename: "/tmp/cu2.c", directory: "/tmp")
46 @foobar1 = common dso_local global i8* null, align 8, !dbg !10
47 !10 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression())
48 !11 = distinct !DIGlobalVariable(name: "foobar1", scope: !12, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
49 !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)
52 @foobar2 = common dso_local global i8* null, align 8, !dbg !20
53 !20 = !DIGlobalVariableExpression(var: !21, expr: !DIExpression())
54 !21 = distinct !DIGlobalVariable(name: "foobar2", scope: !22, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
55 !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)