(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
acc_map_data-device_already-3.c
       1  /* Verify that we refuse 'acc_map_data' when the "device address [...] is
       2     already mapped".  */
       3  
       4  /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
       5  
       6  #include <assert.h>
       7  #include <stdio.h>
       8  #include <openacc.h>
       9  
      10  double global_var;
      11  #pragma acc declare create (global_var)
      12  
      13  int
      14  main ()
      15  {
      16    double var;
      17    void *d = acc_deviceptr (&global_var);
      18    assert (d);
      19    /* Try to arrange a setting such that a later 'acc_unmap_data' would find the
      20       device memory object still referenced elsewhere.  This is not possible,
      21       given the semantics of 'acc_map_data'.  */
      22    fprintf (stderr, "CheCKpOInT\n");
      23    acc_map_data (&var, d, sizeof var);
      24  
      25    return 0;
      26  }
      27  
      28  
      29  /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
      30  /* { dg-output "device address \\\[\[0-9a-fA-FxX\]+, \\\+8\\\] is already mapped" { xfail *-*-* } } TODO PR92888 */
      31  /* { dg-shouldfail "TODO PR92888" { this-really-should-fail } } */