Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr102566-10b.c

raw
1 /* { dg-do compile { target { ! ia32 } } } */
2 /* { dg-options "-O2" } */
3
4 #include <stdatomic.h>
5 #include <stdbool.h>
6
7 bool
8 foo (_Atomic long long int *v, int bit)
9 {
10 long long int mask = 1ll << bit;
11 return atomic_fetch_and_explicit (v, ~mask, memory_order_relaxed) & mask;
12 }
13
14 /* { dg-final { scan-assembler-times "lock;?\[ \t\]*btrq" 1 } } */
15 /* { dg-final { scan-assembler-not "cmpxchg" } } */