(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
lib-48.c
       1  /* Exercise acc_update_self with a size zero data mapping.  */
       2  
       3  /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
       4  
       5  #include <stdio.h>
       6  #include <string.h>
       7  #include <stdlib.h>
       8  #include <openacc.h>
       9  
      10  int
      11  main (int argc, char **argv)
      12  {
      13    const int N = 256;
      14    int i;
      15    unsigned char *h;
      16    void *d;
      17  
      18    h = (unsigned char *) malloc (N);
      19  
      20    for (i = 0; i < N; i++)
      21      {
      22        h[i] = i;
      23      }
      24  
      25    d = acc_copyin (h, N);
      26    if (!d)
      27      abort ();
      28  
      29    memset (&h[0], 0, N);
      30  
      31    fprintf (stderr, "CheCKpOInT\n");
      32    acc_update_self (h, 0);
      33  
      34    for (i = 0; i < N; i++)
      35      {
      36        if (h[i] != i)
      37  	abort ();
      38      }
      39  
      40    acc_delete (h, N);
      41  
      42    free (h);
      43  
      44    return 0;
      45  }
      46  
      47  /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
      48  /* { dg-output "\\\[\[0-9a-fA-FxX\]+,0\\\] is not mapped" } */
      49  /* { dg-shouldfail "" } */