aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr34195.c
blob: e36950ba4295308fc8f609c01ad25a9e70cf3ac3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* { dg-do compile } */
/* { dg-require-effective-target vect_float } */

#define M 11

struct S
{
  float x;
  float y;
} pS[100];

float a[1000];
float b[1000];

void
foo (int n)
{
  int i, j;

  for (i = 0; i < n; i++)
    {
      pS[i].x = 0;
      pS[i].y = 0;

      for (j = 0; j < M; j++)
        {
          pS[i].x += (a[i]+b[i]);
          pS[i].y += (a[i]-b[i]);
        }
    }
}

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