Two of the new gcc.dg/atomic tests were failing to compile on Solaris 10+:
FAIL: gcc.dg/atomic/c11-atomic-exec-4.c -O0 (test for excess errors)
Excess errors:
/var/gcc/regression/trunk/10-gcc/build/gcc/include-fixed/sys/feature_tests.h:346:2:
error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications
and pre-2001 POSIX applications"
WARNING: gcc.dg/atomic/c11-atomic-exec-4.c -O0 compilation failed to produce
executable
<sys/feature_tests.h> has
#if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
and pre-2001 POSIX applications"
This doesn't happen on Solaris 9 which lacks C99 support in system
headers.
The following patch fixes this. Tested by the appropriate runtest
invocation on i386-pc-solaris2.10, ok for mainline?
Rainer
2013-11-13 Rainer Orth <[email protected]>
* gcc.dg/atomic/c11-atomic-exec-4.c: Define _XOPEN_SOURCE=600 on
*-*-solaris2.1[0-9]*.
* gcc.dg/atomic/c11-atomic-exec-5.c: Likewise.
# HG changeset patch
# Parent c636e28757231d8549c20a35a4cd3f94296082f5
Fix gcc.dg/atomic/c11-atomic-exec-[45].c tests on Solaris 10+
diff --git a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
--- a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
+++ b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
@@ -3,6 +3,7 @@
out in two threads. */
/* { dg-do run } */
/* { dg-options "-std=c11 -pedantic-errors -pthread -D_POSIX_C_SOURCE=200809L" } */
+/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } }
/* { dg-require-effective-target pthread } */
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
--- a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
+++ b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
@@ -4,6 +4,7 @@
get properly cleared). */
/* { dg-do run } */
/* { dg-options "-std=c11 -pedantic-errors -pthread -D_POSIX_C_SOURCE=200809L" } */
+/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } }
/* { dg-require-effective-target fenv_exceptions } */
/* { dg-require-effective-target pthread } */
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University