aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr70138-1.c
blob: e391e7651ba037233668b24f70efd4bc09aeaf0a (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
#include "tree-vect.h"

double u[33 * 33];

__attribute__((noinline, noclone)) static void
foo (int *x)
{
  double c = 0.0;
  int a, b;
  for (a = 0; a < 33; a++)
    {
      for (b = 0; b < 33; b++)
	c = c + u[34 * a];
      u[34 * a] *= 2.0;
    }
  *x = c;
}

int
main ()
{
  int d, e;
  check_vect ();
  for (d = 0; d < 33 * 33; d++)
    {
      u[d] = 499.0;
      __asm__ volatile ("" : : : "memory");
    }
  for (d = 0; d < 33; d++)
    {
      u[d * 34] = (d + 2);
      __asm__ volatile ("" : : : "memory");
    }
  foo (&e);
  if (e != 33 * (2 + 34) / 2 * 33)
    __builtin_abort ();
  return 0;
}