xref: /llvm-project/llvm/test/DebugInfo/X86/debug-macro-strx-dwo.s (revision ccbd7e8d463a1d40852c6acbbecd3ae1e2c38f4c)
1## This test checks that llvm-dwarfdump can dump debug_macro.dwo
2## section containing DW_MACRO_*_strx forms present in a dwo 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.dwo 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_strx - lineno: 1 macro: DWARF_VERSION 5
12# CHECK-NEXT:  DW_MACRO_undef_strx - lineno: 4 macro: DWARF_VERSION
13# CHECK-NEXT:DW_MACRO_end_file
14
15	.section	.debug_macro.dwo,"e",@progbits
16.Lcu_macro_begin0:
17	.short	5                      # Macro information version
18	.byte	2                       # Flags: 32 bit, debug_line_offset present
19	.long	0                       # debug_line_offset
20	.byte	3                       # DW_MACRO_start_file
21	.byte	0                       # Line Number
22	.byte	0                       # File Number
23	.byte	11                      # DW_MACRO_define_strx
24	.byte	1                       # Line Number
25	.byte	0                       # Macro String Index
26	.byte	12                      # DW_MACRO_undef_strx
27	.byte	4                       # Line Number
28	.byte	1                       # Macro String Index
29	.byte	4                       # DW_MACRO_end_file
30	.byte	0                       # End Of Macro List Mark
31
32	.section	.debug_str_offsets.dwo,"e",@progbits
33	.long   .Lcu_str_off_end0-.Lcu_str_off_start0 # Unit length
34	.short	5                                     # Version
35	.short	0                                     # Padding
36.Lcu_str_off_start0:
37	.long	.Linfo_string0-.debug_str.dwo
38	.long	.Linfo_string1-.debug_str.dwo
39.Lcu_str_off_end0:
40
41	.section	.debug_str.dwo,"eMS",@progbits,1
42.Linfo_string0:
43	.asciz	"DWARF_VERSION 5"
44.Linfo_string1:
45	.asciz	"DWARF_VERSION"
46
47	.section	.debug_info.dwo,"e",@progbits
48	.long	.Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit
49.Ldebug_info_dwo_start0:
50	.short	5                      # DWARF version number
51	.byte	5                       # DWARF Unit Type
52	.byte	8                       # Address Size (in bytes)
53	.long	0                       # Offset Into Abbrev. Section
54	.quad	1536875774479801980
55	.byte	1                       # Abbrev [1] 0x14:0x1a DW_TAG_compile_unit
56	.long   .Lcu_macro_begin0-.debug_macro.dwo # DW_AT_macros
57	.byte	0                       # End Of Children Mark
58.Ldebug_info_dwo_end0:
59
60	.section	.debug_abbrev.dwo,"e",@progbits
61	.byte	1                       # Abbreviation Code
62	.byte	17                      # DW_TAG_compile_unit
63	.byte	0                       # DW_CHILDREN_no
64	.byte	121                     # DW_AT_macros
65	.byte	23                      # DW_FORM_sec_offset
66	.byte	0                       # EOM(1)
67	.byte	0                       # EOM(2)
68	.byte	0                       # EOM(3)
69