1 # This test verifies that an empty range list in the .debug_ranges section
2 # doesn't crash dsymutil. As clang does not produce this kind of debug
3 # info anymore, we used this hand-crafted assembly file to produce a testcase
5 # llvm-mc -triple x86_64-apple-darwin -filetype=obj -o 1.o empty_range.o
7 # RUN: dsymutil -f -y %p/dummy-debug-map.map -oso-prepend-path %p/../Inputs/empty_range -o - | llvm-dwarfdump -debug-info - | FileCheck %s
9 .section __TEXT,__text,regular,pure_instructions
10 .macosx_version_min 10, 11
20 .section __DWARF,__debug_abbrev,regular,debug
22 .byte 1 ## Abbreviation Code
23 .byte 17 ## DW_TAG_compile_unit
24 .byte 1 ## DW_CHILDREN_yes
27 .byte 2 ## Abbreviation Code
28 .byte 46 ## DW_TAG_subprogram
29 .byte 0 ## DW_CHILDREN_no
30 .byte 17 ## DW_AT_low_pc
31 .byte 1 ## DW_FORM_addr
32 .byte 0x55 ## DW_AT_ranges
33 .byte 6 ## DW_FORM_data4
37 .section __DWARF,__debug_info,regular,debug
39 .long 22 ## Length of Unit
40 .short 2 ## DWARF version number
41 .long 0 ## Offset Into Abbrev. Section
42 .byte 8 ## Address Size (in bytes)
43 .byte 1 ## Abbrev [1] DW_TAG_compile_unit
44 .byte 2 ## Abbrev [2] DW_TAG_subprogram
45 .quad Lfunc_begin0 ## DW_AT_low_pc
46 .long 0 ## DW_AT_ranges (pointing at an empty entry)
47 .byte 0 ## End Of Children Mark
48 .section __DWARF,__debug_ranges,regular,debug
53 # CHECK: DW_TAG_compile_unit
54 # CHECK: DW_TAG_subprogram
55 # CHECK-NEXT: DW_AT_low_pc{{.*}}(0x0000000000010000)
56 # CHECK-NEXT: DW_AT_ranges{{.*}}(0x00000000)
58 # There was a bug that would use the currently active object file when a
59 # debug map object isn't found. Check that we only linked one file.
60 # CHECK-NOT: DW_TAG_compile_unit