aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/associate_27.f90
blob: b677438d688f6a4951d009738099c8270fa7a11d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! { dg-do run }
!
! Test the fix for PR80120
!
! Contributed by Marco Restelli  <mrestelli@gmail.com>
!
program p
 implicit none

 type :: t
  character(len=25) :: text(2)
 end type t
 type(t) :: x

 x%text(1) = "ABC"
 x%text(2) = "defgh"

 associate( c => x%text )
   if (c(1)(:maxval(len_trim(c))) .ne. trim (x%text(1))) STOP 1
   if (c(2)(:maxval(len_trim(c))) .ne. trim (x%text(2))) STOP 2
 end associate

end program p