|
| 1 | +# Checks that we correctly display the DW_AT_APPLE_property_name of a |
| 2 | +# referenced DW_TAG_APPLE_property. |
| 3 | +# |
| 4 | +# RUN: llvm-mc -triple=aarch64--darwin -filetype=obj -o %t.o < %s |
| 5 | +# RUN: not llvm-dwarfdump %t.o 2> %t.errs.txt | FileCheck %s |
| 6 | +# RUN: FileCheck %s --check-prefix=ERRORS < %t.errs.txt |
| 7 | + |
| 8 | +# CHECK: 0x[[PROP_REF:[0-9a-f]+]]: DW_TAG_APPLE_property |
| 9 | +# CHECK-NEXT: DW_AT_APPLE_property_name ("autoSynthProp") |
| 10 | +# |
| 11 | +# CHECK: 0x[[NO_NAME_PROP:[0-9a-f]+]]: DW_TAG_APPLE_property |
| 12 | +# CHECK-NOT: DW_AT_APPLE_property_name |
| 13 | +# |
| 14 | +# CHECK: 0x[[INVALID_STRP:[0-9a-f]+]]: DW_TAG_APPLE_property |
| 15 | +# CHECK-NEXT: DW_AT_APPLE_property_name |
| 16 | +# |
| 17 | +# CHECK: DW_TAG_member |
| 18 | +# CHECK: DW_AT_APPLE_property (0x[[PROP_REF]] "autoSynthProp") |
| 19 | +# CHECK: DW_AT_APPLE_property (0x[[NO_NAME_PROP]] "") |
| 20 | +# CHECK: DW_AT_APPLE_property (0x{{.*}}) |
| 21 | +# CHECK: DW_AT_APPLE_property (0x{{.*}}) |
| 22 | +# CHECK: DW_AT_APPLE_property (0x[[INVALID_STRP]]) |
| 23 | + |
| 24 | +# ERRORS: error: decoding DW_AT_APPLE_property_name: not referencing a DW_TAG_APPLE_property |
| 25 | +# ERRORS: error: decoding DW_AT_APPLE_property_name: invalid DIE |
| 26 | +# ERRORS: error: decoding DW_AT_APPLE_property_name: DW_FORM_strp offset 102 is beyond .debug_str bounds |
| 27 | + |
| 28 | + .section __DWARF,__debug_abbrev,regular,debug |
| 29 | +Lsection_abbrev: |
| 30 | + .byte 1 ; Abbreviation Code |
| 31 | + .byte 17 ; DW_TAG_compile_unit |
| 32 | + .byte 1 ; DW_CHILDREN_yes |
| 33 | + .byte 114 ; DW_AT_str_offsets_base |
| 34 | + .byte 23 ; DW_FORM_sec_offset |
| 35 | + .byte 0 ; EOM(1) |
| 36 | + .byte 0 ; EOM(2) |
| 37 | + .byte 2 ; Abbreviation Code |
| 38 | + .byte 19 ; DW_TAG_structure_type |
| 39 | + .byte 1 ; DW_CHILDREN_yes |
| 40 | + .byte 3 ; DW_AT_name |
| 41 | + .byte 37 ; DW_FORM_strx1 |
| 42 | + .byte 0 ; EOM(1) |
| 43 | + .byte 0 ; EOM(2) |
| 44 | + .byte 3 ; Abbreviation Code |
| 45 | + .ascii "\200\204\001" ; DW_TAG_APPLE_property |
| 46 | + .byte 0 ; DW_CHILDREN_no |
| 47 | + .ascii "\350\177" ; DW_AT_APPLE_property_name |
| 48 | + .byte 37 ; DW_FORM_strx1 |
| 49 | + .byte 0 ; EOM(1) |
| 50 | + .byte 0 ; EOM(2) |
| 51 | + .byte 4 ; Abbreviation Code |
| 52 | + .ascii "\200\204\001" ; DW_TAG_APPLE_property |
| 53 | + .byte 0 ; DW_CHILDREN_no |
| 54 | + .byte 0 ; EOM(1) |
| 55 | + .byte 0 ; EOM(2) |
| 56 | + .byte 5 ; Abbreviation Code |
| 57 | + .ascii "\200\204\001" ; DW_TAG_APPLE_property |
| 58 | + .byte 0 ; DW_CHILDREN_no |
| 59 | + .ascii "\350\177" ; DW_AT_APPLE_property_name |
| 60 | + .byte 14 ; DW_FORM_strp |
| 61 | + .byte 0 ; EOM(1) |
| 62 | + .byte 0 ; EOM(2) |
| 63 | + .byte 6 ; Abbreviation Code |
| 64 | + .byte 13 ; DW_TAG_member |
| 65 | + .byte 0 ; DW_CHILDREN_no |
| 66 | + .byte 3 ; DW_AT_name |
| 67 | + .byte 37 ; DW_FORM_strx1 |
| 68 | + .ascii "\355\177" ; DW_AT_APPLE_property |
| 69 | + .byte 19 ; DW_FORM_ref4 |
| 70 | + .ascii "\355\177" ; DW_AT_APPLE_property |
| 71 | + .byte 19 ; DW_FORM_ref4 |
| 72 | + .ascii "\355\177" ; DW_AT_APPLE_property |
| 73 | + .byte 19 ; DW_FORM_ref4 |
| 74 | + .ascii "\355\177" ; DW_AT_APPLE_property |
| 75 | + .byte 19 ; DW_FORM_ref4 |
| 76 | + .ascii "\355\177" ; DW_AT_APPLE_property |
| 77 | + .byte 19 ; DW_FORM_ref4 |
| 78 | + .byte 0 ; EOM(1) |
| 79 | + .byte 0 ; EOM(2) |
| 80 | + .byte 0 ; EOM(3) |
| 81 | + .section __DWARF,__debug_info,regular,debug |
| 82 | +Lsection_info: |
| 83 | +Lcu_begin0: |
| 84 | +Lset0 = Ldebug_info_end0-Ldebug_info_start0 ; Length of Unit |
| 85 | + .long Lset0 |
| 86 | +Ldebug_info_start0: |
| 87 | + .short 5 ; DWARF version number |
| 88 | + .byte 1 ; DWARF Unit Type |
| 89 | + .byte 8 ; Address Size (in bytes) |
| 90 | +Lset1 = Lsection_abbrev-Lsection_abbrev ; Offset Into Abbrev. Section |
| 91 | + .long Lset1 |
| 92 | + .byte 1 ; Abbrev [1] DW_TAG_compile_unit |
| 93 | +Lset2 = Lstr_offsets_base0-Lsection_str_off ; DW_AT_str_offsets_base |
| 94 | + .long Lset2 |
| 95 | + .byte 2 ; Abbrev [2] DW_TAG_structure_type |
| 96 | + .byte 2 ; DW_AT_name |
| 97 | + .byte 3 ; Abbrev [3] DW_TAG_APPLE_property |
| 98 | + .byte 0 ; DW_AT_APPLE_property_name |
| 99 | + .byte 4 ; Abbrev [4] DW_TAG_APPLE_property |
| 100 | + .byte 5 ; Abbrev [5] DW_TAG_APPLE_property |
| 101 | + .long 102 ; DW_AT_APPLE_property_name |
| 102 | + .byte 6 ; Abbrev [6] DW_TAG_member |
| 103 | + .byte 1 ; DW_AT_name |
| 104 | + .long 19 ; DW_AT_APPLE_property |
| 105 | + .long 21 ; DW_AT_APPLE_property |
| 106 | + .long 17 ; DW_AT_APPLE_property |
| 107 | + .long 0 ; DW_AT_APPLE_property |
| 108 | + .long 22 ; DW_AT_APPLE_property |
| 109 | + .byte 0 ; End Of Children Mark |
| 110 | + .byte 0 ; End Of Children Mark |
| 111 | +Ldebug_info_end0: |
| 112 | + .section __DWARF,__debug_str_offs,regular,debug |
| 113 | +Lsection_str_off: |
| 114 | + .long 16 ; Length of String Offsets Set |
| 115 | + .short 5 |
| 116 | + .short 0 |
| 117 | +Lstr_offsets_base0: |
| 118 | + .section __DWARF,__debug_str,regular,debug |
| 119 | +Linfo_string: |
| 120 | + .asciz "autoSynthProp" ; string offset=0 |
| 121 | + .asciz "_var" ; string offset=14 |
| 122 | + .asciz "Foo" ; string offset=19 |
| 123 | + .section __DWARF,__debug_str_offs,regular,debug |
| 124 | + .long 0 |
| 125 | + .long 14 |
| 126 | + .long 19 |
0 commit comments