(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
acc_free-pr92503-4.c
       1  /* Verify that we refuse 'acc_free', inside 'data'.  */
       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 ()
      11  {
      12    const int N = 108;
      13  
      14    char *h = (char *) malloc (N);
      15  #pragma acc data create (h[0:N - 21])
      16    {
      17      void *d = acc_deviceptr (h);
      18      if (!d)
      19        abort ();
      20  
      21      fprintf (stderr, "CheCKpOInT\n");
      22      acc_free (d);
      23    }
      24  
      25    return 0;
      26  }
      27  
      28  /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" }
      29     { dg-output "refusing to free device memory space at \[0-9a-fA-FxX\]+ that is still mapped at \\\[\[0-9a-fA-FxX\]+,\\\+87\\\]" }
      30     { dg-shouldfail "" } */