PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / var-expand1.c
blob3d536cef2b3f726bf70cca7ac4db32f4d8a7ef79
1 /* { dg-do compile } */
2 /* We don't (and don't want to) perform this optimisation on soft-float
3 targets, where each addition is a library call. */
4 /* { dg-require-effective-target hard_float } */
5 /* { dg-options "-O2 -funroll-loops --fast-math -fvariable-expansion-in-unroller -fdump-rtl-loop2_unroll" } */
6 /* { dg-additional-options "--param max-completely-peel-times=16 --param max-unroll-times=8" { target s390*-*-* } } */
8 extern void abort (void);
10 float array[30] = { 1,2,3,4,5,6,7,8,9,10 };
12 int foo (int n)
14 unsigned i;
15 float accum = 1.0;
17 for (i = 0; i < n; i++)
18 accum += array[i];
20 return accum;
23 int main (void)
25 return foo (10);
28 /* { dg-final { scan-rtl-dump "Expanding Accumulator" "loop2_unroll" } } */