1! { dg-do compile }
2! { dg-additional-options "-fmax-errors=100" }
3
4program test
5  implicit none
6  integer :: i, j, static, num, length
7
8  !$acc kernels
9    !$acc loop gang(static:static)
10    DO i = 1,10
11    ENDDO
12    !$acc loop gang(static:*)
13    DO i = 1,10
14    ENDDO
15    !$acc loop gang(static:1)
16    DO i = 1,10
17    ENDDO
18    !$acc loop gang(,static:1) ! { dg-error "Invalid character" }
19    DO i = 1,10
20    ENDDO
21    !$acc loop gang(static:1,) ! { dg-error "Invalid character" }
22    DO i = 1,10
23    ENDDO
24    !$acc loop gang(static:*, num:5)
25    DO i = 1,10
26    ENDDO
27    !$acc loop gang(static:1, 5)
28    DO i = 1,10
29    ENDDO
30    !$acc loop gang(num:num, static:1)
31    DO i = 1,10
32    ENDDO
33    !$acc loop gang(static:*, num:5, static:5) ! { dg-error "Unclassifiable OpenACC directive" }
34    DO i = 1,10
35    ENDDO
36    !$acc loop gang(1, num:2, static:3) ! { dg-error "Unclassifiable OpenACC directive" }
37    DO i = 1,10
38    ENDDO
39    !$acc loop gang(num:num static:1) ! { dg-error "Unclassifiable OpenACC directive" }
40    DO i = 1,10
41    ENDDO
42    !$acc loop gang(num)
43    DO i = 1,10
44    ENDDO
45    !$acc loop gang(num:num+1, static:1+num)
46    DO i = 1,10
47    ENDDO
48    !$acc loop gang(length:num) ! { dg-error "Unclassifiable OpenACC directive" }
49    DO i = 1,10
50    ENDDO
51
52    !$acc loop worker
53    DO i = 1,10
54    ENDDO
55    !$acc loop worker (5)
56    DO i = 1,10
57    ENDDO
58    !$acc loop worker (num)
59    DO i = 1,10
60    ENDDO
61    !$acc loop worker (static:num) ! { dg-error "Unclassifiable OpenACC directive" }
62    DO i = 1,10
63    ENDDO
64    !$acc loop worker (num:,) ! { dg-error "Invalid character" }
65    DO i = 1,10
66    ENDDO
67    !$acc loop worker (num:num:num) ! { dg-error "Unclassifiable OpenACC directive" }
68    DO i = 1,10
69    ENDDO
70    !$acc loop worker (num:num*num)
71    DO i = 1,10
72    ENDDO
73    !$acc loop worker (length:num*num) ! { dg-error "Unclassifiable OpenACC directive" }
74    DO i = 1,10
75    ENDDO
76    !$acc loop worker (num:*) ! { dg-error "Invalid character" }
77    DO i = 1,10
78    ENDDO
79    !$acc loop worker (num:5)
80    DO i = 1,10
81    ENDDO
82
83    !$acc loop vector
84    DO i = 1,10
85    ENDDO
86    !$acc loop vector (32)
87    DO i = 1,10
88    ENDDO
89    !$acc loop vector (length)
90    DO i = 1,10
91    ENDDO
92    !$acc loop vrctor (static:num) ! { dg-error "Unclassifiable OpenACC directive" }
93    DO i = 1,10
94    ENDDO
95    !$acc loop vector (length:,) ! { dg-error "Invalid character" }
96    DO i = 1,10
97    ENDDO
98    !$acc loop vector (length:num:num) ! { dg-error "Unclassifiable OpenACC directive" }
99    DO i = 1,10
100    ENDDO
101    !$acc loop vector (length:static*num)
102    DO i = 1,10
103    ENDDO
104    !$acc loop vector (length:length)
105    DO i = 1,10
106    ENDDO
107    !$acc loop vector (length:32)
108    DO i = 1,10
109    ENDDO
110    !$acc loop vector (num:num*num) ! { dg-error "Unclassifiable OpenACC directive" }
111    DO i = 1,10
112    ENDDO
113    !$acc loop vector (length:*) ! { dg-error "Invalid character" }
114    DO i = 1,10
115    ENDDO
116
117
118    !$acc loop auto
119    DO i = 1,10
120    ENDDO
121  !$acc end kernels
122end
123