aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-c-c++-common/pr92726-1.c
blob: fb69adf4c400ce2fc2d5f22c7954e6b1d9277041 (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
/* Verify that 'acc_delete' etc. with a 'NULL' address is a no-op.  */

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

int
main (int argc, char **argv)
{
  const int N = 256;

  unsigned char *a = (unsigned char *) malloc (N);
  assert (a);

  void *a_d = acc_create (a, N);
  assert (a_d);

  acc_delete (NULL, N);
  assert (acc_is_present (a, N));
  //TODO similar for others.

  acc_delete (a, N);
  free (a);

  return 0;
}