2016-01-15 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr48636.f90
blob94826fa479031dffde7244f53a1d06bf01757b14
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" } }