]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgomp/testsuite/libgomp.oacc-c-c++-common/present-1.c
Add checkpoint to libgomp dg-shouldfail tests
[thirdparty/gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / present-1.c
CommitLineData
41dbbb37
TS
1/* { dg-do run } */
2/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
3
4#include <openacc.h>
5#include <string.h>
6#include <stdio.h>
7#include <stdlib.h>
8#include <stdbool.h>
9
10int
11main (int argc, char **argv)
12{
13 int N = 8;
14 float *a, *b, *c, *d;
15 int i;
16
17 a = (float *) malloc (N * sizeof (float));
18 b = (float *) malloc (N * sizeof (float));
19 c = (float *) malloc (N * sizeof (float));
20
21 d = (float *) acc_malloc (N * sizeof (float));
22 acc_map_data (c, d, N * sizeof (float));
23
4e2a5450 24 fprintf (stderr, "CheCKpOInT\n");
41dbbb37
TS
25#pragma acc data present (a[0:N]) present (c[0:N]) present (b[0:N])
26 {
27#pragma acc parallel
28 {
29 int ii;
30
31 for (ii = 0; ii < N; ii++)
32 {
33 c[ii] = a[ii];
34 b[ii] = c[ii];
35 }
36 }
37 }
38
39 d = (float *) acc_deviceptr (c);
40 acc_unmap_data (c);
41 acc_free (d);
42
43 free (a);
44 free (b);
45 free (c);
46
47 return 0;
48}
4e2a5450
TS
49
50/* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
1309f1d2
JN
51/* { dg-output "present clause: !acc_is_present" } */
52/* { dg-shouldfail "" } */