]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gfortran.dg/loop_versioning_3.f90
Add a loop versioning pass
[thirdparty/gcc.git] / gcc / testsuite / gfortran.dg / loop_versioning_3.f90
1 ! { dg-options "-O3 -fdump-tree-lversion-details -fno-frontend-loop-interchange" }
2
3 ! Test a case in which the outer loop iterates over the inner dimension.
4 ! The options above prevent the frontend from interchanging the loops.
5
6 subroutine f1(x, limit, step, n)
7 integer :: limit, step, n
8 real :: x(limit, n)
9 do i = 1, limit, step
10 do j = 1, n
11 x(i, j) = 100
12 end do
13 end do
14 end subroutine f1
15
16 subroutine f2(x, n, limit, step)
17 integer :: n, limit, step
18 real :: x(limit, n)
19 do i = 1, n
20 do j = 1, limit, step
21 x(j, i) = 100
22 end do
23 end do
24 end subroutine f2
25
26 ! FIXME: The frontend doesn't give us enough information to tell which loop
27 ! is iterating over the innermost dimension, so we optimistically
28 ! assume the inner one is.
29 ! { dg-final { scan-tree-dump-not {want to version} "lversion" { xfail *-*-* } } }
30 ! { dg-final { scan-tree-dump-not {versioned} "lversion" { xfail *-*-* } } }