view gcc/testsuite/gfortran.dg/associate_27.f90 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { 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