aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-34.c
blob: 8ddd897826ffa0f00ef7769c6f7df374b6a884d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Exercise an invalid acc_present_or_create.  */

/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */

#include <stdio.h>
#include <stdlib.h>
#include <openacc.h>

int
main (int argc, char **argv)
{
  const int N = 256;
  unsigned char *h;
  void *d1, *d2;

  h = (unsigned char *) malloc (N);

  d1 = acc_present_or_create (h, N);
  if (!d1)
    abort ();

  fprintf (stderr, "CheCKpOInT\n");
  d2 = acc_present_or_create (h + 2, N);
  if (!d2)
    abort ();

  if (d1 != d2)
    abort ();

  acc_delete (h, N);

  free (h);

  return 0;
}

/* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
/* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+256\\\] not mapped" } */
/* { dg-shouldfail "" } */