aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/andor-4.c
blob: 172c29e8b712f86c02059cf5a8ee68750bdf60e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-options "-O2 -fno-ipa-icf -fdump-tree-optimized" } */

int f(int y, int x)
{
  return x | ((~x) & y);
}
int f1(int y, int x)
{
  return x | (y & (~x));
}
int f2(int y, int x)
{
  return ((~x) & y) | x;
}
int f3(int y, int x)
{
  return (y & (~x)) | x;
}


/* { dg-final { scan-tree-dump-times "~x" 0 "optimized" } } */
/* { dg-final { scan-tree-dump-times "x_..D. \\\| y_..D." 4 "optimized" } } */