aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr56049.f90
blob: d760320cd671718dc6b0a06bf7738dd11d36a9a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
! { dg-do compile }
! { dg-options "-O3 -fdump-tree-optimized" }

program inline

    integer i
    integer a(8,8), b(8,8)

    a = 0
    do i = 1, 10000000
        call add(b, a, 1)
        a = b
    end do

    print *, a

contains

    subroutine add(b, a, o)
        integer, intent(inout) :: b(8,8)
        integer, intent(in) :: a(8,8), o
        b = a + o
    end subroutine add

end program inline

! Check there's no loop left, just two bb 2 in two functions.
! { dg-final { scan-tree-dump-times "<bb \[0-9\]*>" 2 "optimized" } }
! { dg-final { scan-tree-dump-times "<bb 2>" 2 "optimized" } }