gcc/testsuite/gfortran.dg/charlen_17.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! PR 87673 - used to cause errors about non-pure functions. |
| 3 | |
| 4 | module x |
| 5 | implicit none |
| 6 | contains |
| 7 | pure function foo() result(res) |
| 8 | character(len=:), allocatable :: res |
| 9 | allocate (character(bar()) :: res) |
| 10 | end function foo |
| 11 | pure integer function bar() |
| 12 | bar = 1 |
| 13 | end function bar |
| 14 | end module x |