xref: /aosp_15_r20/external/elfutils/tests/run-varlocs.sh (revision 7304104da70ce23c86437a01be71edd1a2d7f37e)
1*7304104dSAndroid Build Coastguard Worker#! /bin/sh
2*7304104dSAndroid Build Coastguard Worker# Copyright (C) 2013 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 the source files testfile_const_type.c testfile_implicit_value.c
21*7304104dSAndroid Build Coastguard Worker# testfile_entry_value.c testfile_parameter_ref.c testfile_implicit_pointer.c
22*7304104dSAndroid Build Coastguard Worker# how to regenerate the test files (needs GCC 4.8+).
23*7304104dSAndroid Build Coastguard Worker
24*7304104dSAndroid Build Coastguard Workertestfiles testfile_const_type testfile_implicit_value testfile_entry_value
25*7304104dSAndroid Build Coastguard Workertestfiles testfile_parameter_ref testfile_implicit_pointer
26*7304104dSAndroid Build Coastguard Worker
27*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/tests/varlocs -e testfile_const_type <<\EOF
28*7304104dSAndroid Build Coastguard Workermodule 'testfile_const_type'
29*7304104dSAndroid Build Coastguard Worker[b] CU 'const_type.c'@0
30*7304104dSAndroid Build Coastguard Worker  [33] function 'f1'@80483f0
31*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(4,4)}}
32*7304104dSAndroid Build Coastguard Worker    [4b] parameter 'd'
33*7304104dSAndroid Build Coastguard Worker      [80483f0,804841b) {fbreg(0)}
34*7304104dSAndroid Build Coastguard Worker    [57] variable 'w'
35*7304104dSAndroid Build Coastguard Worker      [80483f0,804841b) {fbreg(0), GNU_deref_type(8){long long int,signed,64@[25]}, GNU_const_type{long long int,signed,64@[25]}(8)[0000806745230100], div, GNU_convert{long long unsigned int,unsigned,64@[2c]}, stack_value}
36*7304104dSAndroid Build Coastguard Worker  [7d] function 'main'@80482f0
37*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(4,4)}}
38*7304104dSAndroid Build Coastguard WorkerEOF
39*7304104dSAndroid Build Coastguard Worker
40*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/tests/varlocs -e testfile_implicit_value <<\EOF
41*7304104dSAndroid Build Coastguard Workermodule 'testfile_implicit_value'
42*7304104dSAndroid Build Coastguard Worker[b] CU 'implicit_value.c'@0
43*7304104dSAndroid Build Coastguard Worker  [25] function 'foo'@80483f0
44*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(4,4)}}
45*7304104dSAndroid Build Coastguard Worker    [3e] variable 'a'
46*7304104dSAndroid Build Coastguard Worker      [80483f0,80483f6) {implicit_value(8){0200000000000000}, piece(8), implicit_value(8){1500000000000000}, piece(8)}
47*7304104dSAndroid Build Coastguard Worker  [86] function 'main'@80482f0
48*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(4,4)}}
49*7304104dSAndroid Build Coastguard WorkerEOF
50*7304104dSAndroid Build Coastguard Worker
51*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/tests/varlocs -e testfile_entry_value <<\EOF
52*7304104dSAndroid Build Coastguard Workermodule 'testfile_entry_value'
53*7304104dSAndroid Build Coastguard Worker[b] CU 'entry_value.c'@0
54*7304104dSAndroid Build Coastguard Worker  [29] function 'foo'@400500
55*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
56*7304104dSAndroid Build Coastguard Worker    [4a] parameter 'x'
57*7304104dSAndroid Build Coastguard Worker      [400500,400504) {reg5}
58*7304104dSAndroid Build Coastguard Worker    [55] parameter 'y'
59*7304104dSAndroid Build Coastguard Worker      [400500,400504) {reg4}
60*7304104dSAndroid Build Coastguard Worker  [68] function 'bar'@400510
61*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
62*7304104dSAndroid Build Coastguard Worker    [89] parameter 'x'
63*7304104dSAndroid Build Coastguard Worker      [400510,40051c) {reg5}
64*7304104dSAndroid Build Coastguard Worker      [40051c,40052b) {reg6}
65*7304104dSAndroid Build Coastguard Worker      [40052b,400531) {GNU_entry_value(1) {reg5}, stack_value}
66*7304104dSAndroid Build Coastguard Worker    [96] parameter 'y'
67*7304104dSAndroid Build Coastguard Worker      [400510,40051c) {reg4}
68*7304104dSAndroid Build Coastguard Worker      [40051c,40052a) {reg3}
69*7304104dSAndroid Build Coastguard Worker      [40052a,400531) {GNU_entry_value(1) {reg4}, stack_value}
70*7304104dSAndroid Build Coastguard Worker    [a3] variable 'z'
71*7304104dSAndroid Build Coastguard Worker      [400524,400528) {reg0}
72*7304104dSAndroid Build Coastguard Worker      [400528,400529) {reg12}
73*7304104dSAndroid Build Coastguard Worker      [400529,40052e) {breg0(0), breg12(0), plus, stack_value}
74*7304104dSAndroid Build Coastguard Worker      [40052e,400531) {reg0}
75*7304104dSAndroid Build Coastguard Worker  [e9] function 'main'@400400
76*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
77*7304104dSAndroid Build Coastguard Worker    [10a] parameter 'argc'
78*7304104dSAndroid Build Coastguard Worker      [400400,400406) {reg5}
79*7304104dSAndroid Build Coastguard Worker      [400406,40040a) {breg5(-1), stack_value}
80*7304104dSAndroid Build Coastguard Worker      [40040a,40040b) {GNU_entry_value(1) {reg5}, stack_value}
81*7304104dSAndroid Build Coastguard Worker    [119] parameter 'argv'
82*7304104dSAndroid Build Coastguard Worker      [400400,400403) {reg4}
83*7304104dSAndroid Build Coastguard Worker      [400403,40040b) {GNU_entry_value(1) {reg4}, stack_value}
84*7304104dSAndroid Build Coastguard WorkerEOF
85*7304104dSAndroid Build Coastguard Worker
86*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/tests/varlocs -e testfile_parameter_ref <<\EOF
87*7304104dSAndroid Build Coastguard Workermodule 'testfile_parameter_ref'
88*7304104dSAndroid Build Coastguard Worker[b] CU 'parameter_ref.c'@0
89*7304104dSAndroid Build Coastguard Worker  [77] function 'foo'@400510
90*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
91*7304104dSAndroid Build Coastguard Worker    [92] parameter 'x'
92*7304104dSAndroid Build Coastguard Worker      [400510,400523) {reg5}
93*7304104dSAndroid Build Coastguard Worker    [99] parameter 'y'
94*7304104dSAndroid Build Coastguard Worker      [400510,400523) {GNU_parameter_ref[42], stack_value}
95*7304104dSAndroid Build Coastguard Worker    [a5] variable 'a'
96*7304104dSAndroid Build Coastguard Worker      [400510,400523) {breg5(0), lit1, shl, stack_value}
97*7304104dSAndroid Build Coastguard Worker    [b0] variable 'b'
98*7304104dSAndroid Build Coastguard Worker      [400510,400523) {GNU_parameter_ref[42], lit1, shl, stack_value}
99*7304104dSAndroid Build Coastguard Worker    [be] variable 'c'
100*7304104dSAndroid Build Coastguard Worker      <constant value>
101*7304104dSAndroid Build Coastguard Worker    [c4] parameter 'z'
102*7304104dSAndroid Build Coastguard Worker      <constant value>
103*7304104dSAndroid Build Coastguard Worker  [cb] function 'main'@400400
104*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
105*7304104dSAndroid Build Coastguard Worker    [ec] parameter 'x'
106*7304104dSAndroid Build Coastguard Worker      [400400,400408) {reg5}
107*7304104dSAndroid Build Coastguard Worker      [400408,400421) {reg3}
108*7304104dSAndroid Build Coastguard Worker      [400421,400423) {GNU_entry_value(1) {reg5}, stack_value}
109*7304104dSAndroid Build Coastguard Worker    [f9] parameter 'argv'
110*7304104dSAndroid Build Coastguard Worker      [400400,400408) {reg4}
111*7304104dSAndroid Build Coastguard Worker      [400408,400423) {GNU_entry_value(1) {reg4}, stack_value}
112*7304104dSAndroid Build Coastguard WorkerEOF
113*7304104dSAndroid Build Coastguard Worker
114*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/tests/varlocs -e testfile_implicit_pointer <<\EOF
115*7304104dSAndroid Build Coastguard Workermodule 'testfile_implicit_pointer'
116*7304104dSAndroid Build Coastguard Worker[b] CU 'implicit_pointer.c'@0
117*7304104dSAndroid Build Coastguard Worker  [29] function 'foo'@400500
118*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
119*7304104dSAndroid Build Coastguard Worker    [4a] parameter 'i'
120*7304104dSAndroid Build Coastguard Worker      [400500,400503) {reg5}
121*7304104dSAndroid Build Coastguard Worker    [55] variable 'p'
122*7304104dSAndroid Build Coastguard Worker      [400500,400503) {GNU_implicit_pointer([4a],0) {reg5}}
123*7304104dSAndroid Build Coastguard Worker  [73] function 'main'@400400
124*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
125*7304104dSAndroid Build Coastguard WorkerEOF
126*7304104dSAndroid Build Coastguard Worker
127*7304104dSAndroid Build Coastguard Worker# Multi CU DWARF5. See run-dwarf-ranges.sh.
128*7304104dSAndroid Build Coastguard Workertestfiles testfileranges5.debug
129*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/tests/varlocs --debug -e testfileranges5.debug <<\EOF
130*7304104dSAndroid Build Coastguard Workermodule 'testfileranges5.debug'
131*7304104dSAndroid Build Coastguard Worker[c] CU 'hello.c'@0
132*7304104dSAndroid Build Coastguard Worker  [2a] function 'no_say'@401160
133*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
134*7304104dSAndroid Build Coastguard Worker    [4a] parameter 'prefix'
135*7304104dSAndroid Build Coastguard Worker      [401160,401169) {reg5}
136*7304104dSAndroid Build Coastguard Worker      [401169,40116a) {entry_value(1) {reg5}, stack_value}
137*7304104dSAndroid Build Coastguard Worker      [40116a,401175) {reg5}
138*7304104dSAndroid Build Coastguard Worker      [401175,40117a) {entry_value(1) {reg5}, stack_value}
139*7304104dSAndroid Build Coastguard Worker    [59] variable 'world'
140*7304104dSAndroid Build Coastguard Worker      [401160,40117a) {addr(0x402004), stack_value}
141*7304104dSAndroid Build Coastguard Worker  [bd] function 'main'@401050
142*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
143*7304104dSAndroid Build Coastguard Worker    [dd] parameter 'argc'
144*7304104dSAndroid Build Coastguard Worker      [401050,401062) {reg5}
145*7304104dSAndroid Build Coastguard Worker      [401062,401067) {entry_value(1) {reg5}, stack_value}
146*7304104dSAndroid Build Coastguard Worker    [ec] parameter 'argv'
147*7304104dSAndroid Build Coastguard Worker      [401050,401066) {reg4}
148*7304104dSAndroid Build Coastguard Worker      [401066,401067) {entry_value(1) {reg4}, stack_value}
149*7304104dSAndroid Build Coastguard Worker  [fb] inlined function 'subject'@401053
150*7304104dSAndroid Build Coastguard Worker    [117] parameter 'count'
151*7304104dSAndroid Build Coastguard Worker      [401053,40105f) {reg5}
152*7304104dSAndroid Build Coastguard Worker    [120] parameter 'word'
153*7304104dSAndroid Build Coastguard Worker      [401053,40105f) {reg0}
154*7304104dSAndroid Build Coastguard Worker  [168] function 'subject'@401150
155*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
156*7304104dSAndroid Build Coastguard Worker    [183] parameter 'word'
157*7304104dSAndroid Build Coastguard Worker      [401150,401160) {reg5}
158*7304104dSAndroid Build Coastguard Worker    [18a] parameter 'count'
159*7304104dSAndroid Build Coastguard Worker      [401150,401160) {reg4}
160*7304104dSAndroid Build Coastguard Workermodule 'testfileranges5.debug'
161*7304104dSAndroid Build Coastguard Worker[1ab] CU 'world.c'@401180
162*7304104dSAndroid Build Coastguard Worker  [1cd] function 'no_main'@4011d0
163*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
164*7304104dSAndroid Build Coastguard Worker    [1ef] parameter 'argc'
165*7304104dSAndroid Build Coastguard Worker      [4011d0,4011e2) {reg5}
166*7304104dSAndroid Build Coastguard Worker      [4011e2,4011e7) {entry_value(1) {reg5}, stack_value}
167*7304104dSAndroid Build Coastguard Worker    [1fe] parameter 'argv'
168*7304104dSAndroid Build Coastguard Worker      [4011d0,4011e6) {reg4}
169*7304104dSAndroid Build Coastguard Worker      [4011e6,4011e7) {entry_value(1) {reg4}, stack_value}
170*7304104dSAndroid Build Coastguard Worker  [20d] inlined function 'no_subject'@4011d3
171*7304104dSAndroid Build Coastguard Worker    [229] parameter 'count'
172*7304104dSAndroid Build Coastguard Worker      [4011d3,4011df) {reg5}
173*7304104dSAndroid Build Coastguard Worker    [232] parameter 'word'
174*7304104dSAndroid Build Coastguard Worker      [4011d3,4011df) {reg0}
175*7304104dSAndroid Build Coastguard Worker  [28d] function 'say'@401180
176*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
177*7304104dSAndroid Build Coastguard Worker    [2af] parameter 'prefix'
178*7304104dSAndroid Build Coastguard Worker      [401180,40118e) {reg5}
179*7304104dSAndroid Build Coastguard Worker      [40118e,40119c) {reg3}
180*7304104dSAndroid Build Coastguard Worker      [40119c,4011a7) {entry_value(1) {reg5}, stack_value}
181*7304104dSAndroid Build Coastguard Worker      [4011a7,4011b5) {reg3}
182*7304104dSAndroid Build Coastguard Worker      [4011b5,4011c0) {entry_value(1) {reg5}, stack_value}
183*7304104dSAndroid Build Coastguard Worker    [2be] variable 'world'
184*7304104dSAndroid Build Coastguard Worker      [401193,40119b) {reg0}
185*7304104dSAndroid Build Coastguard Worker      [4011a7,4011b4) {reg0}
186*7304104dSAndroid Build Coastguard Worker  [2ce] inlined function 'happy'@40119b
187*7304104dSAndroid Build Coastguard Worker    [2e6] parameter 'w'
188*7304104dSAndroid Build Coastguard Worker      [4011a7,4011b4) {reg0}
189*7304104dSAndroid Build Coastguard Worker  [2ef] inlined function 'sad'@40119b
190*7304104dSAndroid Build Coastguard Worker    [303] parameter 'c'
191*7304104dSAndroid Build Coastguard Worker      [40119b,4011a6) {reg0}
192*7304104dSAndroid Build Coastguard Worker      [4011a6,4011a7) {entry_value(1) {reg5}}
193*7304104dSAndroid Build Coastguard Worker      [4011b4,4011bf) {reg0}
194*7304104dSAndroid Build Coastguard Worker  [36b] function 'no_subject'@4011c0
195*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
196*7304104dSAndroid Build Coastguard Worker    [386] parameter 'word'
197*7304104dSAndroid Build Coastguard Worker      [4011c0,4011d0) {reg5}
198*7304104dSAndroid Build Coastguard Worker    [38d] parameter 'count'
199*7304104dSAndroid Build Coastguard Worker      [4011c0,4011d0) {reg4}
200*7304104dSAndroid Build Coastguard WorkerEOF
201*7304104dSAndroid Build Coastguard Worker
202*7304104dSAndroid Build Coastguard Worker# Multi CU Split DWARF5. See run-dwarf-ranges.sh.
203*7304104dSAndroid Build Coastguard Worker# Note that the DIE numbers change, but the actual location addresses are
204*7304104dSAndroid Build Coastguard Worker# the same as above, even though the representation is totally different.
205*7304104dSAndroid Build Coastguard Workertestfiles testfilesplitranges5.debug
206*7304104dSAndroid Build Coastguard Workertestfiles testfile-ranges-hello5.dwo testfile-ranges-world5.dwo
207*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/tests/varlocs --debug -e testfilesplitranges5.debug <<\EOF
208*7304104dSAndroid Build Coastguard Workermodule 'testfilesplitranges5.debug'
209*7304104dSAndroid Build Coastguard Worker[14] CU 'hello.c'@0
210*7304104dSAndroid Build Coastguard Worker  [1d] function 'no_say'@401160
211*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
212*7304104dSAndroid Build Coastguard Worker    [33] parameter 'prefix'
213*7304104dSAndroid Build Coastguard Worker      [401160,401169) {reg5}
214*7304104dSAndroid Build Coastguard Worker      [401169,40116a) {entry_value(1) {reg5}, stack_value}
215*7304104dSAndroid Build Coastguard Worker      [40116a,401175) {reg5}
216*7304104dSAndroid Build Coastguard Worker      [401175,40117a) {entry_value(1) {reg5}, stack_value}
217*7304104dSAndroid Build Coastguard Worker    [3c] variable 'world'
218*7304104dSAndroid Build Coastguard Worker      [401160,40117a) {addr: 0x402004, stack_value}
219*7304104dSAndroid Build Coastguard Worker  [7e] function 'main'@401050
220*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
221*7304104dSAndroid Build Coastguard Worker    [94] parameter 'argc'
222*7304104dSAndroid Build Coastguard Worker      [401050,401062) {reg5}
223*7304104dSAndroid Build Coastguard Worker      [401062,401067) {entry_value(1) {reg5}, stack_value}
224*7304104dSAndroid Build Coastguard Worker    [9d] parameter 'argv'
225*7304104dSAndroid Build Coastguard Worker      [401050,401066) {reg4}
226*7304104dSAndroid Build Coastguard Worker      [401066,401067) {entry_value(1) {reg4}, stack_value}
227*7304104dSAndroid Build Coastguard Worker  [a6] inlined function 'subject'@401053
228*7304104dSAndroid Build Coastguard Worker    [bb] parameter 'count'
229*7304104dSAndroid Build Coastguard Worker      [401053,40105f) {reg5}
230*7304104dSAndroid Build Coastguard Worker    [c1] parameter 'word'
231*7304104dSAndroid Build Coastguard Worker      [401053,40105f) {reg0}
232*7304104dSAndroid Build Coastguard Worker  [f6] function 'subject'@401150
233*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
234*7304104dSAndroid Build Coastguard Worker    [10a] parameter 'word'
235*7304104dSAndroid Build Coastguard Worker      [401150,401160) {reg5}
236*7304104dSAndroid Build Coastguard Worker    [111] parameter 'count'
237*7304104dSAndroid Build Coastguard Worker      [401150,401160) {reg4}
238*7304104dSAndroid Build Coastguard Workermodule 'testfilesplitranges5.debug'
239*7304104dSAndroid Build Coastguard Worker[14] CU 'world.c'@401180
240*7304104dSAndroid Build Coastguard Worker  [1d] function 'no_main'@4011d0
241*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
242*7304104dSAndroid Build Coastguard Worker    [35] parameter 'argc'
243*7304104dSAndroid Build Coastguard Worker      [4011d0,4011e2) {reg5}
244*7304104dSAndroid Build Coastguard Worker      [4011e2,4011e7) {entry_value(1) {reg5}, stack_value}
245*7304104dSAndroid Build Coastguard Worker    [3e] parameter 'argv'
246*7304104dSAndroid Build Coastguard Worker      [4011d0,4011e6) {reg4}
247*7304104dSAndroid Build Coastguard Worker      [4011e6,4011e7) {entry_value(1) {reg4}, stack_value}
248*7304104dSAndroid Build Coastguard Worker  [47] inlined function 'no_subject'@4011d3
249*7304104dSAndroid Build Coastguard Worker    [5c] parameter 'count'
250*7304104dSAndroid Build Coastguard Worker      [4011d3,4011df) {reg5}
251*7304104dSAndroid Build Coastguard Worker    [62] parameter 'word'
252*7304104dSAndroid Build Coastguard Worker      [4011d3,4011df) {reg0}
253*7304104dSAndroid Build Coastguard Worker  [a7] function 'say'@401180
254*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
255*7304104dSAndroid Build Coastguard Worker    [c2] parameter 'prefix'
256*7304104dSAndroid Build Coastguard Worker      [401180,40118e) {reg5}
257*7304104dSAndroid Build Coastguard Worker      [40118e,40119c) {reg3}
258*7304104dSAndroid Build Coastguard Worker      [40119c,4011a7) {entry_value(1) {reg5}, stack_value}
259*7304104dSAndroid Build Coastguard Worker      [4011a7,4011b5) {reg3}
260*7304104dSAndroid Build Coastguard Worker      [4011b5,4011c0) {entry_value(1) {reg5}, stack_value}
261*7304104dSAndroid Build Coastguard Worker    [cb] variable 'world'
262*7304104dSAndroid Build Coastguard Worker      [401193,40119b) {reg0}
263*7304104dSAndroid Build Coastguard Worker      [4011a7,4011b4) {reg0}
264*7304104dSAndroid Build Coastguard Worker  [d5] inlined function 'happy'@40119b
265*7304104dSAndroid Build Coastguard Worker    [e3] parameter 'w'
266*7304104dSAndroid Build Coastguard Worker      [4011a7,4011b4) {reg0}
267*7304104dSAndroid Build Coastguard Worker  [e9] inlined function 'sad'@40119b
268*7304104dSAndroid Build Coastguard Worker    [f3] parameter 'c'
269*7304104dSAndroid Build Coastguard Worker      [40119b,4011a6) {reg0}
270*7304104dSAndroid Build Coastguard Worker      [4011a6,4011a7) {entry_value(1) {reg5}}
271*7304104dSAndroid Build Coastguard Worker      [4011b4,4011bf) {reg0}
272*7304104dSAndroid Build Coastguard Worker  [147] function 'no_subject'@4011c0
273*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
274*7304104dSAndroid Build Coastguard Worker    [15b] parameter 'word'
275*7304104dSAndroid Build Coastguard Worker      [4011c0,4011d0) {reg5}
276*7304104dSAndroid Build Coastguard Worker    [162] parameter 'count'
277*7304104dSAndroid Build Coastguard Worker      [4011c0,4011d0) {reg4}
278*7304104dSAndroid Build Coastguard WorkerEOF
279*7304104dSAndroid Build Coastguard Worker
280*7304104dSAndroid Build Coastguard Worker# GNU DebugFissuon Multi CU Split DWARF. See run-dwarf-ranges.sh.
281*7304104dSAndroid Build Coastguard Workertestfiles testfilesplitranges4.debug
282*7304104dSAndroid Build Coastguard Workertestfiles testfile-ranges-hello.dwo testfile-ranges-world.dwo
283*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/tests/varlocs --debug -e testfilesplitranges4.debug <<\EOF
284*7304104dSAndroid Build Coastguard Workermodule 'testfilesplitranges4.debug'
285*7304104dSAndroid Build Coastguard Worker[b] CU 'hello.c'@0
286*7304104dSAndroid Build Coastguard Worker  [18] function 'no_say'@4004f0
287*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
288*7304104dSAndroid Build Coastguard Worker    [2f] parameter 'prefix'
289*7304104dSAndroid Build Coastguard Worker      [4004f0,4004fa) {reg5}
290*7304104dSAndroid Build Coastguard Worker      [4004fa,4004ff) {GNU_entry_value(1) {reg5}, stack_value}
291*7304104dSAndroid Build Coastguard Worker    [3b] variable 'world'
292*7304104dSAndroid Build Coastguard Worker      <no value>
293*7304104dSAndroid Build Coastguard Worker  [60] function 'main'@4003e0
294*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
295*7304104dSAndroid Build Coastguard Worker    [77] parameter 'argc'
296*7304104dSAndroid Build Coastguard Worker      [4003e0,4003f2) {reg5}
297*7304104dSAndroid Build Coastguard Worker      [4003f2,4003f7) {GNU_entry_value(1) {reg5}, stack_value}
298*7304104dSAndroid Build Coastguard Worker    [83] parameter 'argv'
299*7304104dSAndroid Build Coastguard Worker      [4003e0,4003f6) {reg4}
300*7304104dSAndroid Build Coastguard Worker      [4003f6,1004003f5) {GNU_entry_value(1) {reg4}, stack_value}
301*7304104dSAndroid Build Coastguard Worker  [8f] inlined function 'subject'@4003e3
302*7304104dSAndroid Build Coastguard Worker    [a3] parameter 'count'
303*7304104dSAndroid Build Coastguard Worker      [4003e3,4003ef) {reg5}
304*7304104dSAndroid Build Coastguard Worker    [ac] parameter 'word'
305*7304104dSAndroid Build Coastguard Worker      [4003e3,4003ef) {reg0}
306*7304104dSAndroid Build Coastguard Worker  [e7] function 'subject'@4004e0
307*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
308*7304104dSAndroid Build Coastguard Worker    [fb] parameter 'word'
309*7304104dSAndroid Build Coastguard Worker      [4004e0,4004f0) {reg5}
310*7304104dSAndroid Build Coastguard Worker    [102] parameter 'count'
311*7304104dSAndroid Build Coastguard Worker      [4004e0,4004f0) {reg4}
312*7304104dSAndroid Build Coastguard Workermodule 'testfilesplitranges4.debug'
313*7304104dSAndroid Build Coastguard Worker[b] CU 'world.c'@400500
314*7304104dSAndroid Build Coastguard Worker  [18] function 'no_main'@400550
315*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
316*7304104dSAndroid Build Coastguard Worker    [2f] parameter 'argc'
317*7304104dSAndroid Build Coastguard Worker      [400550,400562) {reg5}
318*7304104dSAndroid Build Coastguard Worker      [400562,400567) {GNU_entry_value(1) {reg5}, stack_value}
319*7304104dSAndroid Build Coastguard Worker    [3b] parameter 'argv'
320*7304104dSAndroid Build Coastguard Worker      [400550,400566) {reg4}
321*7304104dSAndroid Build Coastguard Worker      [400566,100400565) {GNU_entry_value(1) {reg4}, stack_value}
322*7304104dSAndroid Build Coastguard Worker  [47] inlined function 'no_subject'@400553
323*7304104dSAndroid Build Coastguard Worker    [5b] parameter 'count'
324*7304104dSAndroid Build Coastguard Worker      [400553,40055f) {reg5}
325*7304104dSAndroid Build Coastguard Worker    [64] parameter 'word'
326*7304104dSAndroid Build Coastguard Worker      [400553,40055f) {reg0}
327*7304104dSAndroid Build Coastguard Worker  [af] function 'say'@400500
328*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
329*7304104dSAndroid Build Coastguard Worker    [c9] parameter 'prefix'
330*7304104dSAndroid Build Coastguard Worker      [400500,40050e) {reg5}
331*7304104dSAndroid Build Coastguard Worker      [40050e,40051c) {reg3}
332*7304104dSAndroid Build Coastguard Worker      [40051c,400527) {GNU_entry_value(1) {reg5}, stack_value}
333*7304104dSAndroid Build Coastguard Worker      [400527,400535) {reg3}
334*7304104dSAndroid Build Coastguard Worker      [400535,400540) {GNU_entry_value(1) {reg5}, stack_value}
335*7304104dSAndroid Build Coastguard Worker    [d5] variable 'world'
336*7304104dSAndroid Build Coastguard Worker      [400513,40051b) {reg0}
337*7304104dSAndroid Build Coastguard Worker      [400527,400534) {reg0}
338*7304104dSAndroid Build Coastguard Worker  [e1] inlined function 'happy'@40051c
339*7304104dSAndroid Build Coastguard Worker    [f1] parameter 'w'
340*7304104dSAndroid Build Coastguard Worker      [400527,400534) {reg0}
341*7304104dSAndroid Build Coastguard Worker  [fa] inlined function 'sad'@40051c
342*7304104dSAndroid Build Coastguard Worker    [106] parameter 'c'
343*7304104dSAndroid Build Coastguard Worker      [40051b,400526) {reg0}
344*7304104dSAndroid Build Coastguard Worker      [400526,400527) {GNU_entry_value(1) {reg5}}
345*7304104dSAndroid Build Coastguard Worker      [400534,40053f) {reg0}
346*7304104dSAndroid Build Coastguard Worker  [15c] function 'no_subject'@400540
347*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
348*7304104dSAndroid Build Coastguard Worker    [170] parameter 'word'
349*7304104dSAndroid Build Coastguard Worker      [400540,400550) {reg5}
350*7304104dSAndroid Build Coastguard Worker    [177] parameter 'count'
351*7304104dSAndroid Build Coastguard Worker      [400540,400550) {reg4}
352*7304104dSAndroid Build Coastguard WorkerEOF
353*7304104dSAndroid Build Coastguard Worker
354*7304104dSAndroid Build Coastguard Worker# DW_OP_addrx and DW_OP_constx testcases.
355*7304104dSAndroid Build Coastguard Worker#
356*7304104dSAndroid Build Coastguard Worker# int i, j, k;
357*7304104dSAndroid Build Coastguard Worker# __thread int l, m, n;
358*7304104dSAndroid Build Coastguard Worker#
359*7304104dSAndroid Build Coastguard Worker# int main ()
360*7304104dSAndroid Build Coastguard Worker# {
361*7304104dSAndroid Build Coastguard Worker#   int r1 = i + j + k;
362*7304104dSAndroid Build Coastguard Worker#   int r2 = l + m + n;
363*7304104dSAndroid Build Coastguard Worker#   int res = r1 + r2;
364*7304104dSAndroid Build Coastguard Worker#
365*7304104dSAndroid Build Coastguard Worker#   return res;
366*7304104dSAndroid Build Coastguard Worker# }
367*7304104dSAndroid Build Coastguard Worker#
368*7304104dSAndroid Build Coastguard Worker# gcc -O2 -gdwarf-5 -gsplit-dwarf -o addrx_constx-5.o -c addrx_constx.c
369*7304104dSAndroid Build Coastguard Worker# gcc -O2 -gdwarf-5 -gsplit-dwarf -o testfile-addrx_constx-5 addrx_constx-5.o
370*7304104dSAndroid Build Coastguard Worker# gcc -O2 -gdwarf-4 -gsplit-dwarf -o addrx_constx-4.o -c addrx_constx.c
371*7304104dSAndroid Build Coastguard Worker# gcc -O2 -gdwarf-4 -gsplit-dwarf -o testfile-addrx_constx-4 addrx_constx-4.o
372*7304104dSAndroid Build Coastguard Worker
373*7304104dSAndroid Build Coastguard Workertestfiles testfile-addrx_constx-5 addrx_constx-5.dwo
374*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/tests/varlocs --exprlocs -e testfile-addrx_constx-5 <<\EOF
375*7304104dSAndroid Build Coastguard Workermodule 'testfile-addrx_constx-5'
376*7304104dSAndroid Build Coastguard Worker[14] CU 'addrx_constx.c'@0
377*7304104dSAndroid Build Coastguard Worker  producer (strx)
378*7304104dSAndroid Build Coastguard Worker  language (data1)
379*7304104dSAndroid Build Coastguard Worker  name (strx)
380*7304104dSAndroid Build Coastguard Worker  comp_dir (strx)
381*7304104dSAndroid Build Coastguard Worker  [19] variable "i"
382*7304104dSAndroid Build Coastguard Worker    name (string)
383*7304104dSAndroid Build Coastguard Worker    decl_file (implicit_const)
384*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
385*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
386*7304104dSAndroid Build Coastguard Worker    type (ref4)
387*7304104dSAndroid Build Coastguard Worker    external (flag_present)
388*7304104dSAndroid Build Coastguard Worker    location (exprloc) {addr: 0x404038}
389*7304104dSAndroid Build Coastguard Worker  [25] base_type "int"
390*7304104dSAndroid Build Coastguard Worker    byte_size (data1)
391*7304104dSAndroid Build Coastguard Worker    encoding (data1)
392*7304104dSAndroid Build Coastguard Worker    name (string)
393*7304104dSAndroid Build Coastguard Worker  [2c] variable "j"
394*7304104dSAndroid Build Coastguard Worker    name (string)
395*7304104dSAndroid Build Coastguard Worker    decl_file (implicit_const)
396*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
397*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
398*7304104dSAndroid Build Coastguard Worker    type (ref4)
399*7304104dSAndroid Build Coastguard Worker    external (flag_present)
400*7304104dSAndroid Build Coastguard Worker    location (exprloc) {addr: 0x404034}
401*7304104dSAndroid Build Coastguard Worker  [38] variable "k"
402*7304104dSAndroid Build Coastguard Worker    name (string)
403*7304104dSAndroid Build Coastguard Worker    decl_file (implicit_const)
404*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
405*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
406*7304104dSAndroid Build Coastguard Worker    type (ref4)
407*7304104dSAndroid Build Coastguard Worker    external (flag_present)
408*7304104dSAndroid Build Coastguard Worker    location (exprloc) {addr: 0x40403c}
409*7304104dSAndroid Build Coastguard Worker  [44] variable "l"
410*7304104dSAndroid Build Coastguard Worker    name (string)
411*7304104dSAndroid Build Coastguard Worker    decl_file (implicit_const)
412*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
413*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
414*7304104dSAndroid Build Coastguard Worker    type (ref4)
415*7304104dSAndroid Build Coastguard Worker    external (flag_present)
416*7304104dSAndroid Build Coastguard Worker    location (exprloc) {const: 0x403e10, form_tls_address}
417*7304104dSAndroid Build Coastguard Worker  [51] variable "m"
418*7304104dSAndroid Build Coastguard Worker    name (string)
419*7304104dSAndroid Build Coastguard Worker    decl_file (implicit_const)
420*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
421*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
422*7304104dSAndroid Build Coastguard Worker    type (ref4)
423*7304104dSAndroid Build Coastguard Worker    external (flag_present)
424*7304104dSAndroid Build Coastguard Worker    location (exprloc) {const: 0x403e0c, form_tls_address}
425*7304104dSAndroid Build Coastguard Worker  [5e] variable "n"
426*7304104dSAndroid Build Coastguard Worker    name (string)
427*7304104dSAndroid Build Coastguard Worker    decl_file (implicit_const)
428*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
429*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
430*7304104dSAndroid Build Coastguard Worker    type (ref4)
431*7304104dSAndroid Build Coastguard Worker    external (flag_present)
432*7304104dSAndroid Build Coastguard Worker    location (exprloc) {const: 0x403e08, form_tls_address}
433*7304104dSAndroid Build Coastguard Worker  [6b] subprogram "main"
434*7304104dSAndroid Build Coastguard Worker    external (flag_present)
435*7304104dSAndroid Build Coastguard Worker    name (strx)
436*7304104dSAndroid Build Coastguard Worker    decl_file (data1)
437*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
438*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
439*7304104dSAndroid Build Coastguard Worker    type (ref4)
440*7304104dSAndroid Build Coastguard Worker    low_pc (addrx)
441*7304104dSAndroid Build Coastguard Worker    high_pc (data8)
442*7304104dSAndroid Build Coastguard Worker    frame_base (exprloc) {call_frame_cfa {bregx(7,8)}}
443*7304104dSAndroid Build Coastguard Worker    call_all_calls (flag_present)
444*7304104dSAndroid Build Coastguard Worker    [7f] variable "r1"
445*7304104dSAndroid Build Coastguard Worker      name (string)
446*7304104dSAndroid Build Coastguard Worker      decl_file (implicit_const)
447*7304104dSAndroid Build Coastguard Worker      decl_line (data1)
448*7304104dSAndroid Build Coastguard Worker      decl_column (implicit_const)
449*7304104dSAndroid Build Coastguard Worker      type (ref4)
450*7304104dSAndroid Build Coastguard Worker      location (exprloc) {addr: 0x404038, deref_size(4), addr: 0x404034, deref_size(4), plus, addr: 0x40403c, deref_size(4), plus, stack_value}
451*7304104dSAndroid Build Coastguard Worker    [98] variable "r2"
452*7304104dSAndroid Build Coastguard Worker      name (string)
453*7304104dSAndroid Build Coastguard Worker      decl_file (implicit_const)
454*7304104dSAndroid Build Coastguard Worker      decl_line (data1)
455*7304104dSAndroid Build Coastguard Worker      decl_column (implicit_const)
456*7304104dSAndroid Build Coastguard Worker      type (ref4)
457*7304104dSAndroid Build Coastguard Worker      location (exprloc) {form_tls_address, const: 0x403e10, deref_size(4), form_tls_address, const: 0x403e0c, deref_size(4), plus, form_tls_address, const: 0x403e08, deref_size(4), plus, stack_value}
458*7304104dSAndroid Build Coastguard Worker    [b4] variable "res"
459*7304104dSAndroid Build Coastguard Worker      name (string)
460*7304104dSAndroid Build Coastguard Worker      decl_file (implicit_const)
461*7304104dSAndroid Build Coastguard Worker      decl_line (data1)
462*7304104dSAndroid Build Coastguard Worker      decl_column (implicit_const)
463*7304104dSAndroid Build Coastguard Worker      type (ref4)
464*7304104dSAndroid Build Coastguard Worker      location (exprloc) {addr: 0x404038, deref_size(4), form_tls_address, const: 0x403e08, deref_size(4), plus, form_tls_address, const: 0x403e0c, deref_size(4), plus, form_tls_address, const: 0x403e10, deref_size(4), plus, addr: 0x404034, deref_size(4), plus, addr: 0x40403c, deref_size(4), plus, stack_value}
465*7304104dSAndroid Build Coastguard WorkerEOF
466*7304104dSAndroid Build Coastguard Worker
467*7304104dSAndroid Build Coastguard Workertestfiles testfile-addrx_constx-4 addrx_constx-4.dwo
468*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/tests/varlocs --exprlocs -e testfile-addrx_constx-4 <<\EOF
469*7304104dSAndroid Build Coastguard Workermodule 'testfile-addrx_constx-4'
470*7304104dSAndroid Build Coastguard Worker[b] CU 'addrx_constx.c'@0
471*7304104dSAndroid Build Coastguard Worker  producer (GNU_str_index)
472*7304104dSAndroid Build Coastguard Worker  language (data1)
473*7304104dSAndroid Build Coastguard Worker  name (GNU_str_index)
474*7304104dSAndroid Build Coastguard Worker  comp_dir (GNU_str_index)
475*7304104dSAndroid Build Coastguard Worker  GNU_dwo_id (data8)
476*7304104dSAndroid Build Coastguard Worker  [18] variable "i"
477*7304104dSAndroid Build Coastguard Worker    name (string)
478*7304104dSAndroid Build Coastguard Worker    decl_file (data1)
479*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
480*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
481*7304104dSAndroid Build Coastguard Worker    type (ref4)
482*7304104dSAndroid Build Coastguard Worker    external (flag_present)
483*7304104dSAndroid Build Coastguard Worker    location (exprloc) {addr: 0x404038}
484*7304104dSAndroid Build Coastguard Worker  [25] base_type "int"
485*7304104dSAndroid Build Coastguard Worker    byte_size (data1)
486*7304104dSAndroid Build Coastguard Worker    encoding (data1)
487*7304104dSAndroid Build Coastguard Worker    name (string)
488*7304104dSAndroid Build Coastguard Worker  [2c] variable "j"
489*7304104dSAndroid Build Coastguard Worker    name (string)
490*7304104dSAndroid Build Coastguard Worker    decl_file (data1)
491*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
492*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
493*7304104dSAndroid Build Coastguard Worker    type (ref4)
494*7304104dSAndroid Build Coastguard Worker    external (flag_present)
495*7304104dSAndroid Build Coastguard Worker    location (exprloc) {addr: 0x404034}
496*7304104dSAndroid Build Coastguard Worker  [39] variable "k"
497*7304104dSAndroid Build Coastguard Worker    name (string)
498*7304104dSAndroid Build Coastguard Worker    decl_file (data1)
499*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
500*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
501*7304104dSAndroid Build Coastguard Worker    type (ref4)
502*7304104dSAndroid Build Coastguard Worker    external (flag_present)
503*7304104dSAndroid Build Coastguard Worker    location (exprloc) {addr: 0x40403c}
504*7304104dSAndroid Build Coastguard Worker  [46] variable "l"
505*7304104dSAndroid Build Coastguard Worker    name (string)
506*7304104dSAndroid Build Coastguard Worker    decl_file (data1)
507*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
508*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
509*7304104dSAndroid Build Coastguard Worker    type (ref4)
510*7304104dSAndroid Build Coastguard Worker    external (flag_present)
511*7304104dSAndroid Build Coastguard Worker    location (exprloc) {const: 0x403e10, GNU_push_tls_address}
512*7304104dSAndroid Build Coastguard Worker  [54] variable "m"
513*7304104dSAndroid Build Coastguard Worker    name (string)
514*7304104dSAndroid Build Coastguard Worker    decl_file (data1)
515*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
516*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
517*7304104dSAndroid Build Coastguard Worker    type (ref4)
518*7304104dSAndroid Build Coastguard Worker    external (flag_present)
519*7304104dSAndroid Build Coastguard Worker    location (exprloc) {const: 0x403e0c, GNU_push_tls_address}
520*7304104dSAndroid Build Coastguard Worker  [62] variable "n"
521*7304104dSAndroid Build Coastguard Worker    name (string)
522*7304104dSAndroid Build Coastguard Worker    decl_file (data1)
523*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
524*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
525*7304104dSAndroid Build Coastguard Worker    type (ref4)
526*7304104dSAndroid Build Coastguard Worker    external (flag_present)
527*7304104dSAndroid Build Coastguard Worker    location (exprloc) {const: 0x403e08, GNU_push_tls_address}
528*7304104dSAndroid Build Coastguard Worker  [70] subprogram "main"
529*7304104dSAndroid Build Coastguard Worker    external (flag_present)
530*7304104dSAndroid Build Coastguard Worker    name (GNU_str_index)
531*7304104dSAndroid Build Coastguard Worker    decl_file (data1)
532*7304104dSAndroid Build Coastguard Worker    decl_line (data1)
533*7304104dSAndroid Build Coastguard Worker    decl_column (data1)
534*7304104dSAndroid Build Coastguard Worker    type (ref4)
535*7304104dSAndroid Build Coastguard Worker    low_pc (GNU_addr_index)
536*7304104dSAndroid Build Coastguard Worker    high_pc (data8)
537*7304104dSAndroid Build Coastguard Worker    frame_base (exprloc) {call_frame_cfa {bregx(7,8)}}
538*7304104dSAndroid Build Coastguard Worker    GNU_all_call_sites (flag_present)
539*7304104dSAndroid Build Coastguard Worker    [84] variable "r1"
540*7304104dSAndroid Build Coastguard Worker      name (string)
541*7304104dSAndroid Build Coastguard Worker      decl_file (data1)
542*7304104dSAndroid Build Coastguard Worker      decl_line (data1)
543*7304104dSAndroid Build Coastguard Worker      decl_column (data1)
544*7304104dSAndroid Build Coastguard Worker      type (ref4)
545*7304104dSAndroid Build Coastguard Worker      location (exprloc) {addr: 0x404038, deref_size(4), addr: 0x404034, deref_size(4), plus, addr: 0x40403c, deref_size(4), plus, stack_value}
546*7304104dSAndroid Build Coastguard Worker    [9f] variable "r2"
547*7304104dSAndroid Build Coastguard Worker      name (string)
548*7304104dSAndroid Build Coastguard Worker      decl_file (data1)
549*7304104dSAndroid Build Coastguard Worker      decl_line (data1)
550*7304104dSAndroid Build Coastguard Worker      decl_column (data1)
551*7304104dSAndroid Build Coastguard Worker      type (ref4)
552*7304104dSAndroid Build Coastguard Worker      location (exprloc) {GNU_push_tls_address, const: 0x403e10, deref_size(4), GNU_push_tls_address, const: 0x403e0c, deref_size(4), plus, GNU_push_tls_address, const: 0x403e08, deref_size(4), plus, stack_value}
553*7304104dSAndroid Build Coastguard Worker    [bd] variable "res"
554*7304104dSAndroid Build Coastguard Worker      name (string)
555*7304104dSAndroid Build Coastguard Worker      decl_file (data1)
556*7304104dSAndroid Build Coastguard Worker      decl_line (data1)
557*7304104dSAndroid Build Coastguard Worker      decl_column (data1)
558*7304104dSAndroid Build Coastguard Worker      type (ref4)
559*7304104dSAndroid Build Coastguard Worker      location (exprloc) {addr: 0x404038, deref_size(4), GNU_push_tls_address, const: 0x403e08, deref_size(4), plus, GNU_push_tls_address, const: 0x403e0c, deref_size(4), plus, GNU_push_tls_address, const: 0x403e10, deref_size(4), plus, addr: 0x404034, deref_size(4), plus, addr: 0x40403c, deref_size(4), plus, stack_value}
560*7304104dSAndroid Build Coastguard WorkerEOF
561*7304104dSAndroid Build Coastguard Worker
562*7304104dSAndroid Build Coastguard Worker# See run-readelf-loc.sh
563*7304104dSAndroid Build Coastguard Workertestfiles testfile-splitdwarf4-not-split4.debug
564*7304104dSAndroid Build Coastguard Workertestfiles splitdwarf4-not-split4.dwo
565*7304104dSAndroid Build Coastguard Worker
566*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_top_builddir}/tests/varlocs --debug -e testfile-splitdwarf4-not-split4.debug <<\EOF
567*7304104dSAndroid Build Coastguard Workermodule 'testfile-splitdwarf4-not-split4.debug'
568*7304104dSAndroid Build Coastguard Worker[b] CU 'splitdwarf4-not-split4.c'@0
569*7304104dSAndroid Build Coastguard Worker  [18] function 'main'@401050
570*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
571*7304104dSAndroid Build Coastguard Worker    [30] parameter 'argc'
572*7304104dSAndroid Build Coastguard Worker      [401050,40106e) {reg5}
573*7304104dSAndroid Build Coastguard Worker      [40106e,401086) {reg12}
574*7304104dSAndroid Build Coastguard Worker      [401086,401095) {GNU_entry_value(1) {reg5}, stack_value}
575*7304104dSAndroid Build Coastguard Worker      [401095,40109c) {reg5}
576*7304104dSAndroid Build Coastguard Worker    [3d] parameter 'argv'
577*7304104dSAndroid Build Coastguard Worker      [401050,40106e) {reg4}
578*7304104dSAndroid Build Coastguard Worker      [40106e,401095) {GNU_entry_value(1) {reg4}, stack_value}
579*7304104dSAndroid Build Coastguard Worker      [401095,40109c) {reg4}
580*7304104dSAndroid Build Coastguard Worker    [4a] variable 'i'
581*7304104dSAndroid Build Coastguard Worker      [401050,40106e) {lit0, stack_value}
582*7304104dSAndroid Build Coastguard Worker      [401086,40108e) {breg12(0), breg6(0), plus, stack_value}
583*7304104dSAndroid Build Coastguard Worker      [40108e,401095) {reg0}
584*7304104dSAndroid Build Coastguard Worker      [401095,40109c) {lit0, stack_value}
585*7304104dSAndroid Build Coastguard Worker    [58] variable 'p'
586*7304104dSAndroid Build Coastguard Worker      [401050,40106e) {reg5}
587*7304104dSAndroid Build Coastguard Worker      [40106e,401090) {reg6}
588*7304104dSAndroid Build Coastguard Worker      [401095,40109c) {reg5}
589*7304104dSAndroid Build Coastguard Workermodule 'testfile-splitdwarf4-not-split4.debug'
590*7304104dSAndroid Build Coastguard Worker[3f] CU 'popcount.c'@401180
591*7304104dSAndroid Build Coastguard Worker  [61] function 'popcount'@401180
592*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {...}}
593*7304104dSAndroid Build Coastguard Worker    [83] parameter 'u'
594*7304104dSAndroid Build Coastguard Worker      [401180,401189) {reg5}
595*7304104dSAndroid Build Coastguard Worker      [401189,40119b) {reg1}
596*7304104dSAndroid Build Coastguard Worker      [40119b,40119d) {breg1(0), lit1, shr, stack_value}
597*7304104dSAndroid Build Coastguard Worker      [40119d,4011a1) {reg1}
598*7304104dSAndroid Build Coastguard Worker    [91] variable 'c'
599*7304104dSAndroid Build Coastguard Worker      [401180,401189) {lit0, stack_value}
600*7304104dSAndroid Build Coastguard Worker      [401189,4011a0) {reg0}
601*7304104dSAndroid Build Coastguard Worker      [4011a0,4011a1) {lit0, stack_value}
602*7304104dSAndroid Build Coastguard WorkerEOF
603*7304104dSAndroid Build Coastguard Worker
604*7304104dSAndroid Build Coastguard Worker# See testfile-dwp.source.
605*7304104dSAndroid Build Coastguard Workertestfiles testfile-dwp-5 testfile-dwp-5.dwp
606*7304104dSAndroid Build Coastguard Workertestfiles testfile-dwp-4 testfile-dwp-4.dwp
607*7304104dSAndroid Build Coastguard Worker
608*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_builddir}/varlocs -e testfile-dwp-5 << EOF
609*7304104dSAndroid Build Coastguard Workermodule 'testfile-dwp-5'
610*7304104dSAndroid Build Coastguard Worker[84] CU 'foo.cc'@401190
611*7304104dSAndroid Build Coastguard Worker  [c6] function 'foo'@4011c0
612*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
613*7304104dSAndroid Build Coastguard Worker    [e1] parameter 'this'
614*7304104dSAndroid Build Coastguard Worker      [4011c0,401200) {reg5}
615*7304104dSAndroid Build Coastguard Worker    [ea] variable 'x'
616*7304104dSAndroid Build Coastguard Worker      [4011c2,4011d4) {reg0}
617*7304104dSAndroid Build Coastguard Worker      [4011d4,4011d7) {reg1}
618*7304104dSAndroid Build Coastguard Worker      [4011d7,4011d9) {breg1(1), stack_value}
619*7304104dSAndroid Build Coastguard Worker      [4011f1,401200) {reg0}
620*7304104dSAndroid Build Coastguard Worker  [f9] inlined function 'x_x'@4011cb
621*7304104dSAndroid Build Coastguard Worker    [104] parameter 'x'
622*7304104dSAndroid Build Coastguard Worker      [4011cb,4011eb) {reg0}
623*7304104dSAndroid Build Coastguard Worker      [4011f1,401200) {reg0}
624*7304104dSAndroid Build Coastguard Worker  [14a] function 'x_x'@401190
625*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
626*7304104dSAndroid Build Coastguard Worker    [15b] parameter 'x'
627*7304104dSAndroid Build Coastguard Worker      [401190,4011a1) {reg5}
628*7304104dSAndroid Build Coastguard Worker      [4011a1,4011bd) {reg0}
629*7304104dSAndroid Build Coastguard Workermodule 'testfile-dwp-5'
630*7304104dSAndroid Build Coastguard Worker[1fa] CU 'bar.cc'@401200
631*7304104dSAndroid Build Coastguard Worker  [23c] function 'bar'@401200
632*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
633*7304104dSAndroid Build Coastguard Worker    [253] parameter 'this'
634*7304104dSAndroid Build Coastguard Worker      [401200,40121b) {reg5}
635*7304104dSAndroid Build Coastguard Workermodule 'testfile-dwp-5'
636*7304104dSAndroid Build Coastguard Worker[272] CU 'main.cc'@0
637*7304104dSAndroid Build Coastguard Worker  [2c7] function 'main'@401020
638*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
639*7304104dSAndroid Build Coastguard Worker    [2e0] parameter 'argc'
640*7304104dSAndroid Build Coastguard Worker      [401020,401068) {reg5}
641*7304104dSAndroid Build Coastguard Worker      [401068,401080) {fbreg(-40)}
642*7304104dSAndroid Build Coastguard Worker      [401080,401084) {breg5(0)}
643*7304104dSAndroid Build Coastguard Worker      [401084,401099) {entry_value(1) {reg5}, stack_value}
644*7304104dSAndroid Build Coastguard Worker      [401099,4010a0) {reg5}
645*7304104dSAndroid Build Coastguard Worker    [2ec] parameter 'argv'
646*7304104dSAndroid Build Coastguard Worker      [401020,40104b) {reg4}
647*7304104dSAndroid Build Coastguard Worker      [40104b,401099) {entry_value(1) {reg4}, stack_value}
648*7304104dSAndroid Build Coastguard Worker      [401099,4010a0) {reg4}
649*7304104dSAndroid Build Coastguard Worker    [2f8] variable 'myfoo'
650*7304104dSAndroid Build Coastguard Worker      [401020,4010a0) {fbreg(-40)}
651*7304104dSAndroid Build Coastguard Worker    [303] variable 'mybar'
652*7304104dSAndroid Build Coastguard Worker      [401020,4010a0) {fbreg(-32)}
653*7304104dSAndroid Build Coastguard Worker  [30d] inlined function 'fibonacci'@401030
654*7304104dSAndroid Build Coastguard Worker    [31c] parameter 'n'
655*7304104dSAndroid Build Coastguard Worker      [401030,401060) {reg5}
656*7304104dSAndroid Build Coastguard Worker      [401099,4010a0) {reg5}
657*7304104dSAndroid Build Coastguard Worker  [326] inlined function 'fibonacci'
658*7304104dSAndroid Build Coastguard Worker    [32f] parameter 'n'
659*7304104dSAndroid Build Coastguard Worker      <no value>
660*7304104dSAndroid Build Coastguard WorkerEOF
661*7304104dSAndroid Build Coastguard Worker
662*7304104dSAndroid Build Coastguard Workertestrun_compare ${abs_builddir}/varlocs -e testfile-dwp-4 << EOF
663*7304104dSAndroid Build Coastguard Workermodule 'testfile-dwp-4'
664*7304104dSAndroid Build Coastguard Worker[b] CU 'foo.cc'@401190
665*7304104dSAndroid Build Coastguard Worker  [54] function 'foo'@4011c0
666*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
667*7304104dSAndroid Build Coastguard Worker    [6f] parameter 'this'
668*7304104dSAndroid Build Coastguard Worker      [4011c0,401200) {reg5}
669*7304104dSAndroid Build Coastguard Worker    [78] variable 'x'
670*7304104dSAndroid Build Coastguard Worker      [4011c2,4011d4) {reg0}
671*7304104dSAndroid Build Coastguard Worker      [4011d4,4011d7) {reg1}
672*7304104dSAndroid Build Coastguard Worker      [4011d7,4011d9) {breg1(1), stack_value}
673*7304104dSAndroid Build Coastguard Worker      [4011f1,401200) {reg0}
674*7304104dSAndroid Build Coastguard Worker  [8a] inlined function 'x_x'@4011cb
675*7304104dSAndroid Build Coastguard Worker    [98] parameter 'x'
676*7304104dSAndroid Build Coastguard Worker      [4011cb,4011eb) {reg0}
677*7304104dSAndroid Build Coastguard Worker      [4011f1,401200) {reg0}
678*7304104dSAndroid Build Coastguard Worker  [e7] function 'x_x'@401190
679*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
680*7304104dSAndroid Build Coastguard Worker    [f8] parameter 'x'
681*7304104dSAndroid Build Coastguard Worker      [401190,4011a1) {reg5}
682*7304104dSAndroid Build Coastguard Worker      [4011a1,4011bd) {reg0}
683*7304104dSAndroid Build Coastguard Workermodule 'testfile-dwp-4'
684*7304104dSAndroid Build Coastguard Worker[129] CU 'bar.cc'@401200
685*7304104dSAndroid Build Coastguard Worker  [172] function 'bar'@401200
686*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
687*7304104dSAndroid Build Coastguard Worker    [189] parameter 'this'
688*7304104dSAndroid Build Coastguard Worker      [401200,40121b) {reg5}
689*7304104dSAndroid Build Coastguard Workermodule 'testfile-dwp-4'
690*7304104dSAndroid Build Coastguard Worker[19f] CU 'main.cc'@0
691*7304104dSAndroid Build Coastguard Worker  [1fd] function 'main'@401020
692*7304104dSAndroid Build Coastguard Worker    frame_base: {call_frame_cfa {bregx(7,8)}}
693*7304104dSAndroid Build Coastguard Worker    [216] parameter 'argc'
694*7304104dSAndroid Build Coastguard Worker      [401020,401068) {reg5}
695*7304104dSAndroid Build Coastguard Worker      [401068,401080) {fbreg(-40)}
696*7304104dSAndroid Build Coastguard Worker      [401080,401084) {breg5(0)}
697*7304104dSAndroid Build Coastguard Worker      [401084,401097) {GNU_entry_value(1) {reg5}, stack_value}
698*7304104dSAndroid Build Coastguard Worker      [401099,4010a0) {reg5}
699*7304104dSAndroid Build Coastguard Worker    [228] parameter 'argv'
700*7304104dSAndroid Build Coastguard Worker      [401020,40104b) {reg4}
701*7304104dSAndroid Build Coastguard Worker      [40104b,401099) {GNU_entry_value(1) {reg4}, stack_value}
702*7304104dSAndroid Build Coastguard Worker      [401099,4010a0) {reg4}
703*7304104dSAndroid Build Coastguard Worker    [23a] variable 'myfoo'
704*7304104dSAndroid Build Coastguard Worker      [401020,4010a0) {fbreg(-40)}
705*7304104dSAndroid Build Coastguard Worker    [247] variable 'mybar'
706*7304104dSAndroid Build Coastguard Worker      [401020,4010a0) {fbreg(-32)}
707*7304104dSAndroid Build Coastguard Worker  [253] inlined function 'fibonacci'@401030
708*7304104dSAndroid Build Coastguard Worker    [265] parameter 'n'
709*7304104dSAndroid Build Coastguard Worker      [401030,401060) {reg5}
710*7304104dSAndroid Build Coastguard Worker      [401099,4010a0) {reg5}
711*7304104dSAndroid Build Coastguard Worker  [272] inlined function 'fibonacci'
712*7304104dSAndroid Build Coastguard Worker    [27e] parameter 'n'
713*7304104dSAndroid Build Coastguard Worker      <no value>
714*7304104dSAndroid Build Coastguard WorkerEOF
715*7304104dSAndroid Build Coastguard Worker
716*7304104dSAndroid Build Coastguard Workerexit 0
717