1 |
694 |
jeremybenn |
! { dg-do compile }
|
2 |
|
|
! PR 26039: Tests for different ranks for (min|max)loc, (min|max)val, product
|
3 |
|
|
! and sum were missing.
|
4 |
|
|
program main
|
5 |
|
|
integer, dimension(2) :: a
|
6 |
|
|
logical, dimension(2,1) :: lo
|
7 |
|
|
logical, dimension(3) :: lo2
|
8 |
|
|
a = (/ 1, 2 /)
|
9 |
|
|
lo = .true.
|
10 |
|
|
print *,minloc(a,mask=lo) ! { dg-error "Incompatible ranks" }
|
11 |
|
|
print *,maxloc(a,mask=lo) ! { dg-error "Incompatible ranks" }
|
12 |
|
|
print *,minval(a,mask=lo) ! { dg-error "Incompatible ranks" }
|
13 |
|
|
print *,maxval(a,mask=lo) ! { dg-error "Incompatible ranks" }
|
14 |
|
|
print *,sum(a,mask=lo) ! { dg-error "Incompatible ranks" }
|
15 |
|
|
print *,product(a,mask=lo) ! { dg-error "Incompatible ranks" }
|
16 |
|
|
print *,minloc(a,1,mask=lo) ! { dg-error "Incompatible ranks" }
|
17 |
|
|
print *,maxloc(a,1,mask=lo) ! { dg-error "Incompatible ranks" }
|
18 |
|
|
print *,minval(a,1,mask=lo) ! { dg-error "Incompatible ranks" }
|
19 |
|
|
print *,maxval(a,1,mask=lo) ! { dg-error "Incompatible ranks" }
|
20 |
|
|
print *,sum(a,1,mask=lo) ! { dg-error "Incompatible ranks" }
|
21 |
|
|
print *,product(a,1,mask=lo) ! { dg-error "Incompatible ranks" }
|
22 |
|
|
|
23 |
|
|
print *,minloc(a,mask=lo2) ! { dg-error "Different shape" }
|
24 |
|
|
print *,maxloc(a,mask=lo2) ! { dg-error "Different shape" }
|
25 |
|
|
print *,minval(a,mask=lo2) ! { dg-error "Different shape" }
|
26 |
|
|
print *,maxval(a,mask=lo2) ! { dg-error "Different shape" }
|
27 |
|
|
print *,sum(a,mask=lo2) ! { dg-error "Different shape" }
|
28 |
|
|
print *,product(a,mask=lo2) ! { dg-error "Different shape" }
|
29 |
|
|
print *,minloc(a,1,mask=lo2) ! { dg-error "Different shape" }
|
30 |
|
|
print *,maxloc(a,1,mask=lo2) ! { dg-error "Different shape" }
|
31 |
|
|
print *,minval(a,1,mask=lo2) ! { dg-error "Different shape" }
|
32 |
|
|
print *,maxval(a,1,mask=lo2) ! { dg-error "Different shape" }
|
33 |
|
|
print *,sum(a,1,mask=lo2) ! { dg-error "Different shape" }
|
34 |
|
|
print *,product(a,1,mask=lo2) ! { dg-error "Different shape" }
|
35 |
|
|
end program main
|