Debian Codegraph @

gcc/testsuite/gcc.target/riscv/amo/zacas-rvwmo-compare-exchange-short-acquire.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_zabha } */
5 /* { dg-add-options riscv_zacas } */
6 /* { dg-remove-options riscv_ztso } */
7 /* { dg-final { scan-assembler-not "\tlr\.w" } } */
8 /* { dg-final { scan-assembler-not "\tsc\.w" } } */
9 /* { dg-final { scan-assembler-times "amocas\.h\.aq\t" 2 } } */
10
11
12 void atomic_compare_exchange_weak_short_acquire (short *bar, short *baz, short qux)
13 {
14 __atomic_compare_exchange_n(bar, baz, qux, 0, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE);
15 }
16
17 void atomic_compare_exchange_strong_short_acquire (short *bar, short *baz, short qux)
18 {
19 __atomic_compare_exchange_n(bar, baz, qux, 1, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE);
20 }