libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / abs-2.c
blobf8bbeb43237320c35533fab2904d0705e93e2b63
1 /* PR tree-optimization/49959 */
2 /* { dg-do compile } */
3 /* { dg-options "-O -fdump-tree-phiopt1-details" } */
5 #define ABS(X) (((X)>0)?(X):-(X))
6 unsigned long
7 test_abs(int *cur)
9 unsigned long sad = 0;
10 if (cur[0] > 0)
11 sad = cur[0];
12 else
13 sad = -cur[0];
14 return sad;
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"} } */