| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O -fdump-tree-gimple -fdump-tree-optimized" } */ |
| 3 |
|
| 4 |
int f(int a){ |
| 5 |
int b = -__INT_MAX__-1; |
| 6 |
a &= b; |
| 7 |
return a == b; |
| 8 |
} |
| 9 |
int g(int x){ |
| 10 |
x = x < 0 ? -x : x; |
| 11 |
return x == 0; |
| 12 |
} |
| 13 |
|
| 14 |
/* This should work even if int is not 32 bits, it is just not meaningful in |
| 15 |
that case. */ |
| 16 |
/* { dg-final { scan-tree-dump-not "-2147483648" "optimized"} } */ |
| 17 |
/* { dg-final { scan-tree-dump " < 0" "optimized"} } */ |
| 18 |
/* { dg-final { scan-tree-dump "ABS_EXPR" "gimple"} } */ |
| 19 |
/* { dg-final { scan-tree-dump-not "ABS_EXPR" "optimized"} } */ |