aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr80815-2.c
blob: 3ffff0be3be96df4c3e6a3d5caa68b7d4b6bad9a (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* { dg-require-effective-target vect_int } */

#include "tree-vect.h"
int arr[2048];
int res[100] = { 13198, 13224, 12735, 12760, 12270, 12294,
		 11803, 11826, 11334, 11356, 10863, 10884,
		 10390, 10410, 9915, 9934, 9438, 9456,
		 8959, 8976, 8478, 8494, 7995, 8010,
		 7510, 7524, 7023, 7036, 6534, 6546,
		 6043, 6054, 5550, 5560, 5055, 5064,
		 4558, 4566, 4059, 4066, 3558, 3564,
		 3055, 3060, 2550, 2554, 2043, 0};

__attribute__ ((noinline)) int
foo (int *a, int *b)
{
  int i;
  int *a1 = a;
  int *a0 = a1 - 512;
  for (i = 0; i < 50; i++)
    {
      *b = *a0 + *a1;
      b--;
      a0--;
      a1--;
    }
  return 0;
}

int main (void)
{
  int *a = &arr[1024];
  int *b = &arr[1022];

  int i;
  for (i = 0; i < 2048; i++)
    arr[i] = i;

  foo (a, b);

#pragma GCC novector
  for (i = 973; i < 1020; i++)
    if (arr[i] != res[i - 973])
      abort ();

  return 0;
}