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
9subroutine foo (foo1, foo2)
10  implicit none
11  integer, intent(in) :: foo2
12  character(*), intent(in) :: foo1(foo2)
13end subroutine foo
14
15subroutine bar (bar1, bar2)
16  implicit none
17  character(*), intent(in) :: bar1, bar2
18
19  call foo ((/ bar2 /), 1)
20end subroutine bar
21
22program test
23  character(80) :: str1
24  character(5) :: str2
25
26  str1 = 'String'
27  str2 = 'Strng'
28  call bar (str2, str1)
29end program test
30