diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/associate_36.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/associate_36.f90 | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/associate_36.f90 b/gcc/testsuite/gfortran.dg/associate_36.f90 new file mode 100644 index 00000000000..ba236b431aa --- /dev/null +++ b/gcc/testsuite/gfortran.dg/associate_36.f90 @@ -0,0 +1,28 @@ +! { dg-do run } +! +! Test the fix for PR83344. +! +! Contributed by <Janne Blomqvist <jb@gcc.gnu.org> +! +program foo + implicit none + character(len=1) a + character(len=2) b + character(len=3) c + a = 'a' + call bah(a, len (a)) + b = 'bb' + call bah(b, len (b)) + c = 'ccc' + call bah(c, len (c)) + contains + subroutine bah(x, clen) + implicit none + integer :: clen + character(len=*), intent(in) :: x + associate(y => x) + if (len(y) .ne. clen) stop 1 + if (y .ne. x) stop 2 + end associate + end subroutine bah +end program foo |