libabigail/tests/data
Dodji Seketeli a746f4afee Make applying supp specs through pointer access look through typedefs
Consider the declaration of the exported function bar() below:

    struct _OpaqueType {int member;};

    typedef struct _OpaqueType Type;

    void bar(Type*);

Once the *definition of struct _OpaqueType and bar() are compiled into
a shared library, if a layout change happens to struct _OpaqueType,
then abidiff rightfully reports that bar() is impacted by the layout
change to struct _OpaqueType.

But then, the following suppression specification won't silence the
ABI change report:

    [suppress_type]
      name = _OpaqueType
      type_kind = struct
      accessed_through = pointer

This is because strictly speaking, it's not struct _OpaqueType that is
accessed through a pointer, from function bar(); it's the type 'Type',
(which is a typedef of struct _OpaqueType) that is accessed though a
pointer.

But then, as 'Type' and 'struct _OpaqueType' are the same type (modulo
the typedef), this behaviour is not super useful.  It would be more
interesting if the suppression specification could silence the ABI
change report.

And this is what this patch does.

	* include/abg-comparison.h (type_suppression::suppresses_type):
	Declare new member function.
	(get_typedef_diff_underlying_type_diff): Declare new function.
	* include/abg-fwd.h (get_typedef_underlying_type): Likewise.
	* src/abg-comparison.cc (type_suppression::suppresses_type):
	Define new member function.
	(get_typedef_diff_underlying_type_diff): Define new function.
	(type_suppression::suppresses_diff): After looking through the
	different kind of access methods, use the new
	type_suppression::suppresses_type(), rather than doing lots of
	stuff ourselves here.  But then, if the suppression doesn't apply
	to the subjects of the diff, look through typedefs and try to
	apply the suppression again.
	* src/abg-ir.cc (get_typedef_underlying_type): Define new
	function.
	* tests/data/test-diff-suppr/libtest25-typedef-v{0,1}.so: New
	binary test input files.
	* tests/data/test-diff-suppr/test25-typedef-v{0,1}.c: Source code
	for the binary test input files above.
	* tests/data/test-diff-suppr/test25-typedef-report-{0, 1}.txt: New test
	input files.
	* tests/data/test-diff-suppr/test25-typedef-suppr-0.txt: New test
	input file.
	* tests/data/Makefile.am: Add the new test material to the source
	distribution.
	* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
	above to the set of test inputs this harness has to run over.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-01 14:34:46 +02:00
..
test-abicompat Make the name of the removed variable section be consistent 2015-07-24 14:06:29 +02:00
test-abidiff Adjust some tests for output changes 2015-07-09 00:10:33 +02:00
test-alt-dwarf-file Make the alt dwarf debug file *not* be a symlink 2014-11-19 16:50:48 +01:00
test-core-diff Fix further reaching reverse path calculation in core diff algo 2014-02-10 15:51:09 +01:00
test-diff-dwarf Consider default symbol versions when computing added/removed fns/vars 2015-07-24 14:04:11 +02:00
test-diff-filter Remove extra vertical spaces from diff report 2015-07-16 12:27:24 +02:00
test-diff-pkg Show linkage names in abipkgdiff output 2015-07-21 16:09:53 +02:00
test-diff-suppr Make applying supp specs through pointer access look through typedefs 2015-08-01 14:34:46 +02:00
test-lookup-syms Re-build a test input file with debug info 2014-05-14 11:32:06 +02:00
test-read-dwarf On changed fn, show symbol info when name is different from linkage name in C 2015-07-19 19:52:01 +02:00
test-read-write PR libabigail/18180 2015-03-31 08:06:17 +02:00
test-write-read-archive Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
Makefile.am Make applying supp specs through pointer access look through typedefs 2015-08-01 14:34:46 +02:00