1! { dg-do compile }
2! { dg-options "-Warray-temporaries -O" }
3module foo
4  implicit none
5contains
6  pure function bar(i,j)
7    integer, intent(in) :: i,j
8    integer, dimension(2,2) :: bar
9    bar = 33
10  end function bar
11end module foo
12
13program main
14  use foo
15  implicit none
16  integer a(2,2), b(2,2),c(2,2), d(2,2), e(2)
17
18  read (*,*) b, c, d
19  a = matmul(b,c) + d
20  a = b + bar(3,4)
21  a = bar(3,4)*5 + b
22  e = sum(b,1) + 3
23end program main
24