(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.oacc-c-c++-common/
acc_map_data-host_already-1.c
       1  /* Verify that we refuse 'acc_map_data' when the "host address [...] is already
       2     mapped".  */
       3  
       4  /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
       5  
       6  #include <assert.h>
       7  #include <stdio.h>
       8  #include <stdlib.h>
       9  #include <openacc.h>
      10  
      11  int
      12  main ()
      13  {
      14    const int N = 101;
      15  
      16    char *h = (char *) malloc (N);
      17    assert (h);
      18    void *d1 = acc_malloc (N);
      19    assert (d1);
      20    acc_map_data (h, d1, N);
      21  
      22    void *d2 = acc_malloc (N);
      23    assert (d2);
      24    fprintf (stderr, "CheCKpOInT\n");
      25    acc_map_data (h, d2, N);
      26  
      27    return 0;
      28  }
      29  
      30  
      31  /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
      32  /* { dg-output "host address \\\[\[0-9a-fA-FxX\]+, \\\+101\\\] is already mapped" } */
      33  /* { dg-shouldfail "" } */