1#! /bin/sh
2# Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 Red Hat, Inc.
3# This file is part of elfutils.
4# Written by Ulrich Drepper <drepper@redhat.com>, 1999.
5#
6# This file is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 3 of the License, or
9# (at your option) any later version.
10#
11# elfutils is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19. $srcdir/test-subr.sh
20
21testfiles testfile testfile2
22
23testrun_compare ${abs_builddir}/show-abbrev testfile testfile2 <<\EOF
24abbrev[0]: code = 1, tag = 17, children = 1
25abbrev[0]: attr[0]: code = 16, form = 6, offset = 0
26abbrev[0]: attr[1]: code = 18, form = 1, offset = 2
27abbrev[0]: attr[2]: code = 17, form = 1, offset = 4
28abbrev[0]: attr[3]: code = 3, form = 8, offset = 6
29abbrev[0]: attr[4]: code = 27, form = 8, offset = 8
30abbrev[0]: attr[5]: code = 37, form = 8, offset = 10
31abbrev[0]: attr[6]: code = 19, form = 11, offset = 12
32abbrev[19]: code = 2, tag = 46, children = 1
33abbrev[19]: attr[0]: code = 1, form = 19, offset = 19
34abbrev[19]: attr[1]: code = 63, form = 12, offset = 21
35abbrev[19]: attr[2]: code = 3, form = 8, offset = 23
36abbrev[19]: attr[3]: code = 58, form = 11, offset = 25
37abbrev[19]: attr[4]: code = 59, form = 11, offset = 27
38abbrev[19]: attr[5]: code = 39, form = 12, offset = 29
39abbrev[19]: attr[6]: code = 73, form = 19, offset = 31
40abbrev[19]: attr[7]: code = 17, form = 1, offset = 33
41abbrev[19]: attr[8]: code = 18, form = 1, offset = 35
42abbrev[19]: attr[9]: code = 64, form = 10, offset = 37
43abbrev[44]: code = 3, tag = 46, children = 1
44abbrev[44]: attr[0]: code = 1, form = 19, offset = 44
45abbrev[44]: attr[1]: code = 63, form = 12, offset = 46
46abbrev[44]: attr[2]: code = 3, form = 8, offset = 48
47abbrev[44]: attr[3]: code = 58, form = 11, offset = 50
48abbrev[44]: attr[4]: code = 59, form = 11, offset = 52
49abbrev[44]: attr[5]: code = 73, form = 19, offset = 54
50abbrev[44]: attr[6]: code = 60, form = 12, offset = 56
51abbrev[63]: code = 4, tag = 24, children = 0
52abbrev[68]: code = 5, tag = 46, children = 1
53abbrev[68]: attr[0]: code = 63, form = 12, offset = 68
54abbrev[68]: attr[1]: code = 3, form = 8, offset = 70
55abbrev[68]: attr[2]: code = 58, form = 11, offset = 72
56abbrev[68]: attr[3]: code = 59, form = 11, offset = 74
57abbrev[68]: attr[4]: code = 73, form = 19, offset = 76
58abbrev[68]: attr[5]: code = 60, form = 12, offset = 78
59abbrev[85]: code = 6, tag = 36, children = 0
60abbrev[85]: attr[0]: code = 3, form = 8, offset = 85
61abbrev[85]: attr[1]: code = 11, form = 11, offset = 87
62abbrev[85]: attr[2]: code = 62, form = 11, offset = 89
63abbrev[96]: code = 7, tag = 52, children = 0
64abbrev[96]: attr[0]: code = 3, form = 8, offset = 96
65abbrev[96]: attr[1]: code = 58, form = 11, offset = 98
66abbrev[96]: attr[2]: code = 59, form = 11, offset = 100
67abbrev[96]: attr[3]: code = 73, form = 19, offset = 102
68abbrev[96]: attr[4]: code = 63, form = 12, offset = 104
69abbrev[96]: attr[5]: code = 2, form = 10, offset = 106
70abbrev[0]: code = 1, tag = 17, children = 1
71abbrev[0]: attr[0]: code = 16, form = 6, offset = 114
72abbrev[0]: attr[1]: code = 18, form = 1, offset = 116
73abbrev[0]: attr[2]: code = 17, form = 1, offset = 118
74abbrev[0]: attr[3]: code = 3, form = 8, offset = 120
75abbrev[0]: attr[4]: code = 27, form = 8, offset = 122
76abbrev[0]: attr[5]: code = 37, form = 8, offset = 124
77abbrev[0]: attr[6]: code = 19, form = 11, offset = 126
78abbrev[19]: code = 2, tag = 46, children = 0
79abbrev[19]: attr[0]: code = 63, form = 12, offset = 133
80abbrev[19]: attr[1]: code = 3, form = 8, offset = 135
81abbrev[19]: attr[2]: code = 58, form = 11, offset = 137
82abbrev[19]: attr[3]: code = 59, form = 11, offset = 139
83abbrev[19]: attr[4]: code = 39, form = 12, offset = 141
84abbrev[19]: attr[5]: code = 73, form = 19, offset = 143
85abbrev[19]: attr[6]: code = 17, form = 1, offset = 145
86abbrev[19]: attr[7]: code = 18, form = 1, offset = 147
87abbrev[19]: attr[8]: code = 64, form = 10, offset = 149
88abbrev[42]: code = 3, tag = 36, children = 0
89abbrev[42]: attr[0]: code = 3, form = 8, offset = 156
90abbrev[42]: attr[1]: code = 11, form = 11, offset = 158
91abbrev[42]: attr[2]: code = 62, form = 11, offset = 160
92abbrev[53]: code = 4, tag = 22, children = 0
93abbrev[53]: attr[0]: code = 3, form = 8, offset = 167
94abbrev[53]: attr[1]: code = 58, form = 11, offset = 169
95abbrev[53]: attr[2]: code = 59, form = 11, offset = 171
96abbrev[53]: attr[3]: code = 73, form = 19, offset = 173
97abbrev[66]: code = 5, tag = 15, children = 0
98abbrev[66]: attr[0]: code = 11, form = 11, offset = 180
99abbrev[73]: code = 6, tag = 15, children = 0
100abbrev[73]: attr[0]: code = 11, form = 11, offset = 187
101abbrev[73]: attr[1]: code = 73, form = 19, offset = 189
102abbrev[82]: code = 7, tag = 19, children = 1
103abbrev[82]: attr[0]: code = 1, form = 19, offset = 196
104abbrev[82]: attr[1]: code = 11, form = 11, offset = 198
105abbrev[82]: attr[2]: code = 58, form = 11, offset = 200
106abbrev[82]: attr[3]: code = 59, form = 11, offset = 202
107abbrev[95]: code = 8, tag = 13, children = 0
108abbrev[95]: attr[0]: code = 3, form = 8, offset = 209
109abbrev[95]: attr[1]: code = 58, form = 11, offset = 211
110abbrev[95]: attr[2]: code = 59, form = 11, offset = 213
111abbrev[95]: attr[3]: code = 73, form = 19, offset = 215
112abbrev[95]: attr[4]: code = 56, form = 10, offset = 217
113abbrev[110]: code = 9, tag = 1, children = 1
114abbrev[110]: attr[0]: code = 1, form = 19, offset = 224
115abbrev[110]: attr[1]: code = 73, form = 19, offset = 226
116abbrev[119]: code = 10, tag = 33, children = 0
117abbrev[119]: attr[0]: code = 73, form = 19, offset = 233
118abbrev[119]: attr[1]: code = 47, form = 11, offset = 235
119abbrev[128]: code = 11, tag = 19, children = 1
120abbrev[128]: attr[0]: code = 1, form = 19, offset = 242
121abbrev[128]: attr[1]: code = 3, form = 8, offset = 244
122abbrev[128]: attr[2]: code = 11, form = 11, offset = 246
123abbrev[128]: attr[3]: code = 58, form = 11, offset = 248
124abbrev[128]: attr[4]: code = 59, form = 11, offset = 250
125abbrev[143]: code = 12, tag = 19, children = 0
126abbrev[143]: attr[0]: code = 3, form = 8, offset = 257
127abbrev[143]: attr[1]: code = 60, form = 12, offset = 259
128abbrev[152]: code = 13, tag = 13, children = 0
129abbrev[152]: attr[0]: code = 3, form = 8, offset = 266
130abbrev[152]: attr[1]: code = 58, form = 11, offset = 268
131abbrev[152]: attr[2]: code = 59, form = 5, offset = 270
132abbrev[152]: attr[3]: code = 73, form = 19, offset = 272
133abbrev[152]: attr[4]: code = 56, form = 10, offset = 274
134abbrev[167]: code = 14, tag = 22, children = 0
135abbrev[167]: attr[0]: code = 3, form = 8, offset = 281
136abbrev[167]: attr[1]: code = 58, form = 11, offset = 283
137abbrev[167]: attr[2]: code = 59, form = 5, offset = 285
138abbrev[167]: attr[3]: code = 73, form = 19, offset = 287
139abbrev[180]: code = 15, tag = 23, children = 1
140abbrev[180]: attr[0]: code = 1, form = 19, offset = 294
141abbrev[180]: attr[1]: code = 11, form = 11, offset = 296
142abbrev[180]: attr[2]: code = 58, form = 11, offset = 298
143abbrev[180]: attr[3]: code = 59, form = 11, offset = 300
144abbrev[193]: code = 16, tag = 13, children = 0
145abbrev[193]: attr[0]: code = 3, form = 8, offset = 307
146abbrev[193]: attr[1]: code = 58, form = 11, offset = 309
147abbrev[193]: attr[2]: code = 59, form = 11, offset = 311
148abbrev[193]: attr[3]: code = 73, form = 19, offset = 313
149abbrev[206]: code = 17, tag = 4, children = 1
150abbrev[206]: attr[0]: code = 1, form = 19, offset = 320
151abbrev[206]: attr[1]: code = 11, form = 11, offset = 322
152abbrev[206]: attr[2]: code = 58, form = 11, offset = 324
153abbrev[206]: attr[3]: code = 59, form = 11, offset = 326
154abbrev[219]: code = 18, tag = 40, children = 0
155abbrev[219]: attr[0]: code = 3, form = 8, offset = 333
156abbrev[219]: attr[1]: code = 28, form = 11, offset = 335
157abbrev[228]: code = 19, tag = 38, children = 0
158abbrev[228]: attr[0]: code = 73, form = 19, offset = 342
159abbrev[235]: code = 20, tag = 21, children = 1
160abbrev[235]: attr[0]: code = 1, form = 19, offset = 349
161abbrev[235]: attr[1]: code = 39, form = 12, offset = 351
162abbrev[235]: attr[2]: code = 73, form = 19, offset = 353
163abbrev[246]: code = 21, tag = 5, children = 0
164abbrev[246]: attr[0]: code = 73, form = 19, offset = 360
165abbrev[253]: code = 22, tag = 21, children = 1
166abbrev[253]: attr[0]: code = 1, form = 19, offset = 367
167abbrev[253]: attr[1]: code = 39, form = 12, offset = 369
168abbrev[262]: code = 23, tag = 33, children = 0
169abbrev[262]: attr[0]: code = 73, form = 19, offset = 376
170abbrev[262]: attr[1]: code = 47, form = 6, offset = 378
171abbrev[271]: code = 24, tag = 22, children = 0
172abbrev[271]: attr[0]: code = 3, form = 8, offset = 385
173abbrev[271]: attr[1]: code = 58, form = 11, offset = 387
174abbrev[271]: attr[2]: code = 59, form = 11, offset = 389
175abbrev[282]: code = 25, tag = 4, children = 1
176abbrev[282]: attr[0]: code = 1, form = 19, offset = 396
177abbrev[282]: attr[1]: code = 3, form = 8, offset = 398
178abbrev[282]: attr[2]: code = 11, form = 11, offset = 400
179abbrev[282]: attr[3]: code = 58, form = 11, offset = 402
180abbrev[282]: attr[4]: code = 59, form = 11, offset = 404
181abbrev[0]: code = 1, tag = 17, children = 1
182abbrev[0]: attr[0]: code = 16, form = 6, offset = 412
183abbrev[0]: attr[1]: code = 18, form = 1, offset = 414
184abbrev[0]: attr[2]: code = 17, form = 1, offset = 416
185abbrev[0]: attr[3]: code = 3, form = 8, offset = 418
186abbrev[0]: attr[4]: code = 27, form = 8, offset = 420
187abbrev[0]: attr[5]: code = 37, form = 8, offset = 422
188abbrev[0]: attr[6]: code = 19, form = 11, offset = 424
189abbrev[19]: code = 2, tag = 46, children = 0
190abbrev[19]: attr[0]: code = 63, form = 12, offset = 431
191abbrev[19]: attr[1]: code = 3, form = 8, offset = 433
192abbrev[19]: attr[2]: code = 58, form = 11, offset = 435
193abbrev[19]: attr[3]: code = 59, form = 11, offset = 437
194abbrev[19]: attr[4]: code = 39, form = 12, offset = 439
195abbrev[19]: attr[5]: code = 73, form = 19, offset = 441
196abbrev[19]: attr[6]: code = 17, form = 1, offset = 443
197abbrev[19]: attr[7]: code = 18, form = 1, offset = 445
198abbrev[19]: attr[8]: code = 64, form = 10, offset = 447
199abbrev[42]: code = 3, tag = 36, children = 0
200abbrev[42]: attr[0]: code = 3, form = 8, offset = 454
201abbrev[42]: attr[1]: code = 11, form = 11, offset = 456
202abbrev[42]: attr[2]: code = 62, form = 11, offset = 458
203abbrev[0]: code = 1, tag = 17, children = 1
204abbrev[0]: attr[0]: code = 16, form = 6, offset = 0
205abbrev[0]: attr[1]: code = 18, form = 1, offset = 2
206abbrev[0]: attr[2]: code = 17, form = 1, offset = 4
207abbrev[0]: attr[3]: code = 3, form = 8, offset = 6
208abbrev[0]: attr[4]: code = 27, form = 8, offset = 8
209abbrev[0]: attr[5]: code = 37, form = 8, offset = 10
210abbrev[0]: attr[6]: code = 19, form = 11, offset = 12
211abbrev[19]: code = 2, tag = 46, children = 0
212abbrev[19]: attr[0]: code = 63, form = 12, offset = 19
213abbrev[19]: attr[1]: code = 3, form = 8, offset = 21
214abbrev[19]: attr[2]: code = 58, form = 11, offset = 23
215abbrev[19]: attr[3]: code = 59, form = 11, offset = 25
216abbrev[19]: attr[4]: code = 39, form = 12, offset = 27
217abbrev[19]: attr[5]: code = 73, form = 19, offset = 29
218abbrev[19]: attr[6]: code = 17, form = 1, offset = 31
219abbrev[19]: attr[7]: code = 18, form = 1, offset = 33
220abbrev[19]: attr[8]: code = 64, form = 10, offset = 35
221abbrev[42]: code = 3, tag = 36, children = 0
222abbrev[42]: attr[0]: code = 3, form = 8, offset = 42
223abbrev[42]: attr[1]: code = 11, form = 11, offset = 44
224abbrev[42]: attr[2]: code = 62, form = 11, offset = 46
225abbrev[53]: code = 4, tag = 22, children = 0
226abbrev[53]: attr[0]: code = 3, form = 8, offset = 53
227abbrev[53]: attr[1]: code = 58, form = 11, offset = 55
228abbrev[53]: attr[2]: code = 59, form = 11, offset = 57
229abbrev[53]: attr[3]: code = 73, form = 19, offset = 59
230abbrev[66]: code = 5, tag = 1, children = 1
231abbrev[66]: attr[0]: code = 1, form = 19, offset = 66
232abbrev[66]: attr[1]: code = 3, form = 8, offset = 68
233abbrev[66]: attr[2]: code = 73, form = 19, offset = 70
234abbrev[77]: code = 6, tag = 33, children = 0
235abbrev[77]: attr[0]: code = 73, form = 19, offset = 77
236abbrev[77]: attr[1]: code = 47, form = 11, offset = 79
237abbrev[86]: code = 7, tag = 19, children = 1
238abbrev[86]: attr[0]: code = 1, form = 19, offset = 86
239abbrev[86]: attr[1]: code = 3, form = 8, offset = 88
240abbrev[86]: attr[2]: code = 11, form = 11, offset = 90
241abbrev[86]: attr[3]: code = 58, form = 11, offset = 92
242abbrev[86]: attr[4]: code = 59, form = 11, offset = 94
243abbrev[101]: code = 8, tag = 13, children = 0
244abbrev[101]: attr[0]: code = 3, form = 8, offset = 101
245abbrev[101]: attr[1]: code = 58, form = 11, offset = 103
246abbrev[101]: attr[2]: code = 59, form = 11, offset = 105
247abbrev[101]: attr[3]: code = 73, form = 19, offset = 107
248abbrev[101]: attr[4]: code = 56, form = 10, offset = 109
249abbrev[116]: code = 9, tag = 15, children = 0
250abbrev[116]: attr[0]: code = 11, form = 11, offset = 116
251abbrev[123]: code = 10, tag = 15, children = 0
252abbrev[123]: attr[0]: code = 11, form = 11, offset = 123
253abbrev[123]: attr[1]: code = 73, form = 19, offset = 125
254abbrev[132]: code = 11, tag = 19, children = 1
255abbrev[132]: attr[0]: code = 1, form = 19, offset = 132
256abbrev[132]: attr[1]: code = 11, form = 11, offset = 134
257abbrev[132]: attr[2]: code = 58, form = 11, offset = 136
258abbrev[132]: attr[3]: code = 59, form = 11, offset = 138
259abbrev[145]: code = 12, tag = 1, children = 1
260abbrev[145]: attr[0]: code = 1, form = 19, offset = 145
261abbrev[145]: attr[1]: code = 73, form = 19, offset = 147
262abbrev[154]: code = 13, tag = 22, children = 0
263abbrev[154]: attr[0]: code = 3, form = 8, offset = 154
264abbrev[154]: attr[1]: code = 58, form = 11, offset = 156
265abbrev[154]: attr[2]: code = 59, form = 5, offset = 158
266abbrev[154]: attr[3]: code = 73, form = 19, offset = 160
267abbrev[167]: code = 14, tag = 19, children = 0
268abbrev[167]: attr[0]: code = 3, form = 8, offset = 167
269abbrev[167]: attr[1]: code = 60, form = 12, offset = 169
270abbrev[176]: code = 15, tag = 22, children = 0
271abbrev[176]: attr[0]: code = 3, form = 8, offset = 176
272abbrev[176]: attr[1]: code = 58, form = 11, offset = 178
273abbrev[176]: attr[2]: code = 59, form = 11, offset = 180
274abbrev[187]: code = 16, tag = 21, children = 1
275abbrev[187]: attr[0]: code = 1, form = 19, offset = 187
276abbrev[187]: attr[1]: code = 39, form = 12, offset = 189
277abbrev[187]: attr[2]: code = 73, form = 19, offset = 191
278abbrev[198]: code = 17, tag = 5, children = 0
279abbrev[198]: attr[0]: code = 73, form = 19, offset = 198
280abbrev[205]: code = 18, tag = 38, children = 0
281abbrev[205]: attr[0]: code = 73, form = 19, offset = 205
282abbrev[0]: code = 1, tag = 17, children = 1
283abbrev[0]: attr[0]: code = 16, form = 6, offset = 213
284abbrev[0]: attr[1]: code = 18, form = 1, offset = 215
285abbrev[0]: attr[2]: code = 17, form = 1, offset = 217
286abbrev[0]: attr[3]: code = 3, form = 8, offset = 219
287abbrev[0]: attr[4]: code = 27, form = 8, offset = 221
288abbrev[0]: attr[5]: code = 37, form = 8, offset = 223
289abbrev[0]: attr[6]: code = 19, form = 11, offset = 225
290abbrev[19]: code = 2, tag = 46, children = 0
291abbrev[19]: attr[0]: code = 63, form = 12, offset = 232
292abbrev[19]: attr[1]: code = 3, form = 8, offset = 234
293abbrev[19]: attr[2]: code = 58, form = 11, offset = 236
294abbrev[19]: attr[3]: code = 59, form = 11, offset = 238
295abbrev[19]: attr[4]: code = 39, form = 12, offset = 240
296abbrev[19]: attr[5]: code = 73, form = 19, offset = 242
297abbrev[19]: attr[6]: code = 17, form = 1, offset = 244
298abbrev[19]: attr[7]: code = 18, form = 1, offset = 246
299abbrev[19]: attr[8]: code = 64, form = 10, offset = 248
300abbrev[42]: code = 3, tag = 36, children = 0
301abbrev[42]: attr[0]: code = 3, form = 8, offset = 255
302abbrev[42]: attr[1]: code = 11, form = 11, offset = 257
303abbrev[42]: attr[2]: code = 62, form = 11, offset = 259
304abbrev[0]: code = 1, tag = 17, children = 1
305abbrev[0]: attr[0]: code = 16, form = 6, offset = 267
306abbrev[0]: attr[1]: code = 18, form = 1, offset = 269
307abbrev[0]: attr[2]: code = 17, form = 1, offset = 271
308abbrev[0]: attr[3]: code = 3, form = 8, offset = 273
309abbrev[0]: attr[4]: code = 27, form = 8, offset = 275
310abbrev[0]: attr[5]: code = 37, form = 8, offset = 277
311abbrev[0]: attr[6]: code = 19, form = 11, offset = 279
312abbrev[19]: code = 2, tag = 46, children = 1
313abbrev[19]: attr[0]: code = 1, form = 19, offset = 286
314abbrev[19]: attr[1]: code = 63, form = 12, offset = 288
315abbrev[19]: attr[2]: code = 3, form = 8, offset = 290
316abbrev[19]: attr[3]: code = 58, form = 11, offset = 292
317abbrev[19]: attr[4]: code = 59, form = 11, offset = 294
318abbrev[19]: attr[5]: code = 39, form = 12, offset = 296
319abbrev[19]: attr[6]: code = 73, form = 19, offset = 298
320abbrev[19]: attr[7]: code = 17, form = 1, offset = 300
321abbrev[19]: attr[8]: code = 18, form = 1, offset = 302
322abbrev[19]: attr[9]: code = 64, form = 10, offset = 304
323abbrev[44]: code = 3, tag = 46, children = 1
324abbrev[44]: attr[0]: code = 1, form = 19, offset = 311
325abbrev[44]: attr[1]: code = 63, form = 12, offset = 313
326abbrev[44]: attr[2]: code = 3, form = 8, offset = 315
327abbrev[44]: attr[3]: code = 58, form = 11, offset = 317
328abbrev[44]: attr[4]: code = 59, form = 11, offset = 319
329abbrev[44]: attr[5]: code = 73, form = 19, offset = 321
330abbrev[44]: attr[6]: code = 60, form = 12, offset = 323
331abbrev[63]: code = 4, tag = 24, children = 0
332abbrev[68]: code = 5, tag = 46, children = 1
333abbrev[68]: attr[0]: code = 63, form = 12, offset = 335
334abbrev[68]: attr[1]: code = 3, form = 8, offset = 337
335abbrev[68]: attr[2]: code = 58, form = 11, offset = 339
336abbrev[68]: attr[3]: code = 59, form = 11, offset = 341
337abbrev[68]: attr[4]: code = 73, form = 19, offset = 343
338abbrev[68]: attr[5]: code = 60, form = 12, offset = 345
339abbrev[85]: code = 6, tag = 36, children = 0
340abbrev[85]: attr[0]: code = 3, form = 8, offset = 352
341abbrev[85]: attr[1]: code = 11, form = 11, offset = 354
342abbrev[85]: attr[2]: code = 62, form = 11, offset = 356
343abbrev[96]: code = 7, tag = 52, children = 0
344abbrev[96]: attr[0]: code = 3, form = 8, offset = 363
345abbrev[96]: attr[1]: code = 58, form = 11, offset = 365
346abbrev[96]: attr[2]: code = 59, form = 11, offset = 367
347abbrev[96]: attr[3]: code = 73, form = 19, offset = 369
348abbrev[96]: attr[4]: code = 63, form = 12, offset = 371
349abbrev[96]: attr[5]: code = 2, form = 10, offset = 373
350EOF
351
352exit 0
353