(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
lib-20.c
       1  /* Exercise acc_copyin and acc_copyout.  */
       2  
       3  /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
       4  
       5  #include <stdio.h>
       6  #include <stdlib.h>
       7  #include <openacc.h>
       8  
       9  int
      10  main (int argc, char **argv)
      11  {
      12    const int N = 256;
      13    int i;
      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    (void) acc_copyin (h, N);
      24  
      25    fprintf (stderr, "CheCKpOInT\n");
      26    acc_copyout (h, N + 1);
      27  
      28    free (h);
      29  
      30    return 0;
      31  }
      32  
      33  /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
      34  /* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+257\\\] outside mapped block \\\[\[0-9a-fA-FxX\]+,\\\+256\\\]" } */
      35  /* { dg-shouldfail "" } */