Debian Codegraph @

gcc/testsuite/gcc.target/riscv/amo/zacas-rvwmo-compare-exchange-char-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_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\.b\.rl\t" 2 } } */
10
11
12 void atomic_compare_exchange_weak_char_release (char *bar, char *baz, char qux)
13 {
14 __atomic_compare_exchange_n(bar, baz, qux, 0, __ATOMIC_RELEASE, __ATOMIC_RELAXED);
15 }
16
17 void atomic_compare_exchange_strong_char_release (char *bar, char *baz, char qux)
18 {
19 __atomic_compare_exchange_n(bar, baz, qux, 1, __ATOMIC_RELEASE, __ATOMIC_RELAXED);
20 }