Commit f10f4968 by Richard Henderson Committed by Richard Henderson

Update gcc.dg/atomic-flag.c test for non-boolean TAS targets.

        * gcc.dg/atomic-flag.c: Adjust for __GCC_ATOMIC_TEST_AND_SET_TRUEVAL.

From-SVN: r183583
parent e29137fe
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> 2012-01-26 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gfortran.dg/reassoc_4.f: Use dg-additional-options. * gfortran.dg/reassoc_4.f: Use dg-additional-options.
......
/* Test __atomic routines for existence and execution. */ /* Test __atomic routines for existence and execution. */
/* { dg-do run } */ /* { dg-do run } */
#include <stdbool.h>
/* Test that __atomic_test_and_set and __atomic_clear builtins execute. */ /* Test that __atomic_test_and_set and __atomic_clear builtins execute. */
extern void abort(void); extern void abort(void);
bool a; unsigned char a;
main () main ()
{ {
bool b; int b;
__atomic_clear (&a, __ATOMIC_RELAXED); __atomic_clear (&a, __ATOMIC_RELAXED);
if (a != 0) if (a != 0)
abort (); abort ();
b = __atomic_test_and_set (&a, __ATOMIC_SEQ_CST); 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 (); abort ();
b = __atomic_test_and_set (&a, __ATOMIC_ACQ_REL); 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 (); abort ();
__atomic_clear (&a, __ATOMIC_SEQ_CST); __atomic_clear (&a, __ATOMIC_SEQ_CST);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment