diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/deferred_character_33.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/deferred_character_33.f90 | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/deferred_character_33.f90 b/gcc/testsuite/gfortran.dg/deferred_character_33.f90 new file mode 100644 index 00000000000..ec864d83c31 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/deferred_character_33.f90 @@ -0,0 +1,35 @@ +! { dg-do run } +! { dg-additional-sources deferred_character_33a.f90 } +! PR fortran/90744 - this used to pass a wrong length +! to an external function without a prototype. +! Original test case by Tomáš Trnka. +module StringModule + implicit none + +contains + function getstr() + character(:), allocatable :: getstr + + getstr = 'OK' + end function +end module +module TestModule + use StringModule + implicit none + +contains + subroutine DoTest() + if (.false.) then + call convrs('A',getstr()) + else + call convrs('B',getstr()) + end if + end subroutine +end module +program external_char_length + use TestModule + + implicit none + + call DoTest() +end program |