view gcc/testsuite/gcc.dg/vect/pr60196-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR tree-optimization/63189 */
/* { dg-additional-options "-fwrapv" } */

#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;
}