(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
lib-39.c
       1  /* { dg-do run } */
       2  
       3  #include <stdio.h>
       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    unsigned char *h;
      14    void *d;
      15  
      16    h = (unsigned char *) malloc (N);
      17  
      18    for (i = 0; i < N; i++)
      19      {
      20        h[i] = i;
      21      }
      22  
      23    fprintf (stderr, "CheCKpOInT\n");
      24    d = acc_present_or_copyin (0, N);
      25    if (!d)
      26      abort ();
      27  
      28    memset (&h[0], 0, N);
      29  
      30    acc_copyout (h, N);
      31  
      32    for (i = 0; i < N; i++)
      33      {
      34        if (h[i] != i)
      35  	abort ();
      36      }
      37  
      38    free (h);
      39  
      40    return 0;
      41  }
      42  
      43  /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
      44  /* { dg-output "\\\[\[^\n\r]*,\\\+256\\\] is a bad range" } */
      45  /* { dg-shouldfail "" } */