]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/atomic-store-3.c
1 /* Test __atomic routines for existence and proper execution on 4 byte
2 values with each valid memory model. */
4 /* { dg-require-effective-target sync_int_long } */
6 /* Test the execution of the __atomic_store_n builtin for an int. */
8 extern void abort(void);
18 __atomic_store_n (&v
, count
+ 1, __ATOMIC_RELAXED
);
22 __atomic_store_n (&v
, count
+ 1, __ATOMIC_RELEASE
);
26 __atomic_store_n (&v
, count
+ 1, __ATOMIC_SEQ_CST
);
30 /* Now test the generic variant. */
33 __atomic_store (&v
, &count
, __ATOMIC_RELAXED
);
37 __atomic_store (&v
, &count
, __ATOMIC_RELEASE
);
41 __atomic_store (&v
, &count
, __ATOMIC_SEQ_CST
);