xref: /llvm-project/llvm/test/DebugInfo/X86/debug-macro-dwo.ll (revision 01cee921abe924ae98027ce599d3c76ca5780a38)
120c9bb44SSourabh Singh Tomar; This test checks emission of .debug_macro.dwo section when
220c9bb44SSourabh Singh Tomar; -gdwarf-5 -gsplit-dwarf -fdebug-macro is specified.
320c9bb44SSourabh Singh Tomar
4*01cee921SDavid Blaikie; RUN: llc -dwarf-version=5 -O0 -filetype=obj \
55c245178SDavid Blaikie; RUN: -split-dwarf-file=foo.dwo < %s | llvm-dwarfdump -debug-macro -debug-info -debug-line -v - | FileCheck %s
620c9bb44SSourabh Singh Tomar
720c9bb44SSourabh Singh Tomar; CHECK-LABEL:  .debug_info contents:
820c9bb44SSourabh Singh Tomar; CHECK: DW_AT_macros [DW_FORM_sec_offset] (0x00000000)
920c9bb44SSourabh Singh Tomar
1020c9bb44SSourabh Singh Tomar; CHECK-LABEL:  .debug_macro.dwo contents:
1120c9bb44SSourabh Singh Tomar; CHECK-NEXT: 0x00000000:
125c245178SDavid Blaikie; CHECK-NEXT: macro header: version = 0x0005, flags = 0x02, format = DWARF32, debug_line_offset = 0x00000000
1320c9bb44SSourabh Singh Tomar; CHECK-NEXT: DW_MACRO_start_file - lineno: 0 filenum: 0
145c245178SDavid Blaikie; CHECK-NEXT:   DW_MACRO_start_file - lineno: 1 filenum: 1
1520c9bb44SSourabh Singh Tomar; CHECK-NEXT:     DW_MACRO_define_strx - lineno: 1 macro: FOO 5
1620c9bb44SSourabh Singh Tomar; CHECK-NEXT:   DW_MACRO_end_file
175c245178SDavid Blaikie; CHECK-NEXT:   DW_MACRO_start_file - lineno: 2 filenum: 2
1820c9bb44SSourabh Singh Tomar; CHECK-NEXT:     DW_MACRO_undef_strx - lineno: 14 macro: YEA
1920c9bb44SSourabh Singh Tomar; CHECK-NEXT:   DW_MACRO_end_file
2020c9bb44SSourabh Singh Tomar; CHECK-NEXT:   DW_MACRO_undef_strx - lineno: 14 macro: YEA
2120c9bb44SSourabh Singh Tomar; CHECK-NEXT: DW_MACRO_end_file
2220c9bb44SSourabh Singh Tomar
235c245178SDavid Blaikie; CHECK-LABEL: .debug_line.dwo contents:
245c245178SDavid Blaikie; CHECK: file_names[  0]:
255c245178SDavid Blaikie; CHECK:            name: "test.c"
265c245178SDavid Blaikie; CHECK: file_names[  1]:
275c245178SDavid Blaikie; CHECK:            name: "foo.h"
285c245178SDavid Blaikie; CHECK: file_names[  2]:
295c245178SDavid Blaikie; CHECK:            name: "bar.h"
305c245178SDavid Blaikie
315c245178SDavid Blaikie
325c245178SDavid Blaikie
3320c9bb44SSourabh Singh Tomar; ModuleID = 'test.c'
3420c9bb44SSourabh Singh Tomarsource_filename = "test.c"
3520c9bb44SSourabh Singh Tomartarget datalayout = "e-m:e-p200:32:32-p201:32:32-p202:64:64-i64:64-f80:128-n8:16:32:64-S128"
3620c9bb44SSourabh Singh Tomartarget triple = "x86_64-unknown-linux-gnu"
3720c9bb44SSourabh Singh Tomar
3820c9bb44SSourabh Singh Tomar!llvm.dbg.cu = !{!0}
3920c9bb44SSourabh Singh Tomar!llvm.module.flags = !{!14, !15, !16}
4020c9bb44SSourabh Singh Tomar!llvm.ident = !{!17}
4120c9bb44SSourabh Singh Tomar
4263a45091SDavid Blaikie!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0", isOptimized: false, runtimeVersion: 0, splitDebugFilename: "test.dwo", emissionKind: FullDebug, enums: !2, macros: !3, globals: !18, splitDebugInlining: false, nameTableKind: None)
4320c9bb44SSourabh Singh Tomar!1 = !DIFile(filename: "test.c", directory: "/home/", checksumkind: CSK_MD5, checksum: "ef6a7032e0c7ceeef614583f2c00dc80")
4420c9bb44SSourabh Singh Tomar!2 = !{}
4520c9bb44SSourabh Singh Tomar!3 = !{!4}
4620c9bb44SSourabh Singh Tomar!4 = !DIMacroFile(file: !1, nodes: !5)
4720c9bb44SSourabh Singh Tomar!5 = !{!6, !10, !13}
4820c9bb44SSourabh Singh Tomar!6 = !DIMacroFile(line: 1, file: !7, nodes: !8)
4920c9bb44SSourabh Singh Tomar!7 = !DIFile(filename: "./foo.h", directory: "/home/", checksumkind: CSK_MD5, checksum: "0f0cd0e15b44f49d3944992c8dc28661")
5020c9bb44SSourabh Singh Tomar!8 = !{!9}
5120c9bb44SSourabh Singh Tomar!9 = !DIMacro(type: DW_MACINFO_define, line: 1, name: "FOO", value: "5")
5220c9bb44SSourabh Singh Tomar!10 = !DIMacroFile(line: 2, file: !11, nodes: !12)
5320c9bb44SSourabh Singh Tomar!11 = !DIFile(filename: "./bar.h", directory: "/home/", checksumkind: CSK_MD5, checksum: "bf4b34c263eaaa1d7085c18243b8d100")
5420c9bb44SSourabh Singh Tomar!12 = !{!13}
5520c9bb44SSourabh Singh Tomar!13 = !DIMacro(type: DW_MACINFO_undef, line: 14, name: "YEA")
5620c9bb44SSourabh Singh Tomar!14 = !{i32 7, !"Dwarf Version", i32 5}
5720c9bb44SSourabh Singh Tomar!15 = !{i32 2, !"Debug Info Version", i32 3}
5820c9bb44SSourabh Singh Tomar!16 = !{i32 1, !"wchar_size", i32 4}
5920c9bb44SSourabh Singh Tomar!17 = !{!"clang version 11.0.0"}
6063a45091SDavid Blaikie!18 = !{!19}
6163a45091SDavid Blaikie!19 = !DIGlobalVariableExpression(var: !20, expr: !DIExpression())
6263a45091SDavid Blaikie!20 = distinct !DIGlobalVariable(name: "i", scope: !0, file: !21, line: 1, type: !22, isLocal: true, isDefinition: true)
6363a45091SDavid Blaikie!21 = !DIFile(filename: "./not_used_by_macro.h", directory: "/home/", checksumkind: CSK_MD5, checksum: "cf4b34c263eaaa1d7085c18243b8d101")
6463a45091SDavid Blaikie!22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
65