2014-07-12 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr48636.f90
blobf35eb519f61926b8b382973fa3168111f843c0f8
1 ! { dg-do compile }
2 ! { dg-options "-O3 -fdump-ipa-inline-details -fno-ipa-cp" }
4 module foo
5 implicit none
6 contains
7 subroutine bar(a,x)
8 real, dimension(:,:), intent(in) :: a
9 real, intent(out) :: x
10 integer :: i,j
12 x = 0
13 do j=1,ubound(a,2)
14 do i=1,ubound(a,1)
15 x = x + a(i,j)**2
16 end do
17 end do
18 end subroutine bar
19 end module foo
21 program main
22 use foo
23 implicit none
24 real, dimension(2,3) :: a
25 real :: x
26 integer :: i
28 data a /1.0, 2.0, 3.0, -1.0, -2.0, -3.0/
30 do i=1,2000000
31 call bar(a,x)
32 end do
33 print *,x
34 end program main
36 ! { dg-final { scan-ipa-dump "bar\[^\\n\]*inline copy in MAIN" "inline" } }
37 ! { dg-final { scan-ipa-dump-times "phi predicate:" 5 "inline" } }
38 ! { dg-final { scan-ipa-dump "inline hints: loop_iterations" "inline" } }
39 ! { dg-final { cleanup-ipa-dump "inline" } }