Debian Codegraph @

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

raw
1 /* Verify that atomic op mappings match the PSABI doc's recommended mapping. */
2 /* { dg-do compile } */
3 /* { dg-options "-O3" } */
4 /* { dg-add-options riscv_zacas } */
5 /* { dg-remove-options riscv_ztso } */
6 /* { dg-final { scan-assembler-not "\tlr\.w" } } */
7 /* { dg-final { scan-assembler-not "\tsc\.w" } } */
8 /* { dg-final { scan-assembler-times "amocas\.w\.rl\t" 2 } } */
9
10
11 void atomic_compare_exchange_weak_int_release (int *bar, int *baz, int qux)
12 {
13 __atomic_compare_exchange_n(bar, baz, qux, 0, __ATOMIC_RELEASE, __ATOMIC_RELAXED);
14 }
15
16 void atomic_compare_exchange_strong_int_release (int *bar, int *baz, int qux)
17 {
18 __atomic_compare_exchange_n(bar, baz, qux, 1, __ATOMIC_RELEASE, __ATOMIC_RELAXED);
19 }