view libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c @ 143:76e1cf5455ef

add cbc_gc test
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:24:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do run } */

int
main(void)
{
#define I 5
#define N 32
#define A 8

  int a = A;
  int s = I;

#pragma acc parallel vector_length(N) copy(s)
  {
    int i;
#pragma acc loop reduction(+:s)
    for (i = 0; i < N; ++i)
      s += a;
  }

  if (s != I + N * A)
    __builtin_abort();

  return 0;
}