OSDN Git Service

PR testsuite/51875
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / auto_char_dummy_array_3.f90
1 ! { dg-do run }
2
3 ! PR fortran/49885
4 ! Check that character arrays with non-constant char-length are handled
5 ! correctly.
6
7 ! Contributed by Daniel Kraft <d@domob.eu>,
8 ! based on original test case and variant by Tobias Burnus in comment 2.
9
10 PROGRAM main
11   IMPLICIT NONE
12
13   CALL s (10)
14       
15 CONTAINS
16
17   SUBROUTINE s (nb)
18     INTEGER :: nb
19     CHARACTER(MAX (80, nb)) :: bad_rec(1)
20
21     bad_rec(1)(1:2) = 'abc'
22     IF (bad_rec(1)(1:2) /= 'ab') CALL abort ()
23   END SUBROUTINE s
24
25 END PROGRAM main