PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / array_constructor_type_6.f03
blob70211d5628c660590195aa32059a9d46b34582a0
1 ! { dg-do run }
2 ! { dg-options "-fbounds-check" }
4 ! PR fortran/27997
6 ! Array constructor with typespec.
8 program test
9   character(15) :: a(3)
10   character(10), volatile :: b(3)
11   b(1) = 'Takata'
12   b(2) = 'Tanaka'
13   b(3) = 'Hayashi'
15   a =  (/ character(len=7) :: trim(b(1)), trim(b(2)), trim(b(3)) /)
16   if (a(1) /= 'Takata' .or. a(2) /= 'Tanaka' .or. a(3) /= 'Hayashi') then
17     STOP 1
18   end if
20   a =  (/ character(len=2) :: trim(b(1)), trim(b(2)), trim(b(3)) /)
21   if (a(1) /= 'Ta' .or. a(2) /= 'Ta' .or. a(3) /= 'Ha') then
22     STOP 2
23   end if
25   a =  (/ character(len=8) :: trim(b(1)), trim(b(2)), trim(b(3)) /)
26   if (a(1) /= 'Takata' .or. a(2) /= 'Tanaka' .or. a(3) /= 'Hayashi') then
27     STOP 3
28   end if
30 end program test