* cfgloopmanip.c (duplicate_loop_to_header_edge): Cleanup profile
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocate_error_5.f90
blob4e5f4bd3b30124b64ffd3ff8d2a372c618901d06
1 ! { dg-do run }
2 ! { dg-additional-options "-fcheck=mem" }
3 ! { dg-shouldfail "Fortran runtime error: Assignment of scalar to unallocated array" }
5 ! This omission was encountered in the course of fixing PR54070. Whilst this is a
6 ! very specific case, others such as allocatable components have been tested.
8 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
10 function g(a) result (res)
11 character(len=*) :: a
12 character(len=:),allocatable :: res(:)
13 res = a ! Since 'res' is not allocated, a runtime error should occur.
14 end function
16 interface
17 function g(a) result(res)
18 character(len=*) :: a
19 character(len=:),allocatable :: res(:)
20 end function
21 end interface
22 print *, g("ABC")
23 end