xref: /llvm-project/llvm/test/DebugInfo/X86/debug-macro-macinfo.s (revision ccbd7e8d463a1d40852c6acbbecd3ae1e2c38f4c)
1## This test checks that llvm-dwarfdump can dump both debug_macro and debug_macinfo
2## sections present in the same object.
3
4# RUN: llvm-mc -triple x86_64-unknown-linux -filetype=obj %s -o -| \
5# RUN:   llvm-dwarfdump -debug-macro - | FileCheck -strict-whitespace -match-full-lines %s
6
7#      CHECK:.debug_macro contents:
8# CHECK-NEXT:0x00000000:
9# CHECK-NEXT:macro header: version = 0x0005, flags = 0x02, format = DWARF32, debug_line_offset = 0x00000000
10# CHECK-NEXT:DW_MACRO_start_file - lineno: 0 filenum: 0
11# CHECK-NEXT:  DW_MACRO_define_strp - lineno: 1 macro: DWARF_VERSION 5
12# CHECK-NEXT:DW_MACRO_end_file
13
14#      CHECK:.debug_macinfo contents:
15# CHECK-NEXT:0x00000000:
16# CHECK-NEXT:DW_MACINFO_start_file - lineno: 0 filenum: 2
17# CHECK-NEXT:  DW_MACINFO_define - lineno: 6 macro: DWARF_VERSION 4
18# CHECK-NEXT:DW_MACINFO_end_file
19
20	.section	.debug_macro,"",@progbits
21.Lcu_macro_begin0:
22	.short	5                      # Macro information version
23	.byte	2                       # Flags: 32 bit, debug_line_offset present
24	.long	0                       # debug_line_offset
25	.byte	3                       # DW_MACRO_start_file
26	.byte	0                       # Line Number
27	.byte	0                       # File Number
28	.byte	5                       # DW_MACRO_define_strp
29	.byte	1                       # Line Number
30	.long	.Linfo_string0          # Macro String
31	.byte	4                       # DW_MACRO_end_file
32	.byte	0                       # End Of Macro List Mark
33
34	.section	.debug_macinfo,"",@progbits
35.Lcu_macro_begin1:
36	.byte	3                       # DW_MACINFO_start_file
37	.byte	0                       # Line Number
38	.byte	2                       # File Number
39	.byte	1                       # DW_MACINFO_define
40	.byte	6                       # Line Number
41	.asciz	"DWARF_VERSION 4"      # Macro String
42	.byte	4                       # DW_MACINFO_end_file
43	.byte	0                       # End Of Macro List Mark
44
45	.section	.debug_str,"MS",@progbits,1
46.Linfo_string0:
47	.asciz	"DWARF_VERSION 5"
48