1 extern int i;
2 
3 /* While the OpenACC specification does allow for certain kinds of
4    nesting, we don't support many of these yet.  */
5 void
f_acc_parallel(void)6 f_acc_parallel (void)
7 {
8 #pragma acc parallel
9   {
10 #pragma acc parallel /* { dg-bogus ".parallel. construct inside of .parallel. region" "not implemented" { xfail *-*-* } } */
11     ;
12 #pragma acc kernels /* { dg-bogus ".kernels. construct inside of .parallel. region" "not implemented" { xfail *-*-* } } */
13     ;
14 #pragma acc data /* { dg-error ".data. construct inside of .parallel. region" } */
15     ;
16 #pragma acc update host(i) /* { dg-error ".update. construct inside of .parallel. region" } */
17 #pragma acc enter data copyin(i) /* { dg-error ".enter/exit data. construct inside of .parallel. region" } */
18 #pragma acc exit data delete(i) /* { dg-error ".enter/exit data. construct inside of .parallel. region" } */
19   }
20 }
21 
22 /* While the OpenACC specification does allow for certain kinds of
23    nesting, we don't support many of these yet.  */
24 void
f_acc_kernels(void)25 f_acc_kernels (void)
26 {
27 #pragma acc kernels
28   {
29 #pragma acc parallel /* { dg-bogus ".parallel. construct inside of .kernels. region" "not implemented" { xfail *-*-* } } */
30     ;
31 #pragma acc kernels /* { dg-bogus ".kernels. construct inside of .kernels. region" "not implemented" { xfail *-*-* } } */
32     ;
33 #pragma acc data /* { dg-error ".data. construct inside of .kernels. region" } */
34     ;
35 #pragma acc update host(i) /* { dg-error ".update. construct inside of .kernels. region" } */
36 #pragma acc enter data copyin(i) /* { dg-error ".enter/exit data. construct inside of .kernels. region" } */
37 #pragma acc exit data delete(i) /* { dg-error ".enter/exit data. construct inside of .kernels. region" } */
38   }
39 }
40 
41 void
f_acc_data(void)42 f_acc_data (void)
43 {
44   unsigned int i;
45 #pragma acc data
46   {
47 #pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
48     for (i = 0; i < 2; ++i)
49       ;
50 
51 #pragma acc data
52     {
53 #pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
54       for (i = 0; i < 2; ++i)
55 	;
56     }
57   }
58 }
59 
60 #pragma acc routine
61 void
f_acc_routine(void)62 f_acc_routine (void)
63 {
64 #pragma acc parallel /* { dg-error "OpenACC region inside of OpenACC routine, nested parallelism not supported yet" } */
65   ;
66 }
67 
68 void
f(void)69 f (void)
70 {
71   int i, v = 0;
72 
73 #pragma acc loop gang reduction (+:v) /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
74   for (i = 0; i < 10; i++)
75     v++;
76 }
77