xref: /aosp_15_r20/external/elfutils/tests/run-all-dwarf-ranges.sh (revision 7304104da70ce23c86437a01be71edd1a2d7f37e)
1*7304104dSAndroid Build Coastguard Worker#! /bin/sh
2*7304104dSAndroid Build Coastguard Worker# Copyright (C) 2018 Red Hat, Inc.
3*7304104dSAndroid Build Coastguard Worker# This file is part of elfutils.
4*7304104dSAndroid Build Coastguard Worker#
5*7304104dSAndroid Build Coastguard Worker# This file is free software; you can redistribute it and/or modify
6*7304104dSAndroid Build Coastguard Worker# it under the terms of the GNU General Public License as published by
7*7304104dSAndroid Build Coastguard Worker# the Free Software Foundation; either version 3 of the License, or
8*7304104dSAndroid Build Coastguard Worker# (at your option) any later version.
9*7304104dSAndroid Build Coastguard Worker#
10*7304104dSAndroid Build Coastguard Worker# elfutils is distributed in the hope that it will be useful, but
11*7304104dSAndroid Build Coastguard Worker# WITHOUT ANY WARRANTY; without even the implied warranty of
12*7304104dSAndroid Build Coastguard Worker# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*7304104dSAndroid Build Coastguard Worker# GNU General Public License for more details.
14*7304104dSAndroid Build Coastguard Worker#
15*7304104dSAndroid Build Coastguard Worker# You should have received a copy of the GNU General Public License
16*7304104dSAndroid Build Coastguard Worker# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17*7304104dSAndroid Build Coastguard Worker
18*7304104dSAndroid Build Coastguard Worker. $srcdir/test-subr.sh
19*7304104dSAndroid Build Coastguard Worker
20*7304104dSAndroid Build Coastguard Worker# See run-dwarf-ranges.sh
21*7304104dSAndroid Build Coastguard Worker# Compiled with:
22*7304104dSAndroid Build Coastguard Worker# gcc -c -O2 -o testfile-ranges-hello.o -gsplit-dwarf -gdwarf-4 hello.c
23*7304104dSAndroid Build Coastguard Worker# gcc -c -O2 -o testfile-ranges-world.o -gsplit-dwarf -gdwarf-4 world.c
24*7304104dSAndroid Build Coastguard Worker# gcc -o testfilesplitranges4 -O2 \
25*7304104dSAndroid Build Coastguard Worker#        testfile-ranges-hello.o testfile-ranges-world.o
26*7304104dSAndroid Build Coastguard Worker# eu-strip -f testfilesplitranges4.debug testfilesplitranges4
27*7304104dSAndroid Build Coastguard Worker
28*7304104dSAndroid Build Coastguard Workertestfiles testfilesplitranges4.debug
29*7304104dSAndroid Build Coastguard Workertestfiles testfile-ranges-hello.dwo testfile-ranges-world.dwo
30*7304104dSAndroid Build Coastguard Worker
31*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_builddir}/all-dwarf-ranges testfilesplitranges4.debug <<\EOF
32*7304104dSAndroid Build Coastguard Workerdie: hello.c (11)
33*7304104dSAndroid Build Coastguard Worker 4004e0..4004ff
34*7304104dSAndroid Build Coastguard Worker 4003e0..4003f7
35*7304104dSAndroid Build Coastguard Worker
36*7304104dSAndroid Build Coastguard Workerdie: no_say (2e)
37*7304104dSAndroid Build Coastguard Worker 4004f0..4004ff
38*7304104dSAndroid Build Coastguard Worker
39*7304104dSAndroid Build Coastguard Workerdie: main (2e)
40*7304104dSAndroid Build Coastguard Worker 4003e0..4003f7
41*7304104dSAndroid Build Coastguard Worker
42*7304104dSAndroid Build Coastguard Workerdie: subject (1d)
43*7304104dSAndroid Build Coastguard Worker 4003e3..4003ef
44*7304104dSAndroid Build Coastguard Worker
45*7304104dSAndroid Build Coastguard Workerdie: subject (2e)
46*7304104dSAndroid Build Coastguard Worker 4004e0..4004f0
47*7304104dSAndroid Build Coastguard Worker
48*7304104dSAndroid Build Coastguard Workerdie: world.c (11)
49*7304104dSAndroid Build Coastguard Worker 400500..400567
50*7304104dSAndroid Build Coastguard Worker
51*7304104dSAndroid Build Coastguard Workerdie: no_main (2e)
52*7304104dSAndroid Build Coastguard Worker 400550..400567
53*7304104dSAndroid Build Coastguard Worker
54*7304104dSAndroid Build Coastguard Workerdie: no_subject (1d)
55*7304104dSAndroid Build Coastguard Worker 400553..40055f
56*7304104dSAndroid Build Coastguard Worker
57*7304104dSAndroid Build Coastguard Workerdie: say (2e)
58*7304104dSAndroid Build Coastguard Worker 400500..400540
59*7304104dSAndroid Build Coastguard Worker
60*7304104dSAndroid Build Coastguard Workerdie: happy (1d)
61*7304104dSAndroid Build Coastguard Worker 40051c..400526
62*7304104dSAndroid Build Coastguard Worker 400530..400534
63*7304104dSAndroid Build Coastguard Worker 400535..40053f
64*7304104dSAndroid Build Coastguard Worker
65*7304104dSAndroid Build Coastguard Workerdie: sad (1d)
66*7304104dSAndroid Build Coastguard Worker 40051c..400526
67*7304104dSAndroid Build Coastguard Worker 400535..40053f
68*7304104dSAndroid Build Coastguard Worker
69*7304104dSAndroid Build Coastguard Workerdie: no_subject (2e)
70*7304104dSAndroid Build Coastguard Worker 400540..400550
71*7304104dSAndroid Build Coastguard Worker
72*7304104dSAndroid Build Coastguard WorkerEOF
73*7304104dSAndroid Build Coastguard Worker
74*7304104dSAndroid Build Coastguard Worker# Same with -gdwarf-5
75*7304104dSAndroid Build Coastguard Worker# gcc -c -O2 -o testfile-ranges-hello5.o -gsplit-dwarf -gdwarf-5 hello.c
76*7304104dSAndroid Build Coastguard Worker# gcc -c -O2 -o testfile-ranges-world5.o -gsplit-dwarf -gdwarf-5 world.c
77*7304104dSAndroid Build Coastguard Worker# gcc -o testfilesplitranges5 -O2 testfile-ranges-hello5.o testfile-ranges-world5.o
78*7304104dSAndroid Build Coastguard Worker# eu-strip -f testfilesplitranges5.debug testfilesplitranges5
79*7304104dSAndroid Build Coastguard Worker
80*7304104dSAndroid Build Coastguard Workertestfiles testfilesplitranges5.debug
81*7304104dSAndroid Build Coastguard Workertestfiles testfile-ranges-hello5.dwo testfile-ranges-world5.dwo
82*7304104dSAndroid Build Coastguard Worker
83*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_builddir}/all-dwarf-ranges testfilesplitranges5.debug <<\EOF
84*7304104dSAndroid Build Coastguard Workerdie: hello.c (11)
85*7304104dSAndroid Build Coastguard Worker 401150..40117a
86*7304104dSAndroid Build Coastguard Worker 401050..401067
87*7304104dSAndroid Build Coastguard Worker
88*7304104dSAndroid Build Coastguard Workerdie: no_say (2e)
89*7304104dSAndroid Build Coastguard Worker 401160..40117a
90*7304104dSAndroid Build Coastguard Worker
91*7304104dSAndroid Build Coastguard Workerdie: main (2e)
92*7304104dSAndroid Build Coastguard Worker 401050..401067
93*7304104dSAndroid Build Coastguard Worker
94*7304104dSAndroid Build Coastguard Workerdie: subject (1d)
95*7304104dSAndroid Build Coastguard Worker 401053..40105f
96*7304104dSAndroid Build Coastguard Worker
97*7304104dSAndroid Build Coastguard Workerdie: subject (2e)
98*7304104dSAndroid Build Coastguard Worker 401150..401160
99*7304104dSAndroid Build Coastguard Worker
100*7304104dSAndroid Build Coastguard Workerdie: world.c (11)
101*7304104dSAndroid Build Coastguard Worker 401180..4011e7
102*7304104dSAndroid Build Coastguard Worker
103*7304104dSAndroid Build Coastguard Workerdie: no_main (2e)
104*7304104dSAndroid Build Coastguard Worker 4011d0..4011e7
105*7304104dSAndroid Build Coastguard Worker
106*7304104dSAndroid Build Coastguard Workerdie: no_subject (1d)
107*7304104dSAndroid Build Coastguard Worker 4011d3..4011df
108*7304104dSAndroid Build Coastguard Worker
109*7304104dSAndroid Build Coastguard Workerdie: say (2e)
110*7304104dSAndroid Build Coastguard Worker 401180..4011c0
111*7304104dSAndroid Build Coastguard Worker
112*7304104dSAndroid Build Coastguard Workerdie: happy (1d)
113*7304104dSAndroid Build Coastguard Worker 40119b..40119b
114*7304104dSAndroid Build Coastguard Worker 40119c..4011a6
115*7304104dSAndroid Build Coastguard Worker 4011b0..4011b4
116*7304104dSAndroid Build Coastguard Worker 4011b5..4011bf
117*7304104dSAndroid Build Coastguard Worker
118*7304104dSAndroid Build Coastguard Workerdie: sad (1d)
119*7304104dSAndroid Build Coastguard Worker 40119b..40119b
120*7304104dSAndroid Build Coastguard Worker 40119c..4011a6
121*7304104dSAndroid Build Coastguard Worker 4011b4..4011b4
122*7304104dSAndroid Build Coastguard Worker 4011b5..4011bf
123*7304104dSAndroid Build Coastguard Worker
124*7304104dSAndroid Build Coastguard Workerdie: no_subject (2e)
125*7304104dSAndroid Build Coastguard Worker 4011c0..4011d0
126*7304104dSAndroid Build Coastguard Worker
127*7304104dSAndroid Build Coastguard WorkerEOF
128*7304104dSAndroid Build Coastguard Worker
129*7304104dSAndroid Build Coastguard Worker# See testfile-dwp.source.
130*7304104dSAndroid Build Coastguard Workertestfiles testfile-dwp-5 testfile-dwp-5.dwp
131*7304104dSAndroid Build Coastguard Workertestfiles testfile-dwp-4 testfile-dwp-4.dwp
132*7304104dSAndroid Build Coastguard Worker
133*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_builddir}/all-dwarf-ranges testfile-dwp-5 << EOF
134*7304104dSAndroid Build Coastguard Workerdie: foo.cc (11)
135*7304104dSAndroid Build Coastguard Worker 401190..401200
136*7304104dSAndroid Build Coastguard Worker
137*7304104dSAndroid Build Coastguard Workerdie: foo (2e)
138*7304104dSAndroid Build Coastguard Worker 4011c0..401200
139*7304104dSAndroid Build Coastguard Worker
140*7304104dSAndroid Build Coastguard Workerdie: x_x (1d)
141*7304104dSAndroid Build Coastguard Worker 4011cb..4011eb
142*7304104dSAndroid Build Coastguard Worker 4011f8..401200
143*7304104dSAndroid Build Coastguard Worker
144*7304104dSAndroid Build Coastguard Workerdie: <unknown> (b)
145*7304104dSAndroid Build Coastguard Worker 4011cb..4011eb
146*7304104dSAndroid Build Coastguard Worker 4011f8..401200
147*7304104dSAndroid Build Coastguard Worker
148*7304104dSAndroid Build Coastguard Workerdie: x_x (2e)
149*7304104dSAndroid Build Coastguard Worker 401190..4011bd
150*7304104dSAndroid Build Coastguard Worker
151*7304104dSAndroid Build Coastguard Workerdie: <unknown> (b)
152*7304104dSAndroid Build Coastguard Worker 401190..401190
153*7304104dSAndroid Build Coastguard Worker 401192..4011bb
154*7304104dSAndroid Build Coastguard Worker
155*7304104dSAndroid Build Coastguard Workerdie: bar.cc (11)
156*7304104dSAndroid Build Coastguard Worker 401200..40121b
157*7304104dSAndroid Build Coastguard Worker
158*7304104dSAndroid Build Coastguard Workerdie: bar (2e)
159*7304104dSAndroid Build Coastguard Worker 401200..40121b
160*7304104dSAndroid Build Coastguard Worker
161*7304104dSAndroid Build Coastguard Workerdie: main.cc (11)
162*7304104dSAndroid Build Coastguard Worker 401020..4010a0
163*7304104dSAndroid Build Coastguard Worker
164*7304104dSAndroid Build Coastguard Workerdie: main (2e)
165*7304104dSAndroid Build Coastguard Worker 401020..4010a0
166*7304104dSAndroid Build Coastguard Worker
167*7304104dSAndroid Build Coastguard Workerdie: fibonacci (1d)
168*7304104dSAndroid Build Coastguard Worker 401030..401032
169*7304104dSAndroid Build Coastguard Worker 401036..401060
170*7304104dSAndroid Build Coastguard Worker 401099..4010a0
171*7304104dSAndroid Build Coastguard Worker
172*7304104dSAndroid Build Coastguard Workerdie: fibonacci (1d)
173*7304104dSAndroid Build Coastguard Worker 40103a..401060
174*7304104dSAndroid Build Coastguard Worker 401099..4010a0
175*7304104dSAndroid Build Coastguard Worker
176*7304104dSAndroid Build Coastguard Workerdie: <unknown> (b)
177*7304104dSAndroid Build Coastguard Worker 40103a..401060
178*7304104dSAndroid Build Coastguard Worker 401099..4010a0
179*7304104dSAndroid Build Coastguard Worker
180*7304104dSAndroid Build Coastguard Workerdie: <unknown> (b)
181*7304104dSAndroid Build Coastguard Worker 40103a..401044
182*7304104dSAndroid Build Coastguard Worker 401050..401060
183*7304104dSAndroid Build Coastguard Worker
184*7304104dSAndroid Build Coastguard Workerdie: <unknown> (b)
185*7304104dSAndroid Build Coastguard Worker 401050..401053
186*7304104dSAndroid Build Coastguard Worker 401056..401059
187*7304104dSAndroid Build Coastguard Worker
188*7304104dSAndroid Build Coastguard WorkerEOF
189*7304104dSAndroid Build Coastguard Worker
190*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_builddir}/all-dwarf-ranges testfile-dwp-4 << EOF
191*7304104dSAndroid Build Coastguard Workerdie: foo.cc (11)
192*7304104dSAndroid Build Coastguard Worker 401190..401200
193*7304104dSAndroid Build Coastguard Worker
194*7304104dSAndroid Build Coastguard Workerdie: foo (2e)
195*7304104dSAndroid Build Coastguard Worker 4011c0..401200
196*7304104dSAndroid Build Coastguard Worker
197*7304104dSAndroid Build Coastguard Workerdie: x_x (1d)
198*7304104dSAndroid Build Coastguard Worker 4011cb..4011eb
199*7304104dSAndroid Build Coastguard Worker 4011f8..401200
200*7304104dSAndroid Build Coastguard Worker
201*7304104dSAndroid Build Coastguard Workerdie: <unknown> (b)
202*7304104dSAndroid Build Coastguard Worker 4011cb..4011eb
203*7304104dSAndroid Build Coastguard Worker 4011f8..401200
204*7304104dSAndroid Build Coastguard Worker
205*7304104dSAndroid Build Coastguard Workerdie: x_x (2e)
206*7304104dSAndroid Build Coastguard Worker 401190..4011bd
207*7304104dSAndroid Build Coastguard Worker
208*7304104dSAndroid Build Coastguard Workerdie: bar.cc (11)
209*7304104dSAndroid Build Coastguard Worker 401200..40121b
210*7304104dSAndroid Build Coastguard Worker
211*7304104dSAndroid Build Coastguard Workerdie: bar (2e)
212*7304104dSAndroid Build Coastguard Worker 401200..40121b
213*7304104dSAndroid Build Coastguard Worker
214*7304104dSAndroid Build Coastguard Workerdie: main.cc (11)
215*7304104dSAndroid Build Coastguard Worker 401020..4010a0
216*7304104dSAndroid Build Coastguard Worker
217*7304104dSAndroid Build Coastguard Workerdie: main (2e)
218*7304104dSAndroid Build Coastguard Worker 401020..4010a0
219*7304104dSAndroid Build Coastguard Worker
220*7304104dSAndroid Build Coastguard Workerdie: fibonacci (1d)
221*7304104dSAndroid Build Coastguard Worker 401030..401032
222*7304104dSAndroid Build Coastguard Worker 401036..401060
223*7304104dSAndroid Build Coastguard Worker 401099..4010a0
224*7304104dSAndroid Build Coastguard Worker
225*7304104dSAndroid Build Coastguard Workerdie: fibonacci (1d)
226*7304104dSAndroid Build Coastguard Worker 40103a..401060
227*7304104dSAndroid Build Coastguard Worker 401099..4010a0
228*7304104dSAndroid Build Coastguard Worker
229*7304104dSAndroid Build Coastguard Workerdie: <unknown> (b)
230*7304104dSAndroid Build Coastguard Worker 40103a..401060
231*7304104dSAndroid Build Coastguard Worker 401099..4010a0
232*7304104dSAndroid Build Coastguard Worker
233*7304104dSAndroid Build Coastguard Workerdie: <unknown> (b)
234*7304104dSAndroid Build Coastguard Worker 40103a..401044
235*7304104dSAndroid Build Coastguard Worker 401050..401060
236*7304104dSAndroid Build Coastguard Worker
237*7304104dSAndroid Build Coastguard Workerdie: <unknown> (b)
238*7304104dSAndroid Build Coastguard Worker 401050..401053
239*7304104dSAndroid Build Coastguard Worker 401056..401059
240*7304104dSAndroid Build Coastguard Worker
241*7304104dSAndroid Build Coastguard WorkerEOF
242*7304104dSAndroid Build Coastguard Worker
243*7304104dSAndroid Build Coastguard Workerexit 0
244