summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr46091-4.c
blob: f88ff5e4b437911df7276d79a07d8253a7368947 (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
30
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-additional-options "-mregparm=2" { target ia32 } } */

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

  return x;
}

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

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

  return x;
}

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

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

  return x;
}

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