1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-backprop-details" } */
7 /* Test that we optimize the contents of infinite loops. */
8 #define TEST_FUNCTION(TYPE, SUFFIX) \
10 test##SUFFIX (TYPE *array, TYPE y, int n) \
15 TYPE x = -__builtin_fabs##SUFFIX (array[-1]); \
16 for (int i = 0; i < n; ++i) \
19 array[-2] = __builtin_fma##SUFFIX (x, x, y); \
20 array[-3] = __builtin_pow##SUFFIX (x, 20); \
25 TEST_FUNCTION (float, f
)
26 TEST_FUNCTION (double, )
27 TEST_FUNCTION (long double, l
)
29 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = -} 6 "backprop" } } */
30 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = ABS_EXPR <} 3 "backprop" } } */