169c8fb1cSSourabh Singh Tomar## This test checks llvm-dwarfdump can dump debug_macro section containing 269c8fb1cSSourabh Singh Tomar## multiple macro units. 369c8fb1cSSourabh Singh Tomar 469c8fb1cSSourabh Singh Tomar# RUN: llvm-mc -triple x86_64-unknown-linux -filetype=obj %s -o -| \ 569c8fb1cSSourabh Singh Tomar# RUN: llvm-dwarfdump -debug-macro - | FileCheck -strict-whitespace -match-full-lines %s 669c8fb1cSSourabh Singh Tomar 769c8fb1cSSourabh Singh Tomar# CHECK:.debug_macro contents: 869c8fb1cSSourabh Singh Tomar# CHECK-NEXT:0x00000000: 9*ccbd7e8dSIgor Kudrin# CHECK-NEXT:macro header: version = 0x0005, flags = 0x02, format = DWARF32, debug_line_offset = 0x00000000 1069c8fb1cSSourabh Singh Tomar# CHECK-NEXT:DW_MACRO_start_file - lineno: 0 filenum: 0 1169c8fb1cSSourabh Singh Tomar# CHECK-NEXT: DW_MACRO_start_file - lineno: 1 filenum: 6 1269c8fb1cSSourabh Singh Tomar# CHECK-NEXT: DW_MACRO_define_strp - lineno: 1 macro: FOO 5 1369c8fb1cSSourabh Singh Tomar# CHECK-NEXT: DW_MACRO_end_file 1469c8fb1cSSourabh Singh Tomar# CHECK-NEXT: DW_MACRO_undef_strp - lineno: 8 macro: WORLD1 1585b49ecbSSourabh Singh Tomar# CHECK-NEXT: DW_MACRO_import - import offset: 0x[[OFFSET:[0-9]+]] 1669c8fb1cSSourabh Singh Tomar# CHECK-NEXT:DW_MACRO_end_file 1769c8fb1cSSourabh Singh Tomar 1885b49ecbSSourabh Singh Tomar# CHECK:0x[[OFFSET]]: 19*ccbd7e8dSIgor Kudrin# CHECK-NEXT:macro header: version = 0x0005, flags = 0x00, format = DWARF32 2069c8fb1cSSourabh Singh Tomar# CHECK-NEXT:DW_MACRO_define_strp - lineno: 0 macro: WORLD 2 2169c8fb1cSSourabh Singh Tomar 2269c8fb1cSSourabh Singh Tomar .section .debug_macro,"",@progbits 2369c8fb1cSSourabh Singh Tomar.Lcu_macro_begin0: 2469c8fb1cSSourabh Singh Tomar .short 5 # Macro information version 2569c8fb1cSSourabh Singh Tomar .byte 2 # Flags: 32 bit, debug_line_offset present 2669c8fb1cSSourabh Singh Tomar .long 0 # debug_line_offset 2769c8fb1cSSourabh Singh Tomar .byte 3 # DW_MACRO_start_file 2869c8fb1cSSourabh Singh Tomar .byte 0 # Line Number 2969c8fb1cSSourabh Singh Tomar .byte 0 # File Number 3069c8fb1cSSourabh Singh Tomar .byte 3 # DW_MACRO_start_file 3169c8fb1cSSourabh Singh Tomar .byte 1 # Line Number 3269c8fb1cSSourabh Singh Tomar .byte 6 # File Number 3369c8fb1cSSourabh Singh Tomar .byte 5 # DW_MACRO_define_strp 3469c8fb1cSSourabh Singh Tomar .byte 1 # Line Number 3569c8fb1cSSourabh Singh Tomar .long .Linfo_string0 # Macro String 3669c8fb1cSSourabh Singh Tomar .byte 4 # DW_MACRO_end_file 3769c8fb1cSSourabh Singh Tomar .byte 6 # DW_MACRO_undef_strp 3869c8fb1cSSourabh Singh Tomar .byte 8 # Line Number 3969c8fb1cSSourabh Singh Tomar .long .Linfo_string1 # Macro String 4085b49ecbSSourabh Singh Tomar .byte 7 # DW_MACRO_import 4185b49ecbSSourabh Singh Tomar .long .Lmacro1 # Macro Unit Offset 4269c8fb1cSSourabh Singh Tomar .byte 4 # DW_MACRO_end_file 4369c8fb1cSSourabh Singh Tomar .byte 0 # End Of Macro List Mark 4485b49ecbSSourabh Singh Tomar 4585b49ecbSSourabh Singh Tomar.Lmacro1: 4669c8fb1cSSourabh Singh Tomar .short 5 # Macro information version 4769c8fb1cSSourabh Singh Tomar .byte 0 # Flags: 32 bit 4869c8fb1cSSourabh Singh Tomar .byte 5 # DW_MACRO_define_strp 4969c8fb1cSSourabh Singh Tomar .byte 0 # Line Number 5069c8fb1cSSourabh Singh Tomar .long .Linfo_string2 # Macro String 5169c8fb1cSSourabh Singh Tomar .byte 0 # End Of Macro List Mark 5269c8fb1cSSourabh Singh Tomar 5369c8fb1cSSourabh Singh Tomar .section .debug_str,"MS",@progbits,1 5469c8fb1cSSourabh Singh Tomar.Linfo_string0: 5569c8fb1cSSourabh Singh Tomar .asciz "FOO 5" 5669c8fb1cSSourabh Singh Tomar.Linfo_string1: 5769c8fb1cSSourabh Singh Tomar .asciz "WORLD1" 5869c8fb1cSSourabh Singh Tomar.Linfo_string2: 5969c8fb1cSSourabh Singh Tomar .asciz "WORLD 2" 60