Update gcc.dg/atomic-flag.c test for non-boolean TAS targets.
authorRichard Henderson <rth@redhat.com>
Thu, 26 Jan 2012 22:01:17 +0000 (14:01 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 26 Jan 2012 22:01:17 +0000 (14:01 -0800)
        * gcc.dg/atomic-flag.c: Adjust for __GCC_ATOMIC_TEST_AND_SET_TRUEVAL.

From-SVN: r183583

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/atomic-flag.c

index d9744f536d1d0bfdea659426207e0c71839e1721..21dfd9151e9a803dae449eed1ca84caa562f65d1 100644 (file)
@@ -1,3 +1,7 @@
+2012-01-27  Richard Henderson  <rth@redhat.com>
+
+       * gcc.dg/atomic-flag.c: Adjust for __GCC_ATOMIC_TEST_AND_SET_TRUEVAL.
+
 2012-01-26  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        * gfortran.dg/reassoc_4.f: Use dg-additional-options.
index 771df2c6091eb4cba220e71e91a3750fc22f3f88..1b768326188412690bd76ce74a5b57fd9dc0d451 100644 (file)
@@ -1,27 +1,25 @@
 /* Test __atomic routines for existence and execution.  */
 /* { dg-do run } */
 
-#include <stdbool.h>
-
 /* Test that __atomic_test_and_set and __atomic_clear builtins execute.  */
 
 extern void abort(void);
-bool a;
+unsigned char a;
 
 main ()
 {
-  bool b;
+  int b;
 
   __atomic_clear (&a, __ATOMIC_RELAXED);
   if (a != 0)
     abort ();
 
   b = __atomic_test_and_set (&a, __ATOMIC_SEQ_CST);
-  if (a != 1 || b != 0)
+  if (a != __GCC_ATOMIC_TEST_AND_SET_TRUEVAL || b != 0)
     abort ();
 
   b = __atomic_test_and_set (&a, __ATOMIC_ACQ_REL);
-  if (b != 1 || a != 1)
+  if (a != __GCC_ATOMIC_TEST_AND_SET_TRUEVAL || b != 1)
     abort ();
 
   __atomic_clear (&a, __ATOMIC_SEQ_CST);