OSDN Git Service

2010-04-06 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / char_length_14.f90
1 ! { dg-do run }\r
2 ! PR35937, in which letting the length of 'c' to kind = 8 would\r
3 ! screw up the interface and would cause an ICE. Note that this is\r
4 ! actually the example of comment #4.\r
5 !\r
6 ! Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>\r
7 !\r
8 program main\r
9   implicit none\r
10   if (f5 ('1') .ne. "a") call abort\r
11   if (len (f5 ('1')) .ne. 1) call abort\r
12   if (f5 ('4') .ne. "abcd") call abort\r
13   if (len (f5 ('4')) .ne. 4) call abort\r
14 contains\r
15   function f5 (c)\r
16     character(len=1_8) :: c\r
17     character(len=scan('123456789', c)) :: f5\r
18     integer :: i\r
19     do i = 1, len (f5)\r
20        f5(i:i) = char (i+96)\r
21     end do\r
22   end function f5\r
23 end program main\r