From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gfortran.dg/intrinsic_actual_2.f90 | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/intrinsic_actual_2.f90 (limited to 'gcc/testsuite/gfortran.dg/intrinsic_actual_2.f90') diff --git a/gcc/testsuite/gfortran.dg/intrinsic_actual_2.f90 b/gcc/testsuite/gfortran.dg/intrinsic_actual_2.f90 new file mode 100644 index 000000000..d7a9c0d87 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/intrinsic_actual_2.f90 @@ -0,0 +1,44 @@ +! { dg-do compile } +! Tests the fix for PR29387, in which array valued arguments of +! LEN and ASSOCIATED would cause an ICE. +! +! Contributed by Francois-Xavier Coudert +! + integer :: ans + TYPE T1 + INTEGER, POINTER :: I=>NULL() + END TYPE T1 + type(T1), pointer :: tar(:) + + character(20) res + + j = 10 + PRINT *, LEN(SUB(8)), ans + PRINT *, LEN(SUB(j)), ans +! print *, len(SUB(j + 2)//"a"), ans ! This still fails (no charlen). + print *, len(bar(2)), ans + + IF(.NOT.ASSOCIATED(F1(10))) CALL ABORT() + deallocate (tar) + +CONTAINS + + FUNCTION SUB(I) + CHARACTER(LEN=I) :: SUB(1) + ans = LEN(SUB(1)) + SUB = "" + END FUNCTION + + FUNCTION BAR(I) + CHARACTER(LEN=I*10) :: BAR(1) + ans = LEN(BAR) + BAR = "" + END FUNCTION + + FUNCTION F1(I) RESULT(R) + TYPE(T1), DIMENSION(:), POINTER :: R + INTEGER :: I + ALLOCATE(tar(I)) + R => tar + END FUNCTION F1 +END -- cgit v1.2.3