]> git.ipfire.org Git - thirdparty/gcc.git/commit
analyzer: avoid relying on system <assert.h> in testsuite (PR 93367)
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 23 Jan 2020 22:46:12 +0000 (17:46 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 24 Jan 2020 01:47:34 +0000 (20:47 -0500)
commita0b935ac66bc9804b0864151e5f1bfde5ac1ddeb
tree162e8a14cf0e4b482bf62521ec94e7179393820d
parent472dc648ce3e7661762931d584d239611ddca964
analyzer: avoid relying on system <assert.h> in testsuite (PR 93367)

PR analyzer/93367 reports a testsuite failure in abort.c on
hppa64-hp-hpux11.11 when detecting if the analyzer "knows" that the
condition holds after the assert.

The root cause is that the assertion failure function in that
configuration's <assert.h> is not marked with
__attribute__ ((__noreturn__)).

This patch reworks the test to avoid <assert.h> in favor of a custom
implementation of assert, so that the test demonstrates the idea without
relying on properties of <assert.h>.

gcc/testsuite/ChangeLog:
PR analyzer/93367
* gcc.dg/analyzer/abort.c: Remove include of <assert.h>.
Replace use of assert with a custom assertion implementation.
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/analyzer/abort.c