view gcc/testsuite/gcc.dg/vect/pr92558.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

/* { dg-additional-options "-mavx2" { target avx2_runtime } } */

void __attribute__((noipa))
foo (int * __restrict wsum, int * __restrict cff, int * __restrict weight)
{
  for (int i = 0; i < 16; ++i)
    {
      *wsum += weight[2*i+0];
      *cff += weight[2*i+1];
    }
}

int main()
{
  int weight[32];
  for (int i = 0; i < 32; ++i)
    weight[i] = i;
  int wsum = 0, cff = 0;
  foo (&wsum, &cff, weight);
  if (wsum != 240 || cff != 256)
    __builtin_abort ();
  return 0;
}