1 /* { dg-do compile } */
2 /* { dg-options "-O -g -fdump-tree-backprop-details" } */
4 /* Test a loop that does both a multiplication and addition. The addition
5 should prevent any sign ops from being removed. */
6 #define TEST_FUNCTION(TYPE, SUFFIX) \
8 test##SUFFIX (TYPE x, TYPE y, TYPE *array, int n) \
10 x = __builtin_copysign##SUFFIX (x, y); \
11 for (int i = 0; i < n; ++i) \
12 x = (x + 1) * array[i]; \
13 return __builtin_hypot##SUFFIX (x, y); \
16 TEST_FUNCTION (float, f
)
17 TEST_FUNCTION (double, )
18 TEST_FUNCTION (long double, l
)
20 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = __builtin_copysign} 0 "backprop" } } */