Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/abs-2.c

raw
1 /* PR tree-optimization/49959 */
2 /* { dg-do compile } */
3 /* { dg-options "-O -fdump-tree-phiopt1-details" } */
4
5 #define ABS(X) (((X)>0)?(X):-(X))
6 unsigned long
7 test_abs(int *cur)
8 {
9 unsigned long sad = 0;
10 if (cur[0] > 0)
11 sad = cur[0];
12 else
13 sad = -cur[0];
14 return sad;
15 }
16
17 /* We should figure out that test_abs has an ABS_EXPR in it. */
18 /* { dg-final { scan-tree-dump " = ABS_EXPR" "phiopt1"} } */
19 /* { dg-final { scan-tree-dump-times "changed to factor operation out from" 1 "phiopt1"} } */
20