(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
pr102566-9b.c
       1  /* { dg-do compile { target { ! ia32 } } } */
       2  /* { dg-options "-O2" } */
       3  
       4  #include <stdatomic.h>
       5  #include <stdbool.h>
       6  
       7  bool
       8  foo0 (_Atomic long long *v)
       9  {
      10  #define BIT (1ll << 0)
      11    return !(atomic_fetch_and_explicit (v, ~BIT, memory_order_relaxed) & BIT);
      12  #undef BIT
      13  }
      14  
      15  bool
      16  foo30 (_Atomic long long *v)
      17  {
      18  #define BIT (1ll << 62)
      19    return !(atomic_fetch_and_explicit (v, ~BIT, memory_order_relaxed) & BIT);
      20  #undef BIT
      21  }
      22  
      23  bool
      24  foo31 (_Atomic long long *v)
      25  {
      26  #define BIT (1ll << 63)
      27    return !(atomic_fetch_and_explicit (v, ~BIT, memory_order_relaxed) & BIT);
      28  #undef BIT
      29  }
      30  
      31  /* { dg-final { scan-assembler-times "lock;?\[ \t\]*btrq" 3 } } */
      32  /* { dg-final { scan-assembler-not "cmpxchg" } } */