analyzer: testsuite fixes for alloca, getpass, and setjmp (PR 93316)
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 22 Jan 2020 01:45:48 +0000 (02:45 +0100)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 22 Jan 2020 19:32:08 +0000 (14:32 -0500)
commitda7cf663b75513e4d2baf5a579ffcb4f8a61193b
tree5fb82464d04b69b8a4e59890b1be504daf6d6f2e
parent75038aa6aa5b562e6358108619d66ef2ccab9a53
analyzer: testsuite fixes for alloca, getpass, and setjmp (PR 93316)

PR analyzer/93316 reports various testsuite failures where I
accidentally relied on properties of x86_64-pc-linux-gnu.

The following patch fixes them on sparc-sun-solaris2.11 (gcc211 in the
GCC compile farm), and, I hope, the other configurations showing
failures.

There may still be other failures for pattern-test-2.c, which I'm
tracking separately as PR analyzer/93291.

gcc/analyzer/ChangeLog:
PR analyzer/93316
* analyzer.cc (is_setjmp_call_p): Check for "setjmp" as well as
"_setjmp".

gcc/testsuite/ChangeLog:
PR analyzer/93316
* gcc.dg/analyzer/data-model-1.c: Include <alloca.h>.
* gcc.dg/analyzer/malloc-1.c: Likewise.
* gcc.dg/analyzer/malloc-callbacks.c (get_alloca): Return
__builtin_alloca rather than alloca.
* gcc.dg/analyzer/malloc-paths-8.c: Include <alloca.h>.
* gcc.dg/analyzer/sensitive-1.c: Define __EXTENSIONS__ before
including unistd.h.
* gcc.dg/analyzer/setjmp-2.c: Replace include of <setjmp.h>
with "test-setjmp.h" and usage of setjmp with new SETJMP macro.
* gcc.dg/analyzer/setjmp-3.c: Likewise.
* gcc.dg/analyzer/setjmp-4.c: Likewise.
* gcc.dg/analyzer/setjmp-5.c: Likewise.
* gcc.dg/analyzer/setjmp-6.c: Likewise.
* gcc.dg/analyzer/setjmp-7.c: Likewise.
* gcc.dg/analyzer/setjmp-7a.c: Likewise.
* gcc.dg/analyzer/setjmp-8.c: Likewise.
* gcc.dg/analyzer/setjmp-9.c: Likewise.
* gcc.dg/analyzer/test-setjmp.h: New header.
18 files changed:
gcc/analyzer/ChangeLog
gcc/analyzer/analyzer.cc
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/analyzer/data-model-1.c
gcc/testsuite/gcc.dg/analyzer/malloc-1.c
gcc/testsuite/gcc.dg/analyzer/malloc-callbacks.c
gcc/testsuite/gcc.dg/analyzer/malloc-paths-8.c
gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
gcc/testsuite/gcc.dg/analyzer/setjmp-2.c
gcc/testsuite/gcc.dg/analyzer/setjmp-3.c
gcc/testsuite/gcc.dg/analyzer/setjmp-4.c
gcc/testsuite/gcc.dg/analyzer/setjmp-5.c
gcc/testsuite/gcc.dg/analyzer/setjmp-6.c
gcc/testsuite/gcc.dg/analyzer/setjmp-7.c
gcc/testsuite/gcc.dg/analyzer/setjmp-7a.c
gcc/testsuite/gcc.dg/analyzer/setjmp-8.c
gcc/testsuite/gcc.dg/analyzer/setjmp-9.c
gcc/testsuite/gcc.dg/analyzer/test-setjmp.h [new file with mode: 0644]