1## This test checks llvm-dwarfdump can dump debug_macro section containing
2## multiple macro units.
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_start_file - lineno: 1 filenum: 6
12# CHECK-NEXT:    DW_MACRO_define_strp - lineno: 1 macro: FOO 5
13# CHECK-NEXT:  DW_MACRO_end_file
14# CHECK-NEXT:  DW_MACRO_undef_strp - lineno: 8 macro: WORLD1
15# CHECK-NEXT:  DW_MACRO_import - import offset: 0x[[OFFSET:[0-9]+]]
16# CHECK-NEXT:DW_MACRO_end_file
17
18#      CHECK:0x[[OFFSET]]:
19# CHECK-NEXT:macro header: version = 0x0005, flags = 0x00, format = DWARF32
20# CHECK-NEXT:DW_MACRO_define_strp - lineno: 0 macro: WORLD 2
21
22	.section	.debug_macro,"",@progbits
23.Lcu_macro_begin0:
24	.short	5                      # Macro information version
25	.byte	2                       # Flags: 32 bit, debug_line_offset present
26	.long	0                       # debug_line_offset
27	.byte	3                       # DW_MACRO_start_file
28	.byte	0                       # Line Number
29	.byte	0                       # File Number
30	.byte	3                       # DW_MACRO_start_file
31	.byte	1                       # Line Number
32	.byte	6                       # File Number
33	.byte	5                       # DW_MACRO_define_strp
34	.byte	1                       # Line Number
35	.long	.Linfo_string0          # Macro String
36	.byte	4                       # DW_MACRO_end_file
37	.byte	6                       # DW_MACRO_undef_strp
38	.byte	8                       # Line Number
39	.long	.Linfo_string1          # Macro String
40	.byte	7                       # DW_MACRO_import
41	.long	.Lmacro1                # Macro Unit Offset
42	.byte	4                       # DW_MACRO_end_file
43	.byte	0                       # End Of Macro List Mark
44
45.Lmacro1:
46	.short	5                      # Macro information version
47	.byte	0                       # Flags: 32 bit
48	.byte	5                       # DW_MACRO_define_strp
49	.byte	0                       # Line Number
50	.long	.Linfo_string2          # Macro String
51	.byte	0                       # End Of Macro List Mark
52
53	.section	.debug_str,"MS",@progbits,1
54.Linfo_string0:
55	.asciz	"FOO 5"
56.Linfo_string1:
57	.asciz	"WORLD1"
58.Linfo_string2:
59	.asciz	"WORLD 2"
60