diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/auto_char_len_1.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/auto_char_len_1.f90 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/auto_char_len_1.f90 b/gcc/testsuite/gfortran.dg/auto_char_len_1.f90 new file mode 100644 index 000000000..628e6e914 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/auto_char_len_1.f90 @@ -0,0 +1,27 @@ +! { dg-do compile } +! { dg-options "" } +! [option to disable -pedantic as assumed character length +! functions are obsolescent] +! +! PR fortran/41235 +! + +character(len=*) function func() + func = 'ABC' +end function func + +subroutine test(i) + integer :: i + character(len=i), external :: func + print *, func() +end subroutine test + +subroutine test2(i) + integer :: i + character(len=i) :: func + print *, func() +end subroutine test2 + +call test(2) +call test2(2) +end |