OSDN Git Service

2010-04-08 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / assumed_charlen_sharing.f90
1 ! This testcase was miscompiled, because ts.cl
2 ! in function bar was initially shared between both
3 ! dummy arguments.  Although it was later unshared,
4 ! all expressions which copied ts.cl from bar2
5 ! before that used incorrectly bar1's length
6 ! instead of bar2.
7 ! { dg-do run }
8
9 subroutine foo (foo1, foo2)
10   implicit none
11   integer, intent(in) :: foo2
12   character(*), intent(in) :: foo1(foo2)
13 end subroutine foo
14
15 subroutine bar (bar1, bar2)
16   implicit none
17   character(*), intent(in) :: bar1, bar2
18
19   call foo ((/ bar2 /), 1)
20 end subroutine bar
21
22 program test
23   character(80) :: str1
24   character(5) :: str2
25
26   str1 = 'String'
27   str2 = 'Strng'
28   call bar (str2, str1)
29 end program test