From patchwork Fri Mar 25 15:27:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [testsuite] Fix gcc.dg/torture/pr47917.c on IRIX 6.5 From: Rainer Orth X-Patchwork-Id: 88389 Message-Id: To: gcc-patches@gcc.gnu.org Date: Fri, 25 Mar 2011 16:27:08 +0100 The new gcc.dg/torture/pr47917.c test currently fails the execution test on IRIX 6.5. To get a C99-conformant snprintf, one needs to include with _XOPEN_SOURCE defined as 500. The following patch does this. Tested with the appropriate runtest invocations on mips-sgi-irix6.5 and i386-pc-solaris2.11. Ok for mainline? Rainer 2011-03-25 Rainer Orth * gcc.dg/torture/pr47917.c: Add -D_XOPEN_SOURCE=500 to dg-options for mips-sgi-irix6.5. Replace snprintf prototype by . diff -r b835af6cfe0b gcc/testsuite/gcc.dg/torture/pr47917.c --- a/gcc/testsuite/gcc.dg/torture/pr47917.c Thu Mar 24 20:35:54 2011 +0100 +++ b/gcc/testsuite/gcc.dg/torture/pr47917.c Fri Mar 25 16:21:55 2011 +0100 @@ -1,11 +1,12 @@ /* { dg-do run } */ /* { dg-options "-std=c99" } */ +/* { dg-options "-std=c99 -D_XOPEN_SOURCE=500" { target mips-sgi-irix6.5 } } */ /* { dg-xfail-if "no C99 snprintf function" { *-*-hpux10* } } */ /* { dg-xfail-run-if "non-conforming C99 snprintf" { *-*-hpux11.[012]* } } */ /* PR middle-end/47917 */ -extern int snprintf (char *, __SIZE_TYPE__, const char *, ...); +#include extern int memcmp (const void *, const void *, __SIZE_TYPE__); extern void abort (void);