[RFC PATCH] Add qualifier / typedef / array / pointer test
Dodji Seketeli
dodji@seketeli.org
Thu Dec 10 09:10:11 GMT 2020
Hello Giuliano,
Giuliano Procida <gprocida@google.com> a écrit:
> This change adds a test which exercises libabigail's handling of
> qualified typedefs of arrays. The base type in the test case is an
> array of pointers (chosen so we can also use restrict).
>
> Various typedefs and (indirect) qualifications of this type are
> created. In all cases, the resulting type should be an array of
> qualified pointers.
>
> However, abidiff reports things like
>
> 'const volatile void* const'
>
> changed to
>
> 'restrict const volatile volatile void* const'
>
> I've not attempted to check whether DWARF and ABI XML faithfully
> reflect the source types. There may be trouble there as well.
Yeah, or there might be a bug somewhere. In any case, it'd be good to
look into this. I didn't have time until now, but I feel adding these
tests is improvement already. We can dig into this issue later. Maybe
we should file a bug for it?
[...]
> diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
> index 84447185..516a7f4d 100644
> --- a/tests/data/Makefile.am
> +++ b/tests/data/Makefile.am
> @@ -184,6 +184,14 @@ test-abidiff-exit/test-headers-dirs/test-headers-dir-v0.c \
> test-abidiff-exit/test-headers-dirs/test-headers-dir-v0.o \
> test-abidiff-exit/test-headers-dirs/test-headers-dir-v1.c \
> test-abidiff-exit/test-headers-dirs/test-headers-dir-v1.o \
> +test-abidiff-exit/qualifier-typedef-array-v0.c \
> +test-abidiff-exit/qualifier-typedef-array-v0.o \
> +test-abidiff-exit/qualifier-typedef-array-v1.c \
> +test-abidiff-exit/qualifier-typedef-array-v1.o \
> +test-abidiff-exit/qualifier-typedef-array-report0.txt \
> +test-abidiff-exit/qualifier-typedef-array-report1.txt \
> +test-abidiff-exit/qualifier-typedef-array-report2.txt \
> +test-abidiff-exit/qualifier-typedef-array-report3.txt \
There actual name of the reference report files that are added by the
patch is qualifier-typedef-array-report-{0-3}.txt. Note the '-'
character before the {0-3}. I fixed that when applying the patch.
[...]
> * tests/data/Makefile.am: Add new test files
> * tests/data/test-abidiff-exit/qualifier-typedef-array-v0.c:
> New test file.
> * tests/data/test-abidiff-exit/qualifier-typedef-array-v0.o:
> New test file.
> * tests/data/test-abidiff-exit/qualifier-typedef-array-v1.c:
> New test file.
> * tests/data/test-abidiff-exit/qualifier-typedef-array-v1.o:
> New test file.
> * tests/data/test-abidiff-exit/qualifier-typedef-array-report-0.txt:
> Plain diff report.
> * tests/data/test-abidiff-exit/qualifier-typedef-array-report-1.txt:
> Harmless diff report.
> * tests/data/test-abidiff-exit/qualifier-typedef-array-report-2.txt:
> Leaf changes report.
> * tests/data/test-abidiff-exit/qualifier-typedef-array-report-3.txt:
> Harmless leaf changes report.
> * tests/test-abidiff-exit.cc: Run new test.
>
> Signed-off-by: Giuliano Procida <gprocida@google.com>
Applied to master.
Thanks!
[...]
Cheers,
--
Dodji
More information about the Libabigail
mailing list