OSDN Git Service

* lib/gcc-dg.exp (cleanup-modules): New proc.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / allocate_char_star_scalar_1.f90
1 ! { dg-do compile }
2 ! Tests the patch for PR26038 that used to ICE in gfc_trans_allocate
3 ! for the want of a string_length to pass to the library.
4 ! Contributed by hjl@lucon.org && Erik Edelmann  <eedelmanncc.gnu.org>
5 module moo
6
7 contains
8
9     subroutine foo(self)
10         character(*) :: self
11         pointer :: self
12
13         nullify(self)
14         allocate(self)          ! Used to ICE here
15         print *, len(self)
16     end subroutine
17
18 end module moo
19
20
21 program hum
22
23     use moo
24
25     character(5), pointer :: p
26     character(10), pointer :: q
27
28     call foo(p)
29     call foo(q)
30
31 end program hum
32
33 ! { dg-final { cleanup-modules "moo" } }