2 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin -dwarf-version=5 %s -o %t.o
4 # RUN: %lld -lSystem %t.o -o %t
5 # RUN: dsymutil -s %t | FileCheck %s -DDIR=%t -DSRC_PATH=%t.o
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'
19 .subsections_via_symbols
26 .section __DWARF,__debug_str_offs,regular,debug
28 .long 12 ## Length of String Offsets Set
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
38 .section __DWARF,__debug_abbrev,regular,debug
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
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
56 .section __DWARF,__debug_info,regular,debug
57 .set Lset0, Ldebug_info_end0-Ldebug_info_start0 ## Length of Unit
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
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
70 .byte 1 ## DW_AT_comp_dir
71 .set Lset4, Lstr_offsets_base0-Lsection_str_off ## DW_AT_str_offsets_base
73 .byte 0 ## End Of Children Mark