Debian Codegraph @

gcc/testsuite/gfortran.dg/restricted_expression_2.f90

raw
1 ! { dg-do compile }
2 ! { dg-options "-pedantic -ffixed-form" }
3
4 ! PR fortran/35723
5 ! Check that a program using a local variable subscript is still rejected.
6
7 ! Contributed by Tobias Burnus <[email protected]>
8
9 call vf0016( 1, 2, 3)
10
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))))) )
22
23 print *, 2, 10, 5, 7
24 print *, shape (test_array)
25 end