1# REQUIRES: x86 2# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin -dwarf-version=5 %s -o %t.o 3 4# RUN: %lld -lSystem %t.o -o %t 5# RUN: dsymutil -s %t | FileCheck %s -DDIR=%t -DSRC_PATH=%t.o 6 7# CHECK: (N_SO ) 00 0000 0000000000000000 '/tmp{{[/\\]}}test.cpp' 8# CHECK-NEXT: (N_OSO ) 03 0001 {{.*}} '[[SRC_PATH]]' 9# CHECK-NEXT: (N_FUN ) 01 0000 [[#%.16x,MAIN:]] '_main' 10# CHECK-NEXT: (N_FUN ) 00 0000 0000000000000001{{$}} 11# CHECK-DAG: ( SECT EXT) 01 0000 [[#MAIN]] '_main' 12# CHECK-DAG: ( {{.*}}) {{[0-9]+}} 0010 {{[0-9a-f]+}} '__mh_execute_header' 13# CHECK-DAG: ( {{.*}}) {{[0-9]+}} 0100 0000000000000000 'dyld_stub_binder' 14# CHECK-EMPTY: 15 16.text 17.globl _main 18 19.subsections_via_symbols 20 21_main: 22Lfunc_begin0: 23 retq 24Lfunc_end0: 25 26.section __DWARF,__debug_str_offs,regular,debug 27Lsection_str_off: 28 .long 12 ## Length of String Offsets Set 29 .short 5 30 .short 0 31Lstr_offsets_base0: 32.section __DWARF,__debug_str,regular,debug 33 .asciz "test.cpp" ## string offset=0 34 .asciz "/tmp" ## string offset=9 35.section __DWARF,__debug_str_offs,regular,debug 36 .long 0 37 .long 9 38.section __DWARF,__debug_abbrev,regular,debug 39Lsection_abbrev: 40 .byte 1 ## Abbreviation Code 41 .byte 17 ## DW_TAG_compile_unit 42 .byte 1 ## DW_CHILDREN_yes 43 .byte 17 ## DW_AT_low_pc 44 .byte 1 ## DW_FORM_addr 45 .byte 18 ## DW_AT_high_pc 46 .byte 6 ## DW_FORM_data4 47 .byte 3 ## DW_AT_name 48 .byte 37 ## DW_FORM_strx1 49 .byte 27 ## DW_AT_comp_dir 50 .byte 37 ## DW_FORM_strx1 51 .byte 114 ## DW_AT_str_offsets_base 52 .byte 23 ## DW_FORM_sec_offset 53 .byte 0 ## EOM(1) 54 .byte 0 ## EOM(2) 55 .byte 0 ## EOM(3) 56.section __DWARF,__debug_info,regular,debug 57.set Lset0, Ldebug_info_end0-Ldebug_info_start0 ## Length of Unit 58 .long Lset0 59Ldebug_info_start0: 60 .short 5 ## DWARF version number 61 .byte 1 ## DWARF Unit Type 62 .byte 8 ## Address Size (in bytes) 63.set Lset1, Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section 64 .long Lset1 65 .byte 1 ## Abbrev [1] 0xb:0x48 DW_TAG_compile_unit 66 .quad Lfunc_begin0 ## DW_AT_low_pc 67.set Lset3, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc 68 .long Lset3 69 .byte 0 ## DW_AT_name 70 .byte 1 ## DW_AT_comp_dir 71.set Lset4, Lstr_offsets_base0-Lsection_str_off ## DW_AT_str_offsets_base 72 .long Lset4 73 .byte 0 ## End Of Children Mark 74Ldebug_info_end0: 75