libabigail/tests/data/test-diff-dwarf/test35-pr19173-libfoo-long.c
Dodji Seketeli 5d24cf87d7 Support DW_AT_count DWARF attribute
Libabigail's DWARF reader does not support the DW_AT_count attribute
used to specify the number of elements in an array subrange.  Rather,
it uses the DW_AT_lower_bound and DW_AT_upper_bound attributes that
are emitted by GCC.  Recent versions of Clang, on the other hand, use
the DW_AT_count attribute.

This patch adds support for the DW_AT_count attribute too.

	* src/abg-dwarf-reader.cc (get_default_array_lower_bound): Define
	new static function.
	(build_array_type): Support the DW_AT_count attribute.
	* tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-clang.so:
	New test binary input.
	* tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-clang2.so: Likewise.
	* tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-clang-report-0.txt:
	New test reference output.
	* tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-gcc.so:
	New test binary input.
	* tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-gcc2.so:
	New test binary input.
	* tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-gcc-report-0.txt:
	New test reference output.
	* tests/data/test-diff-dwarf/test35-pr19173-libfoo-long.c: Source
	code for the binaries above.
	* tests/data/Makefile.am: Add the new test material to the build
	system.
	* tests/test-diff-dwarf.cc (in_out_specs): Add the new test inputs
	to the harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-11-07 23:22:19 +01:00

16 lines
668 B
C

// This file is the source code for 4 binaries.
// It comes from one of the comments of bug libabigail/19173.
// To compile the first two binaries, please do:
// gcc test35-pr19173-libfoo-long.c -shared -fpic -o test35-pr19173-libfoo-long-gcc.so -g
// gcc test35-pr19173-libfoo-long.c -shared -fpic -o test35-pr19173-libfoo-long-gcc2.so -g -DLONG
//
// To compile the next two binaries, please do:
// clang test35-pr19173-libfoo-long.c -shared -fpic -o test35-pr19173-libfoo-long-clang.so -g
// clang test35-pr19173-libfoo-long.c -shared -fpic -o test35-pr19173-libfoo-long-clang2.so -g -DLONG
#ifdef LONG
char buggy_symbol[10];
#else
char buggy_symbol[5];
#endif