aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/riscv/amo/zalrsc-ztso-compare-exchange-int-seq-cst-relaxed.c
blob: fc464ab1ff5391b579c23e8f7ea2d5eaa4a8dea5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* { dg-do compile } */
/* Verify that compare exchange mappings match the PSABI doc's recommended mapping.  */
/* Mixed mappings need to be unioned.  */
/* { dg-add-options riscv_zalrsc } */
/* { dg-add-options riscv_ztso } */
/* { dg-final { scan-assembler-times "lr.w.aqrl\t" 1 } } */
/* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */

void foo (int bar, int baz, int qux)
{
  __atomic_compare_exchange_n(&bar, &baz, qux, 1, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
}