1 ## This test checks that llvm-dwarfdump can dump debug_macro
2 ## section containing contributions from multiple CU's represented
3 ## using DW_MACRO_define_strx form.
5 # RUN: llvm-mc -triple x86_64-unknown-linux -filetype=obj %s -o -| \
6 # RUN: llvm-dwarfdump -debug-macro - | FileCheck -strict-whitespace -match-full-lines %s
8 # CHECK:.debug_macro contents:
9 # CHECK-NEXT:0x00000000:
10 # CHECK-NEXT:macro header: version = 0x0005, flags = 0x02, format = DWARF32, debug_line_offset = 0x00000000
11 # CHECK-NEXT:DW_MACRO_start_file - lineno: 0 filenum: 0
12 # CHECK-NEXT: DW_MACRO_define_strx - lineno: 1 macro: DWARF_VERSION 5
13 # CHECK-NEXT: DW_MACRO_define_strx - lineno: 2 macro: COMPILE_UNIT 1
14 # CHECK-NEXT: DW_MACRO_undef_strx - lineno: 3 macro: COMPILE_UNIT
15 # CHECK-NEXT:DW_MACRO_end_file
18 # CHECK-NEXT:macro header: version = 0x0005, flags = 0x02, format = DWARF32, debug_line_offset = 0x00000000
19 # CHECK-NEXT:DW_MACRO_start_file - lineno: 1 filenum: 3
20 # CHECK-NEXT: DW_MACRO_define_strx - lineno: 2 macro: COMPILE_UNIT 2
21 # CHECK-NEXT: DW_MACRO_undef_strx - lineno: 3 macro: COMPILE_UNIT
22 # CHECK-NEXT:DW_MACRO_end_file
24 .section .debug_abbrev,"",@progbits
25 .byte 1 # Abbreviation Code
26 .byte 17 # DW_TAG_compile_unit
27 .byte 0 # DW_CHILDREN_no
28 .byte 114 # DW_AT_str_offsets_base
29 .byte 23 # DW_FORM_sec_offset
30 .byte 121 # DW_AT_macros
31 .byte 23 # DW_FORM_sec_offset
36 .section .debug_info,"",@progbits
38 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
40 .short 5 # DWARF version number
41 .byte 1 # DWARF Unit Type
42 .byte 8 # Address Size (in bytes)
43 .long .debug_abbrev # Offset Into Abbrev. Section
44 .byte 1 # Abbrev [1] 0xc:0x12 DW_TAG_compile_unit
45 .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
46 .long .Lcu_macro_begin0 # DW_AT_macros
49 .long .Ldebug_info_end1-.Ldebug_info_start1 # Length of Unit
51 .short 5 # DWARF version number
52 .byte 1 # DWARF Unit Type
53 .byte 8 # Address Size (in bytes)
54 .long .debug_abbrev # Offset Into Abbrev. Section
55 .byte 1 # Abbrev [1] 0xc:0x12 DW_TAG_compile_unit
56 .long .Lstr_offsets_base1 # DW_AT_str_offsets_base
57 .long .Lcu_macro_begin1 # DW_AT_macros
60 .section .debug_macro,"",@progbits
62 .short 5 # Macro information version
63 .byte 2 # Flags: 32 bit, debug_line_offset present
64 .long 0 # debug_line_offset
65 .byte 3 # DW_MACRO_start_file
68 .byte 11 # DW_MACRO_define_strx
70 .byte 0 # Macro String
71 .byte 11 # DW_MACRO_define_strx
73 .byte 1 # Macro String
74 .byte 12 # DW_MACRO_undef_strx
76 .byte 2 # Macro String
77 .byte 4 # DW_MACRO_end_file
78 .byte 0 # End Of Macro List Mark
80 .short 5 # Macro information version
81 .byte 2 # Flags: 32 bit, debug_line_offset present
82 .long 0 # debug_line_offset
83 .byte 3 # DW_MACRO_start_file
86 .byte 11 # DW_MACRO_define_strx
88 .byte 0 # Macro String
89 .byte 12 # DW_MACRO_undef_strx
91 .byte 1 # Macro String
92 .byte 4 # DW_MACRO_end_file
94 .section .debug_str_offsets,"",@progbits
95 .long 16 # Unit length
102 .long 12 # Unit length
109 .section .debug_str,"MS",@progbits,1
111 .asciz "DWARF_VERSION 5"
113 .asciz "COMPILE_UNIT 1"
115 .asciz "COMPILE_UNIT"
117 .asciz "COMPILE_UNIT 2"
119 .asciz "COMPILE_UNIT"