1! { dg-do run } 2! { dg-additional-options "-fno-inline" } 3 4#define N 200 5 6#define TEST_VALUE(I) ((I) * 5 / 2) 7 8subroutine setup(a) 9 real :: a(N) 10 do i = 1, N 11 a(i) = TEST_VALUE(i) 12 end do 13end subroutine 14 15subroutine check(a, x, gap) 16 real :: a(N), temp, x 17 integer :: gap 18 do i = 1, N - gap 19 temp = a(i + gap) + x 20 if (a(i) /= temp) STOP 1 21 end do 22 do i = N - gap + 1, N 23 temp = TEST_VALUE(i) 24 if (a(i) /= temp) STOP 2 25 end do 26end subroutine 27 28subroutine testa(a, x, base, n) 29 real :: a(n), x 30 integer :: base, n 31 do i = n, 2, -1 32 a(base + i - 1) = a(base + i) + x 33 end do 34end subroutine testa 35 36subroutine testb(a, x, base, n) 37 real :: a(n), x 38 integer :: base 39 do i = n, 4, -1 40 a(base + i - 3) = a(base + i) + x 41 end do 42end subroutine testb 43 44subroutine testc(a, x, base, n) 45 real :: a(n), x 46 integer :: base 47 do i = n, 8, -1 48 a(base + i - 7) = a(base + i) + x 49 end do 50end subroutine testc 51 52subroutine testd(a, x, base, n) 53 real :: a(n), x 54 integer :: base 55 do i = n, 16, -1 56 a(base + i - 15) = a(base + i) + x 57 end do 58end subroutine testd 59 60subroutine teste(a, x, base, n) 61 real :: a(n), x 62 integer :: base 63 do i = n, 32, -1 64 a(base + i - 31) = a(base + i) + x 65 end do 66end subroutine teste 67 68subroutine testf(a, x, base, n) 69 real :: a(n), x 70 integer :: base 71 do i = n, 64, -1 72 a(base + i - 63) = a(base + i) + x 73 end do 74end subroutine testf 75 76program main 77 real :: a(N) 78 79 call setup(a) 80 call testa(a, 91.0, 0, N) 81 call check(a, 91.0, 1) 82 83 call setup(a) 84 call testb(a, 55.0, 0, N) 85 call check(a, 55.0, 3) 86 87 call setup(a) 88 call testc(a, 72.0, 0, N) 89 call check(a, 72.0, 7) 90 91 call setup(a) 92 call testd(a, 69.0, 0, N) 93 call check(a, 69.0, 15) 94 95 call setup(a) 96 call teste(a, 44.0, 0, N) 97 call check(a, 44.0, 31) 98 99 call setup(a) 100 call testf(a, 39.0, 0, N) 101 call check(a, 39.0, 63) 102end program 103