"argument not permitted on %qs clause",
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
if (tgt)
- inform (gimple_location (outer_ctx->stmt),
+ inform (gimple_location (tgt->stmt),
"enclosing parent compute construct");
else if (oacc_get_fn_attrib (current_function_decl))
inform (DECL_SOURCE_LOCATION (current_function_decl),
void
-a_sl() {
+gwv_sl_1() {
#pragma acc serial loop /* { dg-message "9: enclosing parent compute construct" } */ \
gang(num:5) /* { dg-error "5: argument not permitted on 'gang' clause" } */ \
worker(num:5) /* { dg-error "3: argument not permitted on 'worker' clause" } */ \
}
void
-a_s_l() {
+gwv_sl_2() {
+#pragma acc serial loop /* { dg-message "9: enclosing parent compute construct" } */
+ for (int i = 0; i < 10; i++)
+ {
+#pragma acc loop /* { dg-bogus "enclosing parent compute construct" } */
+ for (int j = 0; j < 10; j++)
+ {
+#pragma acc loop \
+ gang(num:5) /* { dg-error "9: argument not permitted on 'gang' clause" } */ \
+ worker(num:5) /* { dg-error "5: argument not permitted on 'worker' clause" } */ \
+ vector(length:5) /* { dg-error "3: argument not permitted on 'vector' clause" } */
+ for (int k = 0; k < 10; k++)
+ ;
+ }
+ }
+}
+
+void
+gwv_s_l() {
#pragma acc serial /* { dg-message "9: enclosing parent compute construct" } */
{
#pragma acc loop \
vector(length:5) /* { dg-error "3: argument not permitted on 'vector' clause" } */
for (int i = 0; i < 10; i++)
;
+
+#pragma acc loop
+ for (int i = 0; i < 10; i++)
+ {
+#pragma acc loop /* { dg-bogus "enclosing parent compute construct" } */
+ for (int j = 0; j < 10; j++)
+ {
+#pragma acc loop \
+ gang(num:5) /* { dg-error "10: argument not permitted on 'gang' clause" } */ \
+ worker(num:5) /* { dg-error "7: argument not permitted on 'worker' clause" } */ \
+ vector(length:5) /* { dg-error "5: argument not permitted on 'vector' clause" } */
+ for (int k = 0; k < 10; k++)
+ ;
+ }
+ }
}
}
-void a_r();
-#pragma acc routine(a_r)
+void gwv_r();
+#pragma acc routine(gwv_r)
void
-a_r() { /* { dg-message "1: enclosing routine" } */
+gwv_r() { /* { dg-message "1: enclosing routine" } */
#pragma acc loop \
gang(num:5) /* { dg-error "4: argument not permitted on 'gang' clause" } */ \
worker(num:5) /* { dg-error "5: argument not permitted on 'worker' clause" } */ \
vector(length:5) /* { dg-error "3: argument not permitted on 'vector' clause" } */
for (int i = 0; i < 10; i++)
;
+
+#pragma acc loop
+ for (int i = 0; i < 10; i++)
+ {
+#pragma acc loop
+ for (int j = 0; j < 10; j++)
+ {
+#pragma acc loop \
+ gang(num:5) /* { dg-error "6: argument not permitted on 'gang' clause" } */ \
+ worker(num:5) /* { dg-error "4: argument not permitted on 'worker' clause" } */ \
+ vector(length:5) /* { dg-error "6: argument not permitted on 'vector' clause" } */
+ for (int k = 0; k < 10; k++)
+ ;
+ }
+ }
}
end subroutine check
-subroutine gwv_sl ()
+subroutine gwv_sl_1 ()
implicit none (type, external)
integer :: i
do i = 0, 10
end do
!$acc end serial loop
-end subroutine gwv_sl
+end subroutine gwv_sl_1
+
+subroutine gwv_sl_2 ()
+ implicit none (type, external)
+ integer :: i, j, k
+
+ !$acc serial loop ! { dg-message "77: enclosing parent compute construct" }
+ do i = 0, 10
+ !$acc loop ! { dg-bogus "enclosing parent compute construct" }
+ do j = 0, 10
+ !$acc loop &
+ !$acc & gang(num:5) & ! { dg-error "35: argument not permitted on 'gang' clause" }
+ !$acc & worker(num:5) & ! { dg-error "32: argument not permitted on 'worker' clause" }
+ !$acc & vector(length:5) ! { dg-error "33: argument not permitted on 'vector' clause" }
+ do k = 0, 10
+ end do
+ end do
+ end do
+ !$acc end serial loop
+end subroutine gwv_sl_2
subroutine gwv_s_l ()
implicit none (type, external)
- integer :: i
+ integer :: i, j, k
!$acc serial ! { dg-message "72: enclosing parent compute construct" }
!$acc loop &
!$acc & vector(length:5) ! { dg-error "29: argument not permitted on 'vector' clause" }
do i = 0, 10
end do
- !$acc end serial
+
+ !$acc loop
+ do i = 0, 10
+ !$acc loop ! { dg-bogus "enclosing parent compute construct" }
+ do j = 0, 10
+ !$acc loop &
+ !$acc & gang(num:5) & ! { dg-error "35: argument not permitted on 'gang' clause" }
+ !$acc & worker(num:5) & ! { dg-error "32: argument not permitted on 'worker' clause" }
+ !$acc & vector(length:5) ! { dg-error "37: argument not permitted on 'vector' clause" }
+ do k = 0, 10
+ end do
+ end do
+ end do
+!$acc end serial
end subroutine gwv_s_l
subroutine gwv_r () ! { dg-message "16: enclosing routine" }
implicit none (type, external)
- integer :: i
+ integer :: i, j, k
!$acc routine(gwv_r)
!$acc & vector(length:5) ! { dg-error "27: argument not permitted on 'vector' clause" }
do i = 0, 10
end do
+
+ !$acc loop
+ do i = 0, 10
+ !$acc loop
+ do j = 0, 10
+ !$acc loop &
+ !$acc & gang(num:5) & ! { dg-error "31: argument not permitted on 'gang' clause" }
+ !$acc & worker(num:5) & ! { dg-error "31: argument not permitted on 'worker' clause" }
+ !$acc & vector(length:5) ! { dg-error "36: argument not permitted on 'vector' clause" }
+ do k = 0, 10
+ end do
+ end do
+ end do
end subroutine gwv_r