Set num_threads to 50 on 32-bit hppa in two libgomp loop tests
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / structured-dynamic-lifetimes-6.c
blob9250b4af3eda79926491a1a7195946c979f79969
1 /* { dg-skip-if "" { *-*-* } { "-DACC_MEM_SHARED=1" } } */
3 #include <openacc.h>
4 #include <assert.h>
5 #include <stdlib.h>
7 #define SIZE 1024
9 int
10 main (int argc, char *argv[])
12 char *block1 = (char *) malloc (SIZE);
13 char *block2 = (char *) malloc (SIZE);
15 #ifdef OPENACC_API
16 acc_copyin (block1, SIZE);
17 acc_copyin (block2, SIZE);
18 #else
19 #pragma acc enter data copyin(block1[0:SIZE], block2[0:SIZE])
20 #endif
22 #pragma acc data copy(block1[0:SIZE], block2[0:SIZE])
24 #ifdef OPENACC_API
25 acc_copyout (block1, SIZE);
26 acc_copyout (block2, SIZE);
27 #else
28 #pragma acc exit data copyout(block1[0:SIZE], block2[0:SIZE])
29 #endif
30 /* These should stay present until the end of the structured data
31 lifetime. */
32 assert (acc_is_present (block1, SIZE));
33 assert (acc_is_present (block2, SIZE));
36 assert (!acc_is_present (block1, SIZE));
37 assert (!acc_is_present (block2, SIZE));
39 free (block1);
40 free (block2);
42 return 0;