1 /* { dg-do compile } */
2 /* { dg-options "-O -g -fdump-tree-backprop-details" } */
4 /* Test a simple case of non-looping code in which both uses ignore
5 the sign and both definitions are sign ops. */
6 #define TEST_FUNCTION(TYPE, SUFFIX) \
8 test##SUFFIX (TYPE x, int sel1, int sel2) \
10 TYPE input = sel1 ? -x : __builtin_fabs##SUFFIX (x); \
12 return __builtin_cos##SUFFIX (input); \
14 return __builtin_cosh##SUFFIX (input); \
17 TEST_FUNCTION (float, f
)
18 TEST_FUNCTION (double, )
19 TEST_FUNCTION (long double, l
)
21 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = -x} 3 "backprop" } } */
22 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = ABS_EXPR <x} 3 "backprop" } } */