1#! /bin/sh
2# Copyright (C) 2009, 2014 Red Hat, Inc.
3# This file is part of elfutils.
4#
5# This file is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# elfutils is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18. $srcdir/test-subr.sh
19
20testfiles testfile51
21
22testrun_compare ${abs_builddir}/dwarf-getmacros testfile51 0xb <<\EOF
23file /home/petr/proj/elfutils/pending/elfutils/tests/decom/x.c
24 __STDC__ 1
25 __STDC_HOSTED__ 1
26 __GNUC__ 4
27 __GNUC_MINOR__ 3
28 __GNUC_PATCHLEVEL__ 2
29 __GNUC_RH_RELEASE__ 7
30 __SIZE_TYPE__ long unsigned int
31 __PTRDIFF_TYPE__ long int
32 __WCHAR_TYPE__ int
33 __WINT_TYPE__ unsigned int
34 __INTMAX_TYPE__ long int
35 __UINTMAX_TYPE__ long unsigned int
36 __GXX_ABI_VERSION 1002
37 __SCHAR_MAX__ 127
38 __SHRT_MAX__ 32767
39 __INT_MAX__ 2147483647
40 __LONG_MAX__ 9223372036854775807L
41 __LONG_LONG_MAX__ 9223372036854775807LL
42 __WCHAR_MAX__ 2147483647
43 __CHAR_BIT__ 8
44 __INTMAX_MAX__ 9223372036854775807L
45 __FLT_EVAL_METHOD__ 0
46 __DEC_EVAL_METHOD__ 2
47 __FLT_RADIX__ 2
48 __FLT_MANT_DIG__ 24
49 __FLT_DIG__ 6
50 __FLT_MIN_EXP__ (-125)
51 __FLT_MIN_10_EXP__ (-37)
52 __FLT_MAX_EXP__ 128
53 __FLT_MAX_10_EXP__ 38
54 __FLT_MAX__ 3.40282347e+38F
55 __FLT_MIN__ 1.17549435e-38F
56 __FLT_EPSILON__ 1.19209290e-7F
57 __FLT_DENORM_MIN__ 1.40129846e-45F
58 __FLT_HAS_DENORM__ 1
59 __FLT_HAS_INFINITY__ 1
60 __FLT_HAS_QUIET_NAN__ 1
61 __DBL_MANT_DIG__ 53
62 __DBL_DIG__ 15
63 __DBL_MIN_EXP__ (-1021)
64 __DBL_MIN_10_EXP__ (-307)
65 __DBL_MAX_EXP__ 1024
66 __DBL_MAX_10_EXP__ 308
67 __DBL_MAX__ 1.7976931348623157e+308
68 __DBL_MIN__ 2.2250738585072014e-308
69 __DBL_EPSILON__ 2.2204460492503131e-16
70 __DBL_DENORM_MIN__ 4.9406564584124654e-324
71 __DBL_HAS_DENORM__ 1
72 __DBL_HAS_INFINITY__ 1
73 __DBL_HAS_QUIET_NAN__ 1
74 __LDBL_MANT_DIG__ 64
75 __LDBL_DIG__ 18
76 __LDBL_MIN_EXP__ (-16381)
77 __LDBL_MIN_10_EXP__ (-4931)
78 __LDBL_MAX_EXP__ 16384
79 __LDBL_MAX_10_EXP__ 4932
80 __DECIMAL_DIG__ 21
81 __LDBL_MAX__ 1.18973149535723176502e+4932L
82 __LDBL_MIN__ 3.36210314311209350626e-4932L
83 __LDBL_EPSILON__ 1.08420217248550443401e-19L
84 __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
85 __LDBL_HAS_DENORM__ 1
86 __LDBL_HAS_INFINITY__ 1
87 __LDBL_HAS_QUIET_NAN__ 1
88 __DEC32_MANT_DIG__ 7
89 __DEC32_MIN_EXP__ (-95)
90 __DEC32_MAX_EXP__ 96
91 __DEC32_MIN__ 1E-95DF
92 __DEC32_MAX__ 9.999999E96DF
93 __DEC32_EPSILON__ 1E-6DF
94 __DEC32_DEN__ 0.000001E-95DF
95 __DEC64_MANT_DIG__ 16
96 __DEC64_MIN_EXP__ (-383)
97 __DEC64_MAX_EXP__ 384
98 __DEC64_MIN__ 1E-383DD
99 __DEC64_MAX__ 9.999999999999999E384DD
100 __DEC64_EPSILON__ 1E-15DD
101 __DEC64_DEN__ 0.000000000000001E-383DD
102 __DEC128_MANT_DIG__ 34
103 __DEC128_MIN_EXP__ (-6143)
104 __DEC128_MAX_EXP__ 6144
105 __DEC128_MIN__ 1E-6143DL
106 __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
107 __DEC128_EPSILON__ 1E-33DL
108 __DEC128_DEN__ 0.000000000000000000000000000000001E-6143DL
109 __REGISTER_PREFIX__
110 __USER_LABEL_PREFIX__
111 __VERSION__ "4.3.2 20081105 (Red Hat 4.3.2-7)"
112 __GNUC_GNU_INLINE__ 1
113 _LP64 1
114 __LP64__ 1
115 __NO_INLINE__ 1
116 __FINITE_MATH_ONLY__ 0
117 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
118 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
119 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
120 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
121 __SIZEOF_INT__ 4
122 __SIZEOF_LONG__ 8
123 __SIZEOF_LONG_LONG__ 8
124 __SIZEOF_SHORT__ 2
125 __SIZEOF_FLOAT__ 4
126 __SIZEOF_DOUBLE__ 8
127 __SIZEOF_LONG_DOUBLE__ 16
128 __SIZEOF_SIZE_T__ 8
129 __SIZEOF_WCHAR_T__ 4
130 __SIZEOF_WINT_T__ 4
131 __SIZEOF_PTRDIFF_T__ 8
132 __SIZEOF_POINTER__ 8
133 __amd64 1
134 __amd64__ 1
135 __x86_64 1
136 __x86_64__ 1
137 __k8 1
138 __k8__ 1
139 __MMX__ 1
140 __SSE__ 1
141 __SSE2__ 1
142 __SSE_MATH__ 1
143 __SSE2_MATH__ 1
144 __gnu_linux__ 1
145 __linux 1
146 __linux__ 1
147 linux 1
148 __unix 1
149 __unix__ 1
150 unix 1
151 __ELF__ 1
152 __DECIMAL_BID_FORMAT__ 1
153 macro1 ble
154/file
155EOF
156
157testrun_compare ${abs_builddir}/dwarf-getmacros testfile51 0x84 <<\EOF
158file /home/petr/proj/elfutils/pending/elfutils/tests/decom/y.c
159 __STDC__ 1
160 __STDC_HOSTED__ 1
161 __GNUC__ 4
162 __GNUC_MINOR__ 3
163 __GNUC_PATCHLEVEL__ 2
164 __GNUC_RH_RELEASE__ 7
165 __SIZE_TYPE__ long unsigned int
166 __PTRDIFF_TYPE__ long int
167 __WCHAR_TYPE__ int
168 __WINT_TYPE__ unsigned int
169 __INTMAX_TYPE__ long int
170 __UINTMAX_TYPE__ long unsigned int
171 __GXX_ABI_VERSION 1002
172 __SCHAR_MAX__ 127
173 __SHRT_MAX__ 32767
174 __INT_MAX__ 2147483647
175 __LONG_MAX__ 9223372036854775807L
176 __LONG_LONG_MAX__ 9223372036854775807LL
177 __WCHAR_MAX__ 2147483647
178 __CHAR_BIT__ 8
179 __INTMAX_MAX__ 9223372036854775807L
180 __FLT_EVAL_METHOD__ 0
181 __DEC_EVAL_METHOD__ 2
182 __FLT_RADIX__ 2
183 __FLT_MANT_DIG__ 24
184 __FLT_DIG__ 6
185 __FLT_MIN_EXP__ (-125)
186 __FLT_MIN_10_EXP__ (-37)
187 __FLT_MAX_EXP__ 128
188 __FLT_MAX_10_EXP__ 38
189 __FLT_MAX__ 3.40282347e+38F
190 __FLT_MIN__ 1.17549435e-38F
191 __FLT_EPSILON__ 1.19209290e-7F
192 __FLT_DENORM_MIN__ 1.40129846e-45F
193 __FLT_HAS_DENORM__ 1
194 __FLT_HAS_INFINITY__ 1
195 __FLT_HAS_QUIET_NAN__ 1
196 __DBL_MANT_DIG__ 53
197 __DBL_DIG__ 15
198 __DBL_MIN_EXP__ (-1021)
199 __DBL_MIN_10_EXP__ (-307)
200 __DBL_MAX_EXP__ 1024
201 __DBL_MAX_10_EXP__ 308
202 __DBL_MAX__ 1.7976931348623157e+308
203 __DBL_MIN__ 2.2250738585072014e-308
204 __DBL_EPSILON__ 2.2204460492503131e-16
205 __DBL_DENORM_MIN__ 4.9406564584124654e-324
206 __DBL_HAS_DENORM__ 1
207 __DBL_HAS_INFINITY__ 1
208 __DBL_HAS_QUIET_NAN__ 1
209 __LDBL_MANT_DIG__ 64
210 __LDBL_DIG__ 18
211 __LDBL_MIN_EXP__ (-16381)
212 __LDBL_MIN_10_EXP__ (-4931)
213 __LDBL_MAX_EXP__ 16384
214 __LDBL_MAX_10_EXP__ 4932
215 __DECIMAL_DIG__ 21
216 __LDBL_MAX__ 1.18973149535723176502e+4932L
217 __LDBL_MIN__ 3.36210314311209350626e-4932L
218 __LDBL_EPSILON__ 1.08420217248550443401e-19L
219 __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
220 __LDBL_HAS_DENORM__ 1
221 __LDBL_HAS_INFINITY__ 1
222 __LDBL_HAS_QUIET_NAN__ 1
223 __DEC32_MANT_DIG__ 7
224 __DEC32_MIN_EXP__ (-95)
225 __DEC32_MAX_EXP__ 96
226 __DEC32_MIN__ 1E-95DF
227 __DEC32_MAX__ 9.999999E96DF
228 __DEC32_EPSILON__ 1E-6DF
229 __DEC32_DEN__ 0.000001E-95DF
230 __DEC64_MANT_DIG__ 16
231 __DEC64_MIN_EXP__ (-383)
232 __DEC64_MAX_EXP__ 384
233 __DEC64_MIN__ 1E-383DD
234 __DEC64_MAX__ 9.999999999999999E384DD
235 __DEC64_EPSILON__ 1E-15DD
236 __DEC64_DEN__ 0.000000000000001E-383DD
237 __DEC128_MANT_DIG__ 34
238 __DEC128_MIN_EXP__ (-6143)
239 __DEC128_MAX_EXP__ 6144
240 __DEC128_MIN__ 1E-6143DL
241 __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
242 __DEC128_EPSILON__ 1E-33DL
243 __DEC128_DEN__ 0.000000000000000000000000000000001E-6143DL
244 __REGISTER_PREFIX__
245 __USER_LABEL_PREFIX__
246 __VERSION__ "4.3.2 20081105 (Red Hat 4.3.2-7)"
247 __GNUC_GNU_INLINE__ 1
248 _LP64 1
249 __LP64__ 1
250 __NO_INLINE__ 1
251 __FINITE_MATH_ONLY__ 0
252 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
253 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
254 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
255 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
256 __SIZEOF_INT__ 4
257 __SIZEOF_LONG__ 8
258 __SIZEOF_LONG_LONG__ 8
259 __SIZEOF_SHORT__ 2
260 __SIZEOF_FLOAT__ 4
261 __SIZEOF_DOUBLE__ 8
262 __SIZEOF_LONG_DOUBLE__ 16
263 __SIZEOF_SIZE_T__ 8
264 __SIZEOF_WCHAR_T__ 4
265 __SIZEOF_WINT_T__ 4
266 __SIZEOF_PTRDIFF_T__ 8
267 __SIZEOF_POINTER__ 8
268 __amd64 1
269 __amd64__ 1
270 __x86_64 1
271 __x86_64__ 1
272 __k8 1
273 __k8__ 1
274 __MMX__ 1
275 __SSE__ 1
276 __SSE2__ 1
277 __SSE_MATH__ 1
278 __SSE2_MATH__ 1
279 __gnu_linux__ 1
280 __linux 1
281 __linux__ 1
282 linux 1
283 __unix 1
284 __unix__ 1
285 unix 1
286 __ELF__ 1
287 __DECIMAL_BID_FORMAT__ 1
288 macro2 ble
289/file
290EOF
291
292testfiles testfile-macros
293
294testrun_compare ${abs_builddir}/dwarf-getmacros testfile-macros 0xb <<\EOF
295__STDC__ 1
296__STDC_HOSTED__ 1
297__GNUC__ 4
298__GNUC_MINOR__ 7
299__GNUC_PATCHLEVEL__ 0
300__VERSION__ "4.7.0 20120507 (Red Hat 4.7.0-5)"
301__GNUC_RH_RELEASE__ 5
302__ATOMIC_RELAXED 0
303__ATOMIC_SEQ_CST 5
304__ATOMIC_ACQUIRE 2
305__ATOMIC_RELEASE 3
306__ATOMIC_ACQ_REL 4
307__ATOMIC_CONSUME 1
308__FINITE_MATH_ONLY__ 0
309_LP64 1
310__LP64__ 1
311__SIZEOF_INT__ 4
312__SIZEOF_LONG__ 8
313__SIZEOF_LONG_LONG__ 8
314__SIZEOF_SHORT__ 2
315__SIZEOF_FLOAT__ 4
316__SIZEOF_DOUBLE__ 8
317__SIZEOF_LONG_DOUBLE__ 16
318__SIZEOF_SIZE_T__ 8
319__CHAR_BIT__ 8
320__BIGGEST_ALIGNMENT__ 16
321__ORDER_LITTLE_ENDIAN__ 1234
322__ORDER_BIG_ENDIAN__ 4321
323__ORDER_PDP_ENDIAN__ 3412
324__BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
325__FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
326__SIZEOF_POINTER__ 8
327__SIZE_TYPE__ long unsigned int
328__PTRDIFF_TYPE__ long int
329__WCHAR_TYPE__ int
330__WINT_TYPE__ unsigned int
331__INTMAX_TYPE__ long int
332__UINTMAX_TYPE__ long unsigned int
333__CHAR16_TYPE__ short unsigned int
334__CHAR32_TYPE__ unsigned int
335__SIG_ATOMIC_TYPE__ int
336__INT8_TYPE__ signed char
337__INT16_TYPE__ short int
338__INT32_TYPE__ int
339__INT64_TYPE__ long int
340__UINT8_TYPE__ unsigned char
341__UINT16_TYPE__ short unsigned int
342__UINT32_TYPE__ unsigned int
343__UINT64_TYPE__ long unsigned int
344__INT_LEAST8_TYPE__ signed char
345__INT_LEAST16_TYPE__ short int
346__INT_LEAST32_TYPE__ int
347__INT_LEAST64_TYPE__ long int
348__UINT_LEAST8_TYPE__ unsigned char
349__UINT_LEAST16_TYPE__ short unsigned int
350__UINT_LEAST32_TYPE__ unsigned int
351__UINT_LEAST64_TYPE__ long unsigned int
352__INT_FAST8_TYPE__ signed char
353__INT_FAST16_TYPE__ long int
354__INT_FAST32_TYPE__ long int
355__INT_FAST64_TYPE__ long int
356__UINT_FAST8_TYPE__ unsigned char
357__UINT_FAST16_TYPE__ long unsigned int
358__UINT_FAST32_TYPE__ long unsigned int
359__UINT_FAST64_TYPE__ long unsigned int
360__INTPTR_TYPE__ long int
361__UINTPTR_TYPE__ long unsigned int
362__GXX_ABI_VERSION 1002
363__SCHAR_MAX__ 127
364__SHRT_MAX__ 32767
365__INT_MAX__ 2147483647
366__LONG_MAX__ 9223372036854775807L
367__LONG_LONG_MAX__ 9223372036854775807LL
368__WCHAR_MAX__ 2147483647
369__WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
370__WINT_MAX__ 4294967295U
371__WINT_MIN__ 0U
372__PTRDIFF_MAX__ 9223372036854775807L
373__SIZE_MAX__ 18446744073709551615UL
374__INTMAX_MAX__ 9223372036854775807L
375__INTMAX_C(c) c ## L
376__UINTMAX_MAX__ 18446744073709551615UL
377__UINTMAX_C(c) c ## UL
378__SIG_ATOMIC_MAX__ 2147483647
379__SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
380__INT8_MAX__ 127
381__INT16_MAX__ 32767
382__INT32_MAX__ 2147483647
383__INT64_MAX__ 9223372036854775807L
384__UINT8_MAX__ 255
385__UINT16_MAX__ 65535
386__UINT32_MAX__ 4294967295U
387__UINT64_MAX__ 18446744073709551615UL
388__INT_LEAST8_MAX__ 127
389__INT8_C(c) c
390__INT_LEAST16_MAX__ 32767
391__INT16_C(c) c
392__INT_LEAST32_MAX__ 2147483647
393__INT32_C(c) c
394__INT_LEAST64_MAX__ 9223372036854775807L
395__INT64_C(c) c ## L
396__UINT_LEAST8_MAX__ 255
397__UINT8_C(c) c
398__UINT_LEAST16_MAX__ 65535
399__UINT16_C(c) c
400__UINT_LEAST32_MAX__ 4294967295U
401__UINT32_C(c) c ## U
402__UINT_LEAST64_MAX__ 18446744073709551615UL
403__UINT64_C(c) c ## UL
404__INT_FAST8_MAX__ 127
405__INT_FAST16_MAX__ 9223372036854775807L
406__INT_FAST32_MAX__ 9223372036854775807L
407__INT_FAST64_MAX__ 9223372036854775807L
408__UINT_FAST8_MAX__ 255
409__UINT_FAST16_MAX__ 18446744073709551615UL
410__UINT_FAST32_MAX__ 18446744073709551615UL
411__UINT_FAST64_MAX__ 18446744073709551615UL
412__INTPTR_MAX__ 9223372036854775807L
413__UINTPTR_MAX__ 18446744073709551615UL
414__FLT_EVAL_METHOD__ 0
415__DEC_EVAL_METHOD__ 2
416__FLT_RADIX__ 2
417__FLT_MANT_DIG__ 24
418__FLT_DIG__ 6
419__FLT_MIN_EXP__ (-125)
420__FLT_MIN_10_EXP__ (-37)
421__FLT_MAX_EXP__ 128
422__FLT_MAX_10_EXP__ 38
423__FLT_DECIMAL_DIG__ 9
424__FLT_MAX__ 3.40282346638528859812e+38F
425__FLT_MIN__ 1.17549435082228750797e-38F
426__FLT_EPSILON__ 1.19209289550781250000e-7F
427__FLT_DENORM_MIN__ 1.40129846432481707092e-45F
428__FLT_HAS_DENORM__ 1
429__FLT_HAS_INFINITY__ 1
430__FLT_HAS_QUIET_NAN__ 1
431__DBL_MANT_DIG__ 53
432__DBL_DIG__ 15
433__DBL_MIN_EXP__ (-1021)
434__DBL_MIN_10_EXP__ (-307)
435__DBL_MAX_EXP__ 1024
436__DBL_MAX_10_EXP__ 308
437__DBL_DECIMAL_DIG__ 17
438__DBL_MAX__ ((double)1.79769313486231570815e+308L)
439__DBL_MIN__ ((double)2.22507385850720138309e-308L)
440__DBL_EPSILON__ ((double)2.22044604925031308085e-16L)
441__DBL_DENORM_MIN__ ((double)4.94065645841246544177e-324L)
442__DBL_HAS_DENORM__ 1
443__DBL_HAS_INFINITY__ 1
444__DBL_HAS_QUIET_NAN__ 1
445__LDBL_MANT_DIG__ 64
446__LDBL_DIG__ 18
447__LDBL_MIN_EXP__ (-16381)
448__LDBL_MIN_10_EXP__ (-4931)
449__LDBL_MAX_EXP__ 16384
450__LDBL_MAX_10_EXP__ 4932
451__DECIMAL_DIG__ 21
452__LDBL_MAX__ 1.18973149535723176502e+4932L
453__LDBL_MIN__ 3.36210314311209350626e-4932L
454__LDBL_EPSILON__ 1.08420217248550443401e-19L
455__LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
456__LDBL_HAS_DENORM__ 1
457__LDBL_HAS_INFINITY__ 1
458__LDBL_HAS_QUIET_NAN__ 1
459__DEC32_MANT_DIG__ 7
460__DEC32_MIN_EXP__ (-94)
461__DEC32_MAX_EXP__ 97
462__DEC32_MIN__ 1E-95DF
463__DEC32_MAX__ 9.999999E96DF
464__DEC32_EPSILON__ 1E-6DF
465__DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
466__DEC64_MANT_DIG__ 16
467__DEC64_MIN_EXP__ (-382)
468__DEC64_MAX_EXP__ 385
469__DEC64_MIN__ 1E-383DD
470__DEC64_MAX__ 9.999999999999999E384DD
471__DEC64_EPSILON__ 1E-15DD
472__DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
473__DEC128_MANT_DIG__ 34
474__DEC128_MIN_EXP__ (-6142)
475__DEC128_MAX_EXP__ 6145
476__DEC128_MIN__ 1E-6143DL
477__DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
478__DEC128_EPSILON__ 1E-33DL
479__DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
480__REGISTER_PREFIX__
481__USER_LABEL_PREFIX__
482__GNUC_GNU_INLINE__ 1
483__NO_INLINE__ 1
484__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
485__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
486__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
487__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
488__GCC_ATOMIC_BOOL_LOCK_FREE 2
489__GCC_ATOMIC_CHAR_LOCK_FREE 2
490__GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
491__GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
492__GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
493__GCC_ATOMIC_SHORT_LOCK_FREE 2
494__GCC_ATOMIC_INT_LOCK_FREE 2
495__GCC_ATOMIC_LONG_LOCK_FREE 2
496__GCC_ATOMIC_LLONG_LOCK_FREE 2
497__GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
498__GCC_ATOMIC_POINTER_LOCK_FREE 2
499__GCC_HAVE_DWARF2_CFI_ASM 1
500__PRAGMA_REDEFINE_EXTNAME 1
501__SIZEOF_INT128__ 16
502__SIZEOF_WCHAR_T__ 4
503__SIZEOF_WINT_T__ 4
504__SIZEOF_PTRDIFF_T__ 8
505__amd64 1
506__amd64__ 1
507__x86_64 1
508__x86_64__ 1
509__k8 1
510__k8__ 1
511__MMX__ 1
512__SSE__ 1
513__SSE2__ 1
514__SSE_MATH__ 1
515__SSE2_MATH__ 1
516__gnu_linux__ 1
517__linux 1
518__linux__ 1
519linux 1
520__unix 1
521__unix__ 1
522unix 1
523__ELF__ 1
524__DECIMAL_BID_FORMAT__ 1
525file /home/mark/src/tests/macro.c
526 file /usr/include/string.h
527  _STRING_H 1
528  file /usr/include/features.h
529   include 0x5d8
530    _FEATURES_H 1
531    __KERNEL_STRICT_NAMES
532    __USE_ANSI 1
533    __GNUC_PREREQ(maj,min) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
534    _BSD_SOURCE 1
535    _SVID_SOURCE 1
536    _POSIX_SOURCE 1
537    _POSIX_C_SOURCE 200809L
538    __USE_POSIX_IMPLICITLY 1
539    __USE_POSIX 1
540    __USE_POSIX2 1
541    __USE_POSIX199309 1
542    __USE_POSIX199506 1
543    __USE_XOPEN2K 1
544    __USE_ISOC95 1
545    __USE_ISOC99 1
546    __USE_XOPEN2K8 1
547    _ATFILE_SOURCE 1
548    __USE_MISC 1
549    __USE_BSD 1
550    __USE_SVID 1
551    __USE_ATFILE 1
552    __USE_FORTIFY_LEVEL 0
553   /include
554   file /usr/include/stdc-predef.h
555    include 0x733
556     _STDC_PREDEF_H 1
557     __STDC_IEC_559__ 1
558     __STDC_IEC_559_COMPLEX__ 1
559     __STDC_ISO_10646__ 201103L
560     __STDC_NO_THREADS__ 1
561    /include
562   /file
563   include 0x755
564    __GNU_LIBRARY__ 6
565    __GLIBC__ 2
566    __GLIBC_MINOR__ 15
567    __GLIBC_PREREQ(maj,min) ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
568    __GLIBC_HAVE_LONG_LONG 1
569   /include
570   file /usr/include/sys/cdefs.h
571    include 0x783
572     _SYS_CDEFS_H 1
573     __LEAF , __leaf__
574     __LEAF_ATTR __attribute__ ((__leaf__))
575     __THROW __attribute__ ((__nothrow__ __LEAF))
576     __THROWNL __attribute__ ((__nothrow__))
577     __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
578     __P(args) args
579     __PMT(args) args
580     __CONCAT(x,y) x ## y
581     __STRING(x) #x
582     __ptr_t void *
583     __long_double_t long double
584     __BEGIN_DECLS
585     __END_DECLS
586     __BEGIN_NAMESPACE_STD
587     __END_NAMESPACE_STD
588     __USING_NAMESPACE_STD(name)
589     __BEGIN_NAMESPACE_C99
590     __END_NAMESPACE_C99
591     __USING_NAMESPACE_C99(name)
592     __bounded
593     __unbounded
594     __ptrvalue
595     __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
596     __bos0(ptr) __builtin_object_size (ptr, 0)
597     __fortify_function __extern_always_inline __attribute_artificial__
598     __warndecl(name,msg) extern void name (void) __attribute__((__warning__ (msg)))
599     __warnattr(msg) __attribute__((__warning__ (msg)))
600     __errordecl(name,msg) extern void name (void) __attribute__((__error__ (msg)))
601     __flexarr []
602     __REDIRECT(name,proto,alias) name proto __asm__ (__ASMNAME (#alias))
603     __REDIRECT_NTH(name,proto,alias) name proto __asm__ (__ASMNAME (#alias)) __THROW
604     __REDIRECT_NTHNL(name,proto,alias) name proto __asm__ (__ASMNAME (#alias)) __THROWNL
605     __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
606     __ASMNAME2(prefix,cname) __STRING (prefix) cname
607     __attribute_malloc__ __attribute__ ((__malloc__))
608     __attribute_pure__ __attribute__ ((__pure__))
609     __attribute_const__ __attribute__ ((__const__))
610     __attribute_used__ __attribute__ ((__used__))
611     __attribute_noinline__ __attribute__ ((__noinline__))
612     __attribute_deprecated__ __attribute__ ((__deprecated__))
613     __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
614     __attribute_format_strfmon__(a,b) __attribute__ ((__format__ (__strfmon__, a, b)))
615     __nonnull(params) __attribute__ ((__nonnull__ params))
616     __attribute_warn_unused_result__ __attribute__ ((__warn_unused_result__))
617     __wur
618     __always_inline __inline __attribute__ ((__always_inline__))
619     __attribute_artificial__ __attribute__ ((__artificial__))
620     __extern_inline extern __inline
621     __extern_always_inline extern __always_inline
622     __va_arg_pack() __builtin_va_arg_pack ()
623     __va_arg_pack_len() __builtin_va_arg_pack_len ()
624     __restrict_arr __restrict
625     __glibc_unlikely(cond) __builtin_expect((cond), 0)
626    /include
627    file /usr/include/bits/wordsize.h
628     include 0x8fa
629      __WORDSIZE 64
630      __WORDSIZE_TIME64_COMPAT32 1
631      __SYSCALL_WORDSIZE 64
632     /include
633    /file
634    include 0x910
635     __LDBL_REDIR1(name,proto,alias) name proto
636     __LDBL_REDIR(name,proto) name proto
637     __LDBL_REDIR1_NTH(name,proto,alias) name proto __THROW
638     __LDBL_REDIR_NTH(name,proto) name proto __THROW
639     __LDBL_REDIR_DECL(name)
640     __REDIRECT_LDBL(name,proto,alias) __REDIRECT (name, proto, alias)
641     __REDIRECT_NTH_LDBL(name,proto,alias) __REDIRECT_NTH (name, proto, alias)
642    /include
643   /file
644   file /usr/include/gnu/stubs.h
645    file /usr/include/gnu/stubs-64.h
646     include 0x945
647      __stub_bdflush
648      __stub_chflags
649      __stub_fattach
650      __stub_fchflags
651      __stub_fdetach
652      __stub_getmsg
653      __stub_gtty
654      __stub_lchmod
655      __stub_putmsg
656      __stub_revoke
657      __stub_setlogin
658      __stub_sigreturn
659      __stub_sstk
660      __stub_stty
661     /include
662    /file
663   /file
664  /file
665  include 0x99d
666   __need_size_t
667   __need_NULL
668  /include
669  file /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/stddef.h
670   include 0x9ad
671    __size_t__
672    __SIZE_T__
673    _SIZE_T
674    _SYS_SIZE_T_H
675    _T_SIZE_
676    _T_SIZE
677    __SIZE_T
678    _SIZE_T_
679    _BSD_SIZE_T_
680    _SIZE_T_DEFINED_
681    _SIZE_T_DEFINED
682    _BSD_SIZE_T_DEFINED_
683    _SIZE_T_DECLARED
684    ___int_size_t_h
685    _GCC_SIZE_T
686    _SIZET_
687    __size_t
688    NULL ((void *)0)
689   /include
690  /file
691  file /usr/include/xlocale.h
692   _XLOCALE_H 1
693  /file
694 /file
695 HELLO "world"
696/file
697EOF
698
699testfiles testfile-macros-0xff
700testrun_compare ${abs_builddir}/dwarf-getmacros testfile-macros-0xff 0xb <<\EOF
701invalid opcode
702EOF
703testrun_compare ${abs_builddir}/dwarf-getmacros testfile-macros-0xff 0xb '' <<\EOF
704opcode 255 with 0 arguments
705file /home/petr/proj/elfutils/master/elfutils/x.c
706 FOO 0
707/file
708EOF
709
710exit 0
711