OSDN Git Service

2010-07-24 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / bounds_check_strlen_9.f90
1 ! { dg-do run }
2 ! { dg-options "-fbounds-check" }
3 !
4 ! PR fortran/40452
5 ! The following program is valid Fortran 90 and later.
6 ! The storage-sequence association of the dummy argument
7 ! allows that the actual argument ["ab", "cd"] is mapped
8 ! to the dummy argument a(1) which perfectly fits.
9 ! (The dummy needs to be an array, however.)
10 !
11
12 program test
13   implicit none
14   call sub(["ab", "cd"])
15 contains
16   subroutine sub(a)
17    character(len=4) :: a(1)
18    print *, a(1)
19   end subroutine sub
20 end program test