aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-31.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.oacc-c-c++-common/lib-31.c')
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/lib-31.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-31.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-31.c
new file mode 100644
index 00000000000..25ce5a95977
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-31.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+
+#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_present_or_create (h, N);
+ if (!d)
+ abort ();
+
+ if (acc_is_present (h, 1) != 1)
+ abort ();
+
+ acc_delete (h, N);
+
+ free (h);
+
+ return 0;
+}