view libgomp/testsuite/libgomp.oacc-c-c++-common/combined-reduction.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

/* Test a combined acc parallel loop reduction.  */

/* { dg-do run } */

#include <assert.h>

int
main ()
{
  int i, v1 = 0, v2 = 0, n = 100;

#pragma acc parallel loop reduction(+:v1, v2)
  for (i = 0; i < n; i++)
    {
      v1++;
      v2++;
    }

  assert (v1 == n);
  assert (v2 == n);

  return 0;
}