(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
lib-94.c
       1  /* { dg-do run } */
       2  /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
       3  
       4  #include <string.h>
       5  #include <stdlib.h>
       6  #include <openacc.h>
       7  
       8  int
       9  main (int argc, char **argv)
      10  {
      11    const int N = 256;
      12    int i;
      13    int async = 8;
      14    unsigned char *h;
      15  
      16    h = (unsigned char *) malloc (N);
      17  
      18    for (i = 0; i < N; i++)
      19      {
      20        h[i] = i;
      21      }
      22  
      23    acc_copyin_async (h, N, async);
      24  
      25    acc_wait (async);
      26  
      27    memset (h, 0, N);
      28  
      29    acc_copyout_async (h, N, async + 1);
      30  
      31    acc_wait (async + 1);
      32  
      33    for (i = 0; i < N; i++)
      34      {
      35        if (h[i] != i)
      36  	abort ();
      37      }
      38  
      39    free (h);
      40  
      41    return 0;
      42  }