| 1 |
/* { dg-do compile } */ |
| 2 |
/* Verify that compare exchange mappings match the PSABI doc's recommended mapping. */ |
| 3 |
/* Mixed mappings need to be unioned. */ |
| 4 |
/* { dg-add-options riscv_zalrsc } */ |
| 5 |
/* { dg-add-options riscv_ztso } */ |
| 6 |
/* { dg-remove-options riscv_zacas } */ |
| 7 |
/* { dg-final { scan-assembler-times "lr.w.aqrl\t" 1 } } */ |
| 8 |
/* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */ |
| 9 |
|
| 10 |
void foo (int bar, int baz, int qux) |
| 11 |
{ |
| 12 |
__atomic_compare_exchange_n(&bar, &baz, qux, 1, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED); |
| 13 |
} |