diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/pure_byref_1.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/pure_byref_1.f90 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pure_byref_1.f90 b/gcc/testsuite/gfortran.dg/pure_byref_1.f90 new file mode 100644 index 000000000..5e080e5af --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pure_byref_1.f90 @@ -0,0 +1,15 @@ +! { dg-do run } +! PR 22607: PURE/ELEMENTAL return-by-reference functions +program main + implicit none + character(2), dimension(2) :: a, b + a = 'ok' + b = fun(a) + if (.not.all(b == 'ok')) call abort() +contains + elemental function fun(a) + character(*), intent(in) :: a + character(len(a)) :: fun + fun = a + end function fun +end program main |