summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-eqandshift-2.c
blob: 14ffb852dd4395f496ae7912d6c8337cb2214211 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* PR middle-end/14752 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-original" } */

void bar (void);

void foo (unsigned int a)
{
  if ((a >> 2) & 1)
    bar ();
}

void baz (unsigned int b)
{
  if ((~b >> 2) & 1)
    bar ();
}

/* { dg-final { scan-tree-dump-times "\\(a \& 4\\) != 0" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "\\(b \& 4\\) == 0" 1 "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */