| 1 |
/* PR target/96176 */ |
| 2 |
/* { dg-do compile { target lp64 } } */ |
| 3 |
/* { dg-options "-Os" } */ |
| 4 |
/* { dg-final { scan-assembler-not "\tcmpb\t" } } */ |
| 5 |
|
| 6 |
_Bool |
| 7 |
foo (short *x, short z) |
| 8 |
{ |
| 9 |
short y = 0; |
| 10 |
__atomic_compare_exchange_n (x, &y, z, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); |
| 11 |
return y == 0; |
| 12 |
} |
| 13 |
|
| 14 |
/* { dg-final { scan-assembler-not "\ttestw\t" } } */ |
| 15 |
|
| 16 |
_Bool |
| 17 |
bar (short *x, short z) |
| 18 |
{ |
| 19 |
short y = -1; |
| 20 |
__atomic_compare_exchange_n (x, &y, z, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); |
| 21 |
return y == -1; |
| 22 |
} |
| 23 |
|
| 24 |
/* { dg-final { scan-assembler-not "\tincw\t" } } */ |