2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / cris / sync-xchg-1.c
blob21bb7d4ffcfc3a103afdbbb3a287381a4d353853
1 /* Check that the basic library call variant is sane; no other calls, no
2 checks compares or branches. */
3 /* { dg-do compile } */
4 /* { dg-options "-O2 -munaligned-atomic-may-use-library" } */
5 /* { dg-final { scan-assembler-not "\tdi" } } */
6 /* { dg-final { scan-assembler-not "\tbtstq" } } */
7 /* { dg-final { scan-assembler-not "\tand" } } */
8 /* { dg-final { scan-assembler-not "\tclearf" } } */
9 /* { dg-final { scan-assembler-not "\tmove.d" } } */
10 /* { dg-final { scan-assembler-not "\tcmp" } } */
11 /* { dg-final { scan-assembler-not "\tb\[^s\]" } } */
12 /* { dg-final { scan-assembler-times "\t\[JjBb\]sr" 1 } } */
14 #ifndef type
15 #define type int
16 #endif
18 type svcsw (type *ptr, type oldval, type newval)
20 return __sync_val_compare_and_swap (ptr, oldval, newval);