aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-outer-call-1.c
blob: f26d422053206730c63a2f2d214ad249fcd822f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile } */
/* { dg-require-effective-target vect_float } */
/* { dg-additional-options "-fno-math-errno" } */

void
foo (float * __restrict x, float *y, int n, int m)
{
  if (m > 0)
    for (int i = 0; i < n; ++i)
      {
	float tem = x[i], tem1;
	for (int j = 0; j < m; ++j)
	  {
	    tem += y[j];
	    tem1 = tem;
	    tem = __builtin_sqrtf (tem);
	  }
	x[i] = tem - tem1;
      }
}

/* { dg-final { scan-tree-dump "OUTER LOOP VECTORIZED" "vect" { target { vect_call_sqrtf } } } } */