Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/pr78056-3.c

raw
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-aix* } } */
3 /* { dg-options "-mdejagnu-cpu=power7" } */
4 /* { dg-require-effective-target powerpc_altivec } */
5
6 /* This test should succeed on both 32- and 64-bit configurations. */
7 #include <altivec.h>
8
9 /* Test for the byte atomic operations on power8 using lbarx/stbcx. */
10 __attribute__((target("cpu=power8")))
11 char
12 char_fetch_add_relaxed (char *ptr, int value)
13 {
14 return __atomic_fetch_add (ptr, value, __ATOMIC_RELAXED);
15 }
16
17 /* { dg-final { scan-assembler-times "lbarx" 1 } } */