Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / restricted_expression_2.f90
blob9c281664a84133897430f7af66746d2977c22e25
1 ! { dg-do compile }
2 ! { dg-options "-pedantic -ffixed-form" }
4 ! PR fortran/35723
5 ! Check that a program using a local variable subscript is still rejected.
7 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
9 call vf0016( 1, 2, 3)
11 end
12 SUBROUTINE VF0016(nf1,nf2,nf3)
13 CHARACTER(LEN=9,KIND=1),DIMENSION(3), PARAMETER
14 $ :: TEST_STRINGS =
15 $ (/' HI','ABC ',' CDEFG '/)
16 INTEGER :: i = 2
17 CHARACTER :: TEST_ARRAY
18 $(LEN_TRIM(ADJUSTL(TEST_STRINGS(i))), ! { dg-error "'i' cannot appear" }
19 $ SUM(LEN_TRIM(ADJUSTL(TEST_STRINGS))),
20 $ LEN_TRIM(ADJUSTL(ADJUSTR(TEST_STRINGS(3)))),
21 $ SUM(LEN_TRIM(ADJUSTL(ADJUSTR(TEST_STRINGS(NF1:NF3:NF2))))) )
23 print *, 2, 10, 5, 7
24 print *, shape (test_array)
25 end