| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR fortran/108450 |
| 4 |
! This program used to cause an ICE because of the double resolution |
| 5 |
! of the maxloc expression and the addition of a hidden unnamed argument |
| 6 |
! during the first resolution. |
| 7 |
! |
| 8 |
! Original testcase from G. Steinmetz |
| 9 |
|
| 10 |
subroutine s1 |
| 11 |
integer :: a(8) = 0 |
| 12 |
integer :: l |
| 13 |
integer :: n |
| 14 |
!$omp atomic |
| 15 |
n = maxloc(a, mask=l) ! { dg-error ".mask. argument of .maxloc. intrinsic at .1. must be LOGICAL" } |
| 16 |
end |
| 17 |
|
| 18 |
subroutine s2 |
| 19 |
integer :: a(8) = 0 |
| 20 |
integer :: l |
| 21 |
integer :: n |
| 22 |
!$omp atomic |
| 23 |
n = minloc(a, mask=l) ! { dg-error ".mask. argument of .minloc. intrinsic at .1. must be LOGICAL" } |
| 24 |
end |
| 25 |
|
| 26 |
subroutine s3 |
| 27 |
integer :: a(8) = 0 |
| 28 |
integer :: l |
| 29 |
integer :: n |
| 30 |
!$omp atomic |
| 31 |
n = findloc(a, 3, mask=l) ! { dg-error ".mask. argument of .findloc. intrinsic at .1. must be LOGICAL" } |
| 32 |
end |