Debian Codegraph @

gcc/testsuite/gfortran.dg/deferred_character_33.f90

raw
1 ! { dg-do run }
2 ! { dg-additional-sources deferred_character_33a.f90 }
3 ! PR fortran/90744 - this used to pass a wrong length
4 ! to an external function without a prototype.
5 ! Original test case by Tomáš Trnka.
6 module StringModule
7 implicit none
8
9 contains
10 function getstr()
11 character(:), allocatable :: getstr
12
13 getstr = 'OK'
14 end function
15 end module
16 module TestModule
17 use StringModule
18 implicit none
19
20 contains
21 subroutine DoTest()
22 if (.false.) then
23 call convrs('A',getstr())
24 else
25 call convrs('B',getstr())
26 end if
27 end subroutine
28 end module
29 program external_char_length
30 use TestModule
31
32 implicit none
33
34 call DoTest()
35 end program