view gcc/testsuite/gfortran.dg/loop_versioning_3.f90 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 1830386684a0
children
line wrap: on
line source

! { dg-options "-O3 -fdump-tree-lversion-details -fno-frontend-loop-interchange" }

! Test a case in which the outer loop iterates over the inner dimension.
! The options above prevent the frontend from interchanging the loops.

subroutine f1(x, limit, step, n)
  integer :: limit, step, n
  real :: x(limit, n)
  do i = 1, limit, step
     do j = 1, n
        x(i, j) = 100
     end do
  end do
end subroutine f1

subroutine f2(x, n, limit, step)
  integer :: n, limit, step
  real :: x(limit, n)
  do i = 1, n
     do j = 1, limit, step
        x(j, i) = 100
     end do
  end do
end subroutine f2

! FIXME: The frontend doesn't give us enough information to tell which loop
! is iterating over the innermost dimension, so we optimistically
! assume the inner one is.
! { dg-final { scan-tree-dump-not {want to version} "lversion" { xfail *-*-* } } }
! { dg-final { scan-tree-dump-not {versioned} "lversion" { xfail *-*-* } } }