public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 2/2] testsuite: Fix analyzer errors for newlib-fd
@ 2023-02-28 18:49 Hans-Peter Nilsson
  2023-02-28 19:13 ` David Malcolm
  0 siblings, 1 reply; 2+ messages in thread
From: Hans-Peter Nilsson @ 2023-02-28 18:49 UTC (permalink / raw)
  To: gcc-patches; +Cc: dmalcolm

Ok to commit?  (After this, there's
gcc.dg/analyzer/flex-without-call-summaries.c left to do.)

-- >8 --
Investigating analyzer testsuite errors for cris-elf.  The same are
seen for pru-elf according to posts to gcc-testresults@.

The test fd-access-mode-target-headers.c uses the analyzer
"sm-fd" which for this use requires (e.g.) that constants
O_ACCMODE, O_RDONLY and O_WRONLY are defined as literal
constants.  While for glibc, O_ACCMODE is defined as:
 #define O_ACCMODE 0003
in newlib, it's defined as:
 #define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
and the analyzer is not able to make use of an expression
like this (even though O_RDONLY, O_WRONLY and O_RDWR are
defined as literal constants and the whole evaluates to 3).
Better do as for AIX and skip this test.

testsuite:
	* gcc.dg/analyzer/fd-access-mode-target-headers.c: Skip for
	newlib targets too.
---
 gcc/testsuite/gcc.dg/analyzer/fd-access-mode-target-headers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-access-mode-target-headers.c b/gcc/testsuite/gcc.dg/analyzer/fd-access-mode-target-headers.c
index 847d47e06342..cf273b217d17 100644
--- a/gcc/testsuite/gcc.dg/analyzer/fd-access-mode-target-headers.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-access-mode-target-headers.c
@@ -1,4 +1,4 @@
-/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { powerpc*-*-aix* || newlib } } */
 
 #include <sys/stat.h>
 #include <fcntl.h>
-- 
2.30.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] testsuite: Fix analyzer errors for newlib-fd
  2023-02-28 18:49 [PATCH 2/2] testsuite: Fix analyzer errors for newlib-fd Hans-Peter Nilsson
@ 2023-02-28 19:13 ` David Malcolm
  0 siblings, 0 replies; 2+ messages in thread
From: David Malcolm @ 2023-02-28 19:13 UTC (permalink / raw)
  To: Hans-Peter Nilsson, gcc-patches

On Tue, 2023-02-28 at 19:49 +0100, Hans-Peter Nilsson wrote:
> Ok to commit? 

OK


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-28 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 18:49 [PATCH 2/2] testsuite: Fix analyzer errors for newlib-fd Hans-Peter Nilsson
2023-02-28 19:13 ` David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).