(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
lib-15.c
       1  /* Check acc_is_present and acc_copyout.  */
       2  
       3  /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
       4  
       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    unsigned char *h;
      14  
      15    h = (unsigned char *) malloc (N);
      16  
      17    for (i = 0; i < N; i++)
      18      {
      19        h[i] = i;
      20      }
      21  
      22    (void) acc_copyin (h, N);
      23  
      24    acc_copyout (h, N);
      25  
      26    for (i = 0; i < N; i++)
      27      {
      28        if (acc_is_present (h + i, 1) != 0)
      29  	abort ();
      30      }
      31  
      32    free (h);
      33  
      34    return 0;
      35  }