aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60196-1.c
blob: 10ed4afebdfb70e216c4b72493f7741e55ed9e6e (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
/* PR tree-optimization/63189 */
/* { dg-additional-options "-fwrapv" } */
/* { dg-do run } */

#include "tree-vect.h"

__attribute__((noinline, noclone)) static int
bar (const short *a, int len)
{
  int x;
  int x1 = 0;

  for (x = 0; x < len; x++)
    x1 += x * a[x];
  return x1;
}

__attribute__((noinline, noclone)) void
foo (void)
{
  short stuff[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1 };
  if (bar (stuff, 9) != 36)
    abort ();
}

int
main ()
{
  check_vect ();
  foo ();
  return 0;
}

/* { dg-final { cleanup-tree-dump "vect" } } */