Daily bump.
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / strarray_4.f90
blob29eac73e0ea9e17f191988bf27d15cc0587899e0
1 program strarray_4
2 character(len=5), dimension(2) :: c
4 c(1) = "Hello"
5 c(2) = "World"
7 call foo1(c)
8 call foo2(c, 2)
9 call foo3(c, 5, 2)
10 contains
11 subroutine foo1(a)
12 implicit none
13 character(len=5), dimension(2) :: a
14 character(len=5), dimension(2) :: b
16 b = a;
17 if ((b(1) .ne. "Hello") .or. (b(2) .ne. "World")) STOP 1
18 end subroutine
20 subroutine foo2(a, m)
21 implicit none
22 integer m
23 character(len=5), dimension(m) :: a
24 character(len=5), dimension(m) :: b
26 b = a
27 if ((b(1) .ne. "Hello") .or. (b(2) .ne. "World")) STOP 2
28 end subroutine
30 subroutine foo3(a, n, m)
31 implicit none
32 integer n, m
33 character(len=n), dimension(m) :: a
34 character(len=n), dimension(m) :: b
36 b = a
37 if ((b(1) .ne. "Hello") .or. (b(2) .ne. "World")) STOP 3
38 end subroutine
39 end program