Retro68/gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-25.c

39 lines
498 B
C
Raw Normal View History

2019-06-02 15:48:37 +00:00
/* Exercise acc_create and acc_delete. */
2015-08-28 15:33:40 +00:00
#include <stdlib.h>
#include <openacc.h>
int
main (int argc, char **argv)
{
const int N = 256;
unsigned char *h;
void *d;
h = (unsigned char *) malloc (N);
d = acc_create (h, N);
if (!d)
abort ();
d = acc_create (h, N);
if (!d)
abort ();
acc_delete (h, N);
2019-06-02 15:48:37 +00:00
if (!acc_is_present (h, N))
abort ();
acc_delete (h, N);
#if !ACC_MEM_SHARED
if (acc_is_present (h, N))
abort ();
#endif
2015-08-28 15:33:40 +00:00
free (h);
return 0;
}