1214571Sdim! { dg-do compile }
2214571Sdim! Tests the fix for PR29821, which was due to failure to simplify the
3214571Sdim! array section, since the section is not constant, provoking failure
4214571Sdim! to resolve the argument of SUM and therefore to resolve SUM itself.
5214571Sdim!
6214571Sdim! Contributed by Harald Anlauf  <anlauf@gmx.de>
7214571Sdim!
8214571Sdimmodule gfcbug45
9214571Sdim  implicit none
10214571Sdimcontains
11214571Sdim  subroutine foo
12214571Sdim    real, external :: mysum
13214571Sdim    integer :: i
14214571Sdim    real    :: a
15214571Sdim    real, parameter :: eps(2) = (/ 1, 99 /)
16214571Sdim    i = 1
17214571Sdim    a = sum (eps(i:i+1) * eps)
18214571Sdim    print *, a
19214571Sdim  end subroutine foo
20214571Sdimend module gfcbug45
21214571Sdim  use gfcbug45
22214571Sdim  call foo
23214571Sdimend
24214571Sdim