File tree Expand file tree Collapse file tree 5 files changed +63
-1
lines changed Expand file tree Collapse file tree 5 files changed +63
-1
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,17 @@ template <typename D> class NoBranchingEnforce {
7979 break ;
8080 }
8181 } else if constexpr (std::is_same_v<D, llvm::acc::Directive>) {
82- return ; // OpenACC construct do not need check for unlabelled CYCLES
82+ switch ((llvm::acc::Directive)currentDirective_) {
83+ // exclude loop directives which do not need a check for unlabelled
84+ // CYCLES
85+ case llvm::acc::Directive::ACCD_loop:
86+ case llvm::acc::Directive::ACCD_kernels_loop:
87+ case llvm::acc::Directive::ACCD_parallel_loop:
88+ case llvm::acc::Directive::ACCD_serial_loop:
89+ return ;
90+ default :
91+ break ;
92+ }
8393 }
8494 CheckConstructNameBranching (" CYCLE" );
8595 }
Original file line number Diff line number Diff line change @@ -187,6 +187,19 @@ program openacc_data_validity
187187 ! $acc data copy(aa) device_type(default) wait
188188 ! $acc end data
189189
190+ do i = 1 , 100
191+ ! $acc data copy(aa)
192+ ! ERROR: CYCLE to construct outside of DATA construct is not allowed
193+ if (i == 10 ) cycle
194+ ! $acc end data
195+ end do
196+
197+ ! $acc data copy(aa)
198+ do i = 1 , 100
199+ if (i == 10 ) cycle
200+ end do
201+ ! $acc end data
202+
190203end program openacc_data_validity
191204
192205module mod1
Original file line number Diff line number Diff line change @@ -144,4 +144,17 @@ program openacc_kernels_validity
144144 end do
145145 ! $acc end kernels
146146
147+ do i = 1 , 100
148+ ! $acc kernels
149+ ! ERROR: CYCLE to construct outside of KERNELS construct is not allowed
150+ if (i == 10 ) cycle
151+ ! $acc end kernels
152+ end do
153+
154+ ! $acc kernels
155+ do i = 1 , 100
156+ if (i == 10 ) cycle
157+ end do
158+ ! $acc end kernels
159+
147160end program openacc_kernels_validity
Original file line number Diff line number Diff line change @@ -142,4 +142,17 @@ program openacc_parallel_validity
142142 end do
143143 ! $acc end parallel
144144
145+ do i = 1 , 100
146+ ! $acc parallel
147+ ! ERROR: CYCLE to construct outside of PARALLEL construct is not allowed
148+ if (i == 10 ) cycle
149+ ! $acc end parallel
150+ end do
151+
152+ ! $acc parallel
153+ do i = 1 , 100
154+ if (i == 10 ) cycle
155+ end do
156+ ! $acc end parallel
157+
145158end program openacc_parallel_validity
Original file line number Diff line number Diff line change @@ -166,4 +166,17 @@ program openacc_serial_validity
166166 end do
167167 ! $acc end serial
168168
169+ do i = 1 , 100
170+ ! $acc serial
171+ ! ERROR: CYCLE to construct outside of SERIAL construct is not allowed
172+ if (i == 10 ) cycle
173+ ! $acc end serial
174+ end do
175+
176+ ! $acc serial
177+ do i = 1 , 100
178+ if (i == 10 ) cycle
179+ end do
180+ ! $acc end serial
181+
169182end program openacc_serial_validity
You can’t perform that action at this time.
0 commit comments