}
if (clauses->vector)
{
+ c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_VECTOR);
+ omp_clauses = gfc_trans_add_clause (c, omp_clauses);
+
if (clauses->vector_expr)
{
tree vector_var
= gfc_convert_expr_to_tree (block, clauses->vector_expr);
- c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_VECTOR);
OMP_CLAUSE_VECTOR_EXPR (c) = vector_var;
- omp_clauses = gfc_trans_add_clause (c, omp_clauses);
- }
- else
- {
- c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_VECTOR);
- omp_clauses = gfc_trans_add_clause (c, omp_clauses);
+
+ /* TODO: We're not capturing location information for individual
+ clauses. However, if we have an expression attached to the
+ clause, that one provides better location information. */
+ OMP_CLAUSE_LOCATION (c)
+ = gfc_get_location (&clauses->vector_expr->where);
}
}
if (clauses->worker)
{
+ c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_WORKER);
+ omp_clauses = gfc_trans_add_clause (c, omp_clauses);
+
if (clauses->worker_expr)
{
tree worker_var
= gfc_convert_expr_to_tree (block, clauses->worker_expr);
- c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_WORKER);
OMP_CLAUSE_WORKER_EXPR (c) = worker_var;
- omp_clauses = gfc_trans_add_clause (c, omp_clauses);
- }
- else
- {
- c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_WORKER);
- omp_clauses = gfc_trans_add_clause (c, omp_clauses);
+
+ /* TODO: We're not capturing location information for individual
+ clauses. However, if we have an expression attached to the
+ clause, that one provides better location information. */
+ OMP_CLAUSE_LOCATION (c)
+ = gfc_get_location (&clauses->worker_expr->where);
}
}
if (clauses->gang)
tree arg;
c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_GANG);
omp_clauses = gfc_trans_add_clause (c, omp_clauses);
+
if (clauses->gang_num_expr)
{
arg = gfc_convert_expr_to_tree (block, clauses->gang_num_expr);
OMP_CLAUSE_GANG_EXPR (c) = arg;
+
+ /* TODO: We're not capturing location information for individual
+ clauses. However, if we have an expression attached to the
+ clause, that one provides better location information. */
+ OMP_CLAUSE_LOCATION (c)
+ = gfc_get_location (&clauses->gang_num_expr->where);
}
+
if (clauses->gang_static)
{
arg = clauses->gang_static_expr
integer :: i
!$acc serial loop &
- !$acc & gang(num:5) & ! { dg-error "argument not permitted on 'gang' clause" "TODO" { xfail *-*-* } }
- !$acc & & ! { dg-bogus "14: argument not permitted on 'gang' clause" "TODO" { xfail *-*-* } .+6 }
- !$acc & worker(num:5) & ! { dg-error "argument not permitted on 'worker' clause" "TODO" { xfail *-*-* } }
- !$acc & & ! { dg-bogus "14: argument not permitted on 'worker' clause" "TODO" { xfail *-*-* } .+4 }
- !$acc & vector(length:5) & ! { dg-error "argument not permitted on 'vector' clause" "TODO" { xfail *-*-* } }
- !$acc & ! { dg-bogus "14: argument not permitted on 'vector' clause" "TODO" { xfail *-*-* } .+2 }
- ! { dg-message "99: enclosing parent compute construct" "" { target *-*-* } .-1 }
+ !$acc & gang(num:5) & ! { dg-error "25: argument not permitted on 'gang' clause" }
+ !$acc & worker(num:5) & ! { dg-error "24: argument not permitted on 'worker' clause" }
+ !$acc & vector(length:5) ! { dg-error "28: argument not permitted on 'vector' clause" }
+ ! { dg-message "93: enclosing parent compute construct" "" { target *-*-* } .-1 }
do i = 0, 10
end do
!$acc end serial loop
!$acc serial ! { dg-message "72: enclosing parent compute construct" }
!$acc loop &
- !$acc & gang(num:5) & ! { dg-error "argument not permitted on 'gang' clause" "TODO" { xfail *-*-* } }
- !$acc & & ! { dg-bogus "14: argument not permitted on 'gang' clause" "TODO" { xfail *-*-* } .+5 }
- !$acc & worker(num:5) & ! { dg-error "argument not permitted on 'worker' clause" "TODO" { xfail *-*-* } }
- !$acc & & ! { dg-bogus "14: argument not permitted on 'worker' clause" "TODO" { xfail *-*-* } .+3 }
- !$acc & vector(length:5) & ! { dg-error "argument not permitted on 'vector' clause" "TODO" { xfail *-*-* } }
- !$acc & ! { dg-bogus "14: argument not permitted on 'vector' clause" "TODO" { xfail *-*-* } .+1 }
+ !$acc & gang(num:5) & ! { dg-error "27: argument not permitted on 'gang' clause" }
+ !$acc & worker(num:5) & ! { dg-error "23: argument not permitted on 'worker' clause" }
+ !$acc & vector(length:5) ! { dg-error "29: argument not permitted on 'vector' clause" }
do i = 0, 10
end do
!$acc end serial
!$acc routine(gwv_r)
!$acc loop &
- !$acc & gang(num:5) & ! { dg-error "argument not permitted on 'gang' clause" "TODO" { xfail *-*-* } }
- !$acc & & ! { dg-bogus "14: argument not permitted on 'gang' clause" "TODO" { xfail *-*-* } .+5 }
- !$acc & worker(num:5) & ! { dg-error "argument not permitted on 'worker' clause" "TODO" { xfail *-*-* } }
- !$acc & & ! { dg-bogus "14: argument not permitted on 'worker' clause" "TODO" { xfail *-*-* } .+3 }
- !$acc & vector(length:5) & ! { dg-error "argument not permitted on 'vector' clause" "TODO" { xfail *-*-* } }
- !$acc & ! { dg-bogus "14: argument not permitted on 'vector' clause" "TODO" { xfail *-*-* } .+1 }
+ !$acc & gang(num:5) & ! { dg-error "23: argument not permitted on 'gang' clause" }
+ !$acc & worker(num:5) & ! { dg-error "26: argument not permitted on 'worker' clause" }
+ !$acc & vector(length:5) ! { dg-error "27: argument not permitted on 'vector' clause" }
do i = 0, 10
end do
end subroutine gwv_r