libabigail/tests
Dodji Seketeli a16b922b11 dwarf-reader: Canonicalize opaque enums and classes
This issue was reported in bug https://sourceware.org/bugzilla/show_bug.cgi?id=27700.

When we construct an opaque type (triggered by the use of
--drop-private-types along with the --headers-dir option on abidw, for
instance) with get_opaque_version_of_type we forget to canonicalize
the resulting type.

Later, at abixml emitting time (for instance)
hash_as_canonical_type_or_constant would rightfully abort because the
type wasn't canonicalized.  We want all types (okay, modulo one
exception) in the system to be canonicalized.

This patch fixes the problem by canonicalizing opaque types.

	* src/abg-dwarf-reader.cc (build_ir_node_from_die): Canonicalize
	opaque enums and classes.
	* tests/data/test-read-dwarf/PR27700/include-dir/priv.h: New test
	header file.
	* tests/data/test-read-dwarf/PR27700/include-dir/pub.h: Likewise
	* tests/data/test-read-dwarf/PR27700/pub-incdir/inc.h: Likewise.
	* tests/data/test-read-dwarf/PR27700/test-PR27700.o: New binary
	input file.
	* tests/data/test-read-dwarf/PR27700/test-PR27700.abi: Reference
	abi file of the binary above.
	* tests/data/test-read-dwarf/PR27700/test-PR27700.c: Source file
	of the binary above.
	* tests/data/Makefile.am: Add the test material above to source
	distribution.
	* tests/test-read-dwarf.cc (InOutSpec::in_public_headers_path):
	Add new data member.
	(in_out_specs): Adjust to reflect the new data member in the
	InOutSpec type.  Add a new test input.
	(set_suppressions_from_headers): Define new static function.
	(test_task::perform): Use the content of the new
	InOutSpec::in_public_headers_path to construct and add
	"--headers-dir <headers-dir> --drop-private-types" to the options
	of the abidw program run.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-04-12 15:47:44 +02:00
..
data dwarf-reader: Canonicalize opaque enums and classes 2021-04-12 15:47:44 +02:00
lib tests/catch.hpp: Add SPDX header back 2021-03-08 11:33:56 +01:00
.gitignore tests/.gitignore: ignore all files starting with runtest* 2020-05-13 11:26:28 +02:00
Makefile.am Bug 27512 - Remove broken zip-archive support 2021-03-19 10:52:57 +01:00
mockfedabipkgdiff.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
print-diff-tree.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestcanonicalizetypes.sh.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestdefaultsupprs.py.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestdefaultsupprspy3.sh.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestfedabipkgdiff.py.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestfedabipkgdiffpy3.sh.in Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
runtestslowselfcompare.sh.in Bug 26769 - Fix missing types in abixml output 2020-11-23 13:02:34 +01:00
test-abicompat.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-abidiff-exit.cc symtab: Add support for MODVERSIONS (CRC checksums) 2021-04-02 16:13:13 +02:00
test-abidiff.cc symtab: Add support for MODVERSIONS (CRC checksums) 2021-04-02 16:13:13 +02:00
test-alt-dwarf-file.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-annotate.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-core-diff.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-cxx-compat.cc abg-cxx-compat: add simplified version of std::optional 2021-03-09 10:41:10 +01:00
test-diff2.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-diff-dwarf-abixml.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-diff-dwarf.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-diff-filter.cc Bug 27598 - abidiff mishandles union member functions 2021-03-31 18:21:28 +02:00
test-diff-pkg.cc dwarf-reader: Support more DWARF-5 type DIEs 2021-03-18 13:41:18 +01:00
test-diff-suppr.cc Bug 27267 - Better support for opaque enum types 2021-02-04 09:26:05 +01:00
test-dot.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-elf-helpers.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-ini.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-ir-walker.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-kmi-whitelist.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-lookup-syms.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-read-dwarf.cc dwarf-reader: Canonicalize opaque enums and classes 2021-04-12 15:47:44 +02:00
test-read-write.cc symtab: Add support for MODVERSIONS (CRC checksums) 2021-04-02 16:13:13 +02:00
test-svg.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-symtab-reader.cc dwarf-reader split: create abg-symtab-reader.{h,cc} and test case 2021-03-10 18:54:55 +01:00
test-symtab.cc symtab: Add support for MODVERSIONS (CRC checksums) 2021-04-02 16:13:13 +02:00
test-tools-utils.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-types-stability.cc Bug 27165 - Better support multi-language binaries 2021-02-02 16:15:29 +01:00
test-utils.cc Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-utils.h Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
test-valgrind-suppressions.supp Shut down a helgrind false positive in the "system" libc call 2017-03-17 09:02:19 +01:00
update-test-output.py Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00