Debian Codegraph @

gcc/testsuite/gcc.target/riscv/amo/zalrsc-rvwmo-compare-exchange-int-acquire-release.c

raw
1 /* { dg-do compile } */
2 /* Verify that compare exchange mappings match the PSABI doc's recommended mapping. */
3 /* { dg-add-options riscv_zalrsc } */
4 /* { dg-remove-options riscv_ztso } */
5 /* { dg-remove-options riscv_zacas } */
6 /* Mixed mappings need to be unioned. */
7 /* { dg-final { scan-assembler-times "lr.w.aq\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_RELEASE, __ATOMIC_ACQUIRE);
13 }