1 /* { dg-skip-if "" { *-*-* } { "-DACC_MEM_SHARED=1" } } */
10 main (int argc
, char *argv
[])
12 char *block1
= (char *) malloc (SIZE
);
13 char *block2
= (char *) malloc (SIZE
);
14 char *block3
= (char *) malloc (SIZE
);
17 acc_copyin (block1
, SIZE
);
19 #pragma acc enter data copyin(block1[0:SIZE])
22 #pragma acc data copy(block1[0:SIZE], block2[0:SIZE], block3[0:SIZE])
24 /* The first copyin of block2 is the enclosing data region. This
25 "enter data" should make it live beyond the end of this region. */
27 acc_copyin (block2
, SIZE
);
29 #pragma acc enter data copyin(block2[0:SIZE])
33 assert (acc_is_present (block1
, SIZE
));
34 assert (acc_is_present (block2
, SIZE
));
35 assert (!acc_is_present (block3
, SIZE
));
38 acc_copyout (block1
, SIZE
);
39 assert (!acc_is_present (block1
, SIZE
));
41 acc_copyout (block2
, SIZE
);
42 assert (!acc_is_present (block2
, SIZE
));
44 #pragma acc exit data copyout(block1[0:SIZE])
45 assert (!acc_is_present (block1
, SIZE
));
47 #pragma acc exit data copyout(block2[0:SIZE])
48 assert (!acc_is_present (block2
, SIZE
));