PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / andor-5.c
blob15097272a1d3614e8d694cd74d47ce30f8d7a223
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 int f(int y, int x)
6 int a = x | y;
7 return a & x;
9 int f1(int y, int x)
11 int a = y | x;
12 return a & x;
14 int f2(int y, int x)
16 int a = x | y;
17 return x & a;
19 int f3(int y, int x)
21 int a = x | y;
22 return x & a;
24 int f4(int y, int x)
26 int a = x & y;
27 return a | x;
29 int f5(int y, int x)
31 int a = y & x;
32 return a | x;
34 int f6(int y, int x)
36 int a = x & y;
37 return x | a;
39 int f7(int y, int x)
41 int a = x & y;
42 return x | a;
44 /* These all should be optimized to just return x; */
47 /* { dg-final { scan-tree-dump-times "\\\|" 0 "optimized" } } */
48 /* { dg-final { scan-tree-dump-times "\&" 0 "optimized" } } */
49 /* { dg-final { scan-tree-dump-times "return x_..D.;" 8 "optimized" } } */
50 /* { dg-final { cleanup-tree-dump "optimized" } } */