PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / backprop-5.c
blobe4f0f856ff6b09208db5e9a26bfe8d3b6e42e569
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) \
7 TYPE \
8 test##SUFFIX (TYPE x, TYPE y, TYPE *array, int n) \
9 { \
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" } } */