PR ipa/83051
[official-gcc.git] / gcc / testsuite / gfortran.dg / vector_subscript_5.f90
blob88eb358e6bf10f5a7aef4eb018233322732b1e3f
1 ! { dg-do run }
3 ! Test the fix for PR37749 in which the expression in line 13 would cause an ICE
4 ! because the upper value of the loop range was not set.
6 ! Contributed by Jakub Jelinek <jakub@gcc.gnu.org>
8 subroutine subr (m, n, a, b, c, d, p)
9 implicit none
10 integer m, n
11 real a(m,n), b(m,n), c(n,n), d(m,n)
12 integer p(n)
13 d = a(:,p) - matmul(b, c)
14 end subroutine
16 implicit none
17 integer i
18 real a(3,2), b(3,2), c(2,2), d(3,2)
19 integer p(2)
20 a = reshape ((/(i, i = 1, 6)/), (/3, 2/))
21 b = 1
22 c = 2
23 p = 2
24 call subr (3, 2, a, b, c, d, p)
25 if (any (d .ne. reshape ((/(mod (i + 2, 3), i = 1, 6)/), (/3, 2/)))) call abort
26 end