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
This commit is contained in:
parent
e29137fe36
commit
f10f496896
2 changed files with 8 additions and 6 deletions
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue