view libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.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-additional-options "-fipa-pta" } */

#include <stdlib.h>

#define N 2

int
main (void)
{
  unsigned int *a = (unsigned int *)malloc (N * sizeof (unsigned int));
  unsigned int *b = (unsigned int *)malloc (N * sizeof (unsigned int));
  unsigned int *c = (unsigned int *)malloc (N * sizeof (unsigned int));

#pragma acc kernels pcopyout (a[0:N], b[0:N], c[0:N])
  {
    a[0] = 0;
    b[0] = 1;
    c[0] = a[0];
  }

  if (a[0] != 0 || b[0] != 1 || c[0] != 0)
    abort ();

  free (a);
  free (b);
  free (c);
}