aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-11.c
blob: 86cfeb68c5d0285424877fd52064d38d3af1aa93 (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
/* Only nvptx plugin does the required error checking.
   { dg-do run { target openacc_nvidia_accel_selected } } */

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

int
main (int argc, char **argv)
{
  const int N = 512;
  void *d;

  d = acc_malloc (N);
  if (d == NULL)
    abort ();

  fprintf (stderr, "CheCKpOInT\n");
  acc_free ((void *)((uintptr_t) d + (uintptr_t) (N >> 1)));

  return 0;
}

/* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
/* { dg-output "invalid device address" } */
/* { dg-shouldfail "" } */