File: dwarf5-addr-base.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (188 lines) | stat: -rw-r--r-- 7,583 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
; This test checks to ensure that if three DWARFv5 object files have correct values for the DW_AT_addr_base in their compile units.

; 1.o was produced with the source file:

; a.cpp
; __attribute__((section("1,__text_foo"))) void foo() {}
; 
; int foo2(int a) {
;     return a+5;
; }
; 
; int foo3(int x) {
;     return x+2;
; }
; 
; int main () {
;     return 1;
; }

; clang -g -c -O1 a.cpp -gdwarf-5 -o 1.o

; 2.o was produced with the following source file:

; b.cpp
; __attribute__((section("1,__text_foo"))) void bar() {}
; 
; int bar2(int a) {
;     return a+5;
; }
; 
; int bar3(int x) {
;     return x+2;
; }

; clang -g -c -O1 b.cpp -gdwarf-5 -o 2.o

; 3.o was produced with the following source file:

; c.cpp
; 
; int baz(int x) {
;     return x+2;
; }

; clang -g -c -O1 c.cpp -gdwarf-5 -o 3.o


RUN: rm -rf %t.dir && mkdir -p %t.dir
RUN: dsymutil -y %p/dummy-debug-map-amr64.map -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base -o %t.dir/dwarf5-addr-base.dSYM
RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | FileCheck %s

RUN: rm -rf %t.dir && mkdir -p %t.dir
RUN: dsymutil --linker parallel --no-odr -y %p/dummy-debug-map-amr64.map \
RUN:   -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base \
RUN:   -o %t.dir/dwarf5-addr-base.dSYM
RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | FileCheck %s

RUN: rm -rf %t.dir && mkdir -p %t.dir
RUN: dsymutil --linker parallel -y %p/dummy-debug-map-amr64.map \
RUN:   -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base \
RUN:   -o %t.dir/dwarf5-addr-base.dSYM
RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | \
RUN:   FileCheck %s --check-prefixes=CHECK,CHECK-LLVM


RUN: rm -rf %t.dir && mkdir -p %t.dir
RUN: dsymutil --update -y %p/dummy-debug-map-amr64.map -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base -o %t.dir/dwarf5-addr-base.dSYM
RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | FileCheck %s --check-prefix=UPD

RUN: rm -rf %t.dir && mkdir -p %t.dir
RUN: dsymutil --linker parallel --no-odr --update -y %p/dummy-debug-map-amr64.map \
RUN:   -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base \
RUN:   -o %t.dir/dwarf5-addr-base.dSYM
RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | \
RUN:   FileCheck %s --check-prefix=UPD

RUN: rm -rf %t.dir && mkdir -p %t.dir
RUN: dsymutil --linker parallel --update -y %p/dummy-debug-map-amr64.map \
RUN:   -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base \
RUN:   -o %t.dir/dwarf5-addr-base.dSYM
RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | \
RUN:   FileCheck %s --check-prefix=UPD


CHECK: .debug_info contents:

CHECK-LLVM: Compile Unit: length = 0x0000001f, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = {{.*}}, addr_size = 0x08
CHECK-LLVM: DW_TAG_compile_unit
CHECK-LLVM: DW_TAG_base_type

CHECK: Compile Unit: length = 0x0000004a, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = {{.*}}, addr_size = 0x08

CHECK: DW_TAG_compile_unit
CHECK:   DW_AT_addr_base [DW_FORM_sec_offset]      (0x00000008)

CHECK:   DW_TAG_subprogram
CHECK-NEXT:                DW_AT_low_pc [DW_FORM_addrx]    (indexed (00000000) address = 0x[[ADDR1:[0-9a-f]+]])


CHECK: Compile Unit: length = 0x0000004a, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = {{.*}}, addr_size = 0x08

CHECK: DW_TAG_compile_unit
CHECK:              DW_AT_addr_base [DW_FORM_sec_offset]      (0x00000018)

CHECK: DW_TAG_subprogram
CHECK-NEXT:                 DW_AT_low_pc [DW_FORM_addrx]    (indexed (00000000) address = 0x[[ADDR2:[0-9a-f]+]])

CHECK: Compile Unit: length = 0x00000043, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = {{.*}}, addr_size = 0x08

CHECK: DW_TAG_compile_unit
CHECK: DW_AT_addr_base [DW_FORM_sec_offset]      (0x00000028)

CHECK:   DW_TAG_subprogram
CHECK-NEXT:                 DW_AT_low_pc [DW_FORM_addrx]    (indexed (00000000) address = 0x[[ADDR3:[0-9a-f]+]])

CHECK: .debug_addr contents:
CHECK-NEXT: 0x00000000: Address table header: length = 0x0000000c, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
CHECK-NEXT: Addrs: [
CHECK-NEXT: 0x[[ADDR1]]
CHECK-NEXT: ]
CHECK-NEXT: 0x00000010: Address table header: length = 0x0000000c, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
CHECK-NEXT: Addrs: [
CHECK-NEXT: 0x[[ADDR2]]
CHECK-NEXT: ]
CHECK-NEXT: 0x00000020: Address table header: length = 0x0000000c, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
CHECK-NEXT: Addrs: [
CHECK-NEXT: 0x[[ADDR3]]
CHECK-NEXT: ]

UPD: .debug_info contents:
UPD-NEXT: 0x00000000: Compile Unit: length = 0x00000081, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08

UPD: 0x0000000c: DW_TAG_compile_unit [1] *
UPD:               DW_AT_addr_base [DW_FORM_sec_offset]      (0x00000008)

UPD: 0x00000031:   DW_TAG_subprogram [2]   (0x0000000c)
UPD-NEXT:                DW_AT_low_pc [DW_FORM_addrx]    (indexed (00000000) address = 0x0000000000000018)

UPD: 0x0000003d:   DW_TAG_subprogram [3] * (0x0000000c)
UPD-NEXT:                 DW_AT_low_pc [DW_FORM_addrx]    (indexed (00000001) address = 0x0000000000000000)

UPD: 0x00000057:   DW_TAG_subprogram [3] * (0x0000000c)
UPD-NEXT:                 DW_AT_low_pc [DW_FORM_addrx]    (indexed (00000002) address = 0x0000000000000008)

UPD: 0x00000071:   DW_TAG_subprogram [5]   (0x0000000c)
UPD-NEXT:                 DW_AT_low_pc [DW_FORM_addrx]    (indexed (00000003) address = 0x0000000000000010)


UPD: 0x00000085: Compile Unit: length = 0x00000072, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x00{{00|99}}, addr_size = 0x08

UPD: 0x00000091: DW_TAG_compile_unit [1] *
UPD:              DW_AT_addr_base [DW_FORM_sec_offset]      (0x00000008)

UPD: 0x000000b6:   DW_TAG_subprogram [2]   (0x00000091)
UPD-NEXT:                 DW_AT_low_pc [DW_FORM_addrx]    (indexed (00000000) address = 0x0000000000000018)

UPD: 0x000000c2:   DW_TAG_subprogram [3] * (0x00000091)
UPD-NEXT:                 DW_AT_low_pc [DW_FORM_addrx]    (indexed (00000001) address = 0x0000000000000000)

UPD: 0x000000dc:   DW_TAG_subprogram [3] * (0x00000091)
UPD-NEXT:                 DW_AT_low_pc [DW_FORM_addrx]    (indexed (00000002) address = 0x0000000000000008)

UPD: 0x000000fb: Compile Unit: length = 0x00000044, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0{{000|115}}, addr_size = 0x08

UPD: 0x00000107: DW_TAG_compile_unit {{.*}} *
UPD: DW_AT_addr_base [DW_FORM_sec_offset]      (0x00000008)

UPD: 0x00000124:   DW_TAG_subprogram {{.*}} * (0x00000107)
UPD-NEXT:                 DW_AT_low_pc [DW_FORM_addrx]    (indexed (00000000) address = 0x0000000000000018)

UPD: .debug_addr contents:
UPD-NEXT: 0x00000000: Address table header: length = 0x00000024, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
UPD-NEXT: Addrs: [
UPD-NEXT: 0x0000000000000018
UPD-NEXT: 0x0000000000000000
UPD-NEXT: 0x0000000000000008
UPD-NEXT: 0x0000000000000010
UPD-NEXT: ]
UPD-NEXT: 0x00000028: Address table header: length = 0x0000001c, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
UPD-NEXT: Addrs: [
UPD-NEXT: 0x0000000000000010
UPD-NEXT: 0x0000000000000000
UPD-NEXT: 0x0000000000000008
UPD-NEXT: ]
UPD-NEXT: 0x00000048: Address table header: length = 0x0000000c, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
UPD-NEXT: Addrs: [
UPD-NEXT: 0x0000000000000000
UPD-NEXT: ]