aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr46091-5.c
blob: 301702991048e089880419993cd3b47c421cb61d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* { dg-do compile { target { ! ia32 } } } */
/* { dg-options "-O2" } */

long test_1 (long x, int n)
{
  x &= ~((long)0x01 << n);

  return x;
}

/* { dg-final { scan-assembler "btr" } } */

long test_2 (long x, int n)
{
  x |= ((long)0x01 << n);

  return x;
}

/* { dg-final { scan-assembler "bts" } } */

long test_3 (long x, int n)
{
  x ^= ((long)0x01 << n);

  return x;
}

/* { dg-final { scan-assembler "btc" } } */