aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/riscv/amo/amo-table-ztso-amo-add-4.c
blob: 0b3a7e5968965f21ad8164354092d685c183643f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* Verify that atomic op mappings match the Ztso suggested mapping.  */
/* { dg-options "-O3" } */
/* { dg-add-options riscv_zaamo } */
/* { dg-add-options riscv_ztso } */
/* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
/* { dg-final { check-function-bodies "**" "" } } */

/*
** foo:
**	amoadd\.w\tzero,a1,0\(a0\)
**	ret
*/
void foo (int* bar, int baz)
{
  __atomic_add_fetch(bar, baz, __ATOMIC_ACQ_REL);
}