libabigail/tests
Dodji Seketeli d38ee66d6b comparison: Represent changed unreachable anonymous unions, structs & enums
Following the changes to represent changed anonymous unreachable enums,
this patch does the same for anonymous unreachable unions, classes and
structs.

Basically, without this patch, this change:

    union
    {
      int a;
      int b;
    };

    ------

    union
    {
      int a;
      int b;
      int c;
    };

yields:

    1 removed type unreachable from any public interface:

      [D] 'union {int a; int b;}' at test_1.c:1:1

    1 added type unreachable from any public interface:

      [A] 'union {int a; int b; int c;}' at test_2.c:1:1

But with the patch, it does yield:

    1 changed type unreachable from any public interface:

      [C] 'union {int a; int b;}' changed:
	type size hasn't changed
	1 data member insertion:
	  'int c' at test-anon-union-v1.c:5:1
	type changed from:
	  union {int a; int b;}
	to:
	  union {int a; int b; int c;}

	* include/abg-fwd.h (class_or_union_types_of_same_kind)
	(is_data_member_of_anonymous_class_or_union): Declare new
	functions.
	* include/abg-ir.h (lookup_data_member): Likewise, declare a new overload.
	* src/abg-ir.cc (class_or_union_types_of_same_kind)
	(lookup_data_member, is_data_member_of_anonymous_class_or_union):
	Define news functions & overloads.
	* src/abg-reporter-priv.cc (represent): When representing a change
	in the name of a data member, if the context is an anonymous type,
	use the non-qualified name of the data member, not its qualified
	name.
	* src/abg-comparison.cc
	(corpus_diff::priv::ensure_lookup_tables_populated): Handle
	deleted/added anonymous enums, unions, classes and structs
	similarly.  That is, if an anonymous type was removed and another
	one got added, if they both have data members (or enumerators) in
	common, then we are probably looking at an anonymous type that was
	changed.  This is because these anonymous types are named using
	their flat representation.
	* tests/data/test-abidiff-exit/test-anon-types-report-1.txt: New
	reference test comparison output.
	* tests/data/test-abidiff-exit/test-anon-types-v{0,1}.o: New
	binary tests input files.
	* tests/data/test-abidiff-exit/test-anon-types-v{0,1}.c: Source
	code of new binary test input.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-abidiff-exit.cc (in_out_specs): Add the test inputs
	above to this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-17 10:50:51 +02:00
..
data comparison: Represent changed unreachable anonymous unions, structs & enums 2023-10-17 10:50:51 +02:00
lib tests: Update Catch2 library to v2.13.9 2022-07-08 15:54:21 +02:00
.gitignore tests/.gitignore: ignore all files starting with runtest* 2020-05-13 11:26:28 +02:00
Makefile.am Add support for BTF 2023-01-06 21:05:53 +01:00
mockfedabipkgdiff.in Handle several variants of Python 'imp', 'importlib' modules 2022-01-06 15:44:29 +01:00
print-diff-tree.cc Update copyright year for 2023 2023-01-01 18:19:30 +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 Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-abidiff-exit.cc comparison: Represent changed unreachable anonymous unions, structs & enums 2023-10-17 10:50:51 +02:00
test-abidiff.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-alt-dwarf-file.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-annotate.cc test-annotate: Don't emit architecture data 2022-09-20 08:58:09 +02:00
test-core-diff.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-cxx-compat.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-diff2.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-diff-dwarf-abixml.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-diff-dwarf.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-diff-filter.cc Bug 29811 - Better categorize harmless unknown array size changes 2023-01-01 18:21:56 +01:00
test-diff-pkg.cc configure,test-diff-pkg.cc: Handle symlinks presence in dist tarball 2023-09-20 13:07:30 +02:00
test-diff-suppr.cc suppression: Add "changed_enumerators_regexp" property 2023-10-17 10:50:51 +02:00
test-dot.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-elf-helpers.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-ini.cc test-ini: Fix a typo 2023-04-27 10:41:30 +02:00
test-ir-walker.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-kmi-whitelist.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-lookup-syms.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-read-btf.cc Update the copyright notice for the BTF reader 2023-01-06 21:40:44 +01:00
test-read-common.cc Use the CTF reader by default when applicable 2022-11-28 16:52:33 +01:00
test-read-common.h Use the CTF reader by default when applicable 2022-11-28 16:52:33 +01:00
test-read-ctf.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-read-dwarf.cc Bug 29692 - Support binaries with empty symbol table 2023-03-22 15:32:10 +01:00
test-read-write.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-svg.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-symtab-reader.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-symtab.cc test-symtab: Update after support for empty symtabs 2023-03-24 14:31:15 +01:00
test-tools-utils.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-types-stability.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-utils.cc Update copyright year for 2023 2023-01-01 18:19:30 +01:00
test-utils.h Update copyright year for 2023 2023-01-01 18:19:30 +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 tests/update-test-output.py: Adapt to some broken test output 2023-04-25 15:50:25 +02:00