gcc/testsuite/gfortran.dg/pr117060.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! { dg-options "-O2" } |
| 3 | |
| 4 | subroutine foo (out) |
| 5 | |
| 6 | implicit none |
| 7 | |
| 8 | real :: out(*) |
| 9 | integer :: i,k |
| 10 | real :: a(100) |
| 11 | real :: b(100) |
| 12 | |
| 13 | k = 0 |
| 14 | do i = 1, 10 |
| 15 | k = k + 1 |
| 16 | out(k) = a(i) |
| 17 | k = k + 1 |
| 18 | out(k) = sqrt((a(3*i)-b(4))**2 + (a(3*i+1)-b(4+1))**2) |
| 19 | end do |
| 20 | |
| 21 | end subroutine |