1 ## This test checks that DW_OP_addrx expression operand
2 ## is correctly recognized and converted into the DW_OP_addr
3 ## operand or just preserved in case --update.
5 ## cat dwarf5-dw-op-addrx.c
16 ## int main() { return 0;}
18 ## $ clang -gdwarf-5 dwarf5-dw-op-addrx.c -c -O2 -o dwarf5-dw-op-addrx.o
20 #RUN: dsymutil -oso-prepend-path %p/../Inputs -y %s -o %t.dSYM
21 #RUN: llvm-dwarfdump --verify %t.dSYM | FileCheck %s
22 #RUN: llvm-dwarfdump -a --verbose %t.dSYM | FileCheck %s --check-prefix DWARF-CHECK
24 #RUN: dsymutil --update -oso-prepend-path %p/../Inputs -y %s -o %t.dSYM
25 #RUN: llvm-dwarfdump --verify %t.dSYM | FileCheck %s
26 #RUN: llvm-dwarfdump -a --verbose %t.dSYM | FileCheck %s --check-prefix UPD-DWARF-CHECK
28 #RUN: dsymutil --linker parallel -oso-prepend-path %p/../Inputs -y %s -o %t.dSYM
29 #RUN: llvm-dwarfdump --verify %t.dSYM | FileCheck %s
30 #RUN: llvm-dwarfdump -a --verbose %t.dSYM | FileCheck %s --check-prefix DWARF-CHECK
32 #RUN: dsymutil --linker parallel --update -oso-prepend-path %p/../Inputs -y %s -o %t.dSYM
33 #RUN: llvm-dwarfdump --verify %t.dSYM | FileCheck %s
34 #RUN: llvm-dwarfdump -a --verbose %t.dSYM | FileCheck %s --check-prefix UPD-DWARF-CHECK
38 #DWARF-CHECK: DW_TAG_compile_unit
39 #DWARF-CHECK: DW_AT_name {{.*}}"dwarf5-dw-op-addrx.c"
40 #DWARF-CHECK: DW_AT_low_pc {{.*}}0x0000000100000fb0
41 #DWARF-CHECK: DW_TAG_variable
42 #DWARF-CHECK: DW_AT_name {{.*}}"arr"
43 #DWARF-CHECK: DW_AT_location {{.*}}(DW_OP_addr 0x100001000)
44 #DWARF-CHECK: DW_TAG_variable
45 #DWARF-CHECK: DW_AT_name {{.*}}"arr2"
46 #DWARF-CHECK: DW_AT_location {{.*}}(DW_OP_addr 0x100002000)
47 #DWARF-CHECK: DW_TAG_variable
48 #DWARF-CHECK: DW_AT_name {{.*}}"arr3"
49 #DWARF-CHECK: DW_AT_location {{.*}}(DW_OP_addr 0x100003000)
50 #DWARF-CHECK: DW_TAG_variable
51 #DWARF-CHECK: DW_AT_name {{.*}}"arr4"
52 #DWARF-CHECK: DW_AT_location {{.*}}(DW_OP_addr 0x100004000)
53 #DWARF-CHECK: DW_TAG_variable
54 #DWARF-CHECK: DW_AT_name {{.*}}"arr5"
55 #DWARF-CHECK: DW_AT_location {{.*}}(DW_OP_addr 0x100005000)
56 #DWARF-CHECK: DW_TAG_variable
57 #DWARF-CHECK: DW_AT_name {{.*}}"arr6"
58 #DWARF-CHECK: DW_AT_location {{.*}}(DW_OP_addr 0x100006000)
59 #DWARF-CHECK: DW_TAG_variable
60 #DWARF-CHECK: DW_AT_name {{.*}}"arr7"
61 #DWARF-CHECK: DW_AT_location {{.*}}(DW_OP_addr 0x100007000)
62 #DWARF-CHECK: DW_TAG_variable
63 #DWARF-CHECK: DW_AT_name {{.*}}"arr8"
64 #DWARF-CHECK: DW_AT_location {{.*}}(DW_OP_addr 0x100008000)
65 #DWARF-CHECK: DW_TAG_variable
66 #DWARF-CHECK: DW_AT_name {{.*}}"arr9"
67 #DWARF-CHECK: DW_AT_location {{.*}}(DW_OP_addr 0x100009000)
69 #UPD-DWARF-CHECK: DW_TAG_compile_unit
70 #UPD-DWARF-CHECK: DW_AT_name {{.*}}"dwarf5-dw-op-addrx.c"
71 #UPD-DWARF-CHECK: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000009) address = 0x0000000000000000)
72 #UPD-DWARF-CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000008)
73 #UPD-DWARF-CHECK: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)
74 #UPD-DWARF-CHECK: DW_TAG_variable
75 #UPD-DWARF-CHECK: DW_AT_name {{.*}}"arr"
76 #UPD-DWARF-CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0)
77 #UPD-DWARF-CHECK: DW_TAG_variable
78 #UPD-DWARF-CHECK: DW_AT_name {{.*}}"arr2"
79 #UPD-DWARF-CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x1)
80 #UPD-DWARF-CHECK: DW_TAG_variable
81 #UPD-DWARF-CHECK: DW_AT_name {{.*}}"arr3"
82 #UPD-DWARF-CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x2)
83 #UPD-DWARF-CHECK: DW_TAG_variable
84 #UPD-DWARF-CHECK: DW_AT_name {{.*}}"arr4"
85 #UPD-DWARF-CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x3)
86 #UPD-DWARF-CHECK: DW_TAG_variable
87 #UPD-DWARF-CHECK: DW_AT_name {{.*}}"arr5"
88 #UPD-DWARF-CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x4)
89 #UPD-DWARF-CHECK: DW_TAG_variable
90 #UPD-DWARF-CHECK: DW_AT_name {{.*}}"arr6"
91 #UPD-DWARF-CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x5)
92 #UPD-DWARF-CHECK: DW_TAG_variable
93 #UPD-DWARF-CHECK: DW_AT_name {{.*}}"arr7"
94 #UPD-DWARF-CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x6)
95 #UPD-DWARF-CHECK: DW_TAG_variable
96 #UPD-DWARF-CHECK: DW_AT_name {{.*}}"arr8"
97 #UPD-DWARF-CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x7)
98 #UPD-DWARF-CHECK: DW_TAG_variable
99 #UPD-DWARF-CHECK: DW_AT_name {{.*}}"arr9"
100 #UPD-DWARF-CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x8)
101 #UPD-DWARF-CHECK: .debug_addr contents:
102 #UPD-DWARF-CHECK: 0x00000000: Address table header: length = 0x00000054, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
103 #UPD-DWARF-CHECK: 0x0000000000000000
104 #UPD-DWARF-CHECK: 0x0000000000000000
105 #UPD-DWARF-CHECK: 0x0000000000000000
106 #UPD-DWARF-CHECK: 0x0000000000000000
107 #UPD-DWARF-CHECK: 0x0000000000000000
108 #UPD-DWARF-CHECK: 0x0000000000000000
109 #UPD-DWARF-CHECK: 0x0000000000000000
110 #UPD-DWARF-CHECK: 0x0000000000000000
111 #UPD-DWARF-CHECK: 0x0000000000000000
112 #UPD-DWARF-CHECK: 0x0000000000000000
115 triple: 'x86_64-apple-darwin'
117 - filename: 'dwarf5-dw-op-addrx.o'
118 timestamp: 1676048242
120 - { sym: _main, objAddr: 0x0000000000000000, binAddr: 0x0000000100000FB0, size: 0x00000008 }
121 - { sym: _arr, binAddr: 0x0000000100001000, size: 0x00000008 }
122 - { sym: _arr2, binAddr: 0x0000000100002000, size: 0x00000008 }
123 - { sym: _arr3, binAddr: 0x0000000100003000, size: 0x00000008 }
124 - { sym: _arr4, binAddr: 0x0000000100004000, size: 0x00000008 }
125 - { sym: _arr5, binAddr: 0x0000000100005000, size: 0x00000008 }
126 - { sym: _arr6, binAddr: 0x0000000100006000, size: 0x00000008 }
127 - { sym: _arr7, binAddr: 0x0000000100007000, size: 0x00000008 }
128 - { sym: _arr8, binAddr: 0x0000000100008000, size: 0x00000008 }
129 - { sym: _arr9, binAddr: 0x0000000100009000, size: 0x00000008 }