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. --- .../gfortran.dg/recursive_statement_functions.f90 | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/recursive_statement_functions.f90 (limited to 'gcc/testsuite/gfortran.dg/recursive_statement_functions.f90') diff --git a/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90 b/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90 new file mode 100644 index 000000000..bcf51f8d5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90 @@ -0,0 +1,33 @@ +! { dg-do compile } +! { dg-options "-std=legacy" } +! +! PR20866 - A statement function cannot be recursive. +! Contributed by Joost VandeVondele +! +! Modified 20051110 to check that regressions PR24655 and PR24755 +! are fixed. Thanks to pavarini@pv.infn.it and tdeutsch@cea.fr for +! the tests. +! + INTEGER :: i, st1, st2, st3, lambda, n + REAL :: x, z(2,2) + character(8) :: ch + real(8) :: fi, arg, sigma, dshpfunc + real(8), parameter :: one=1d0 +! +! Test check for recursion via other statement functions, string +! length references, function actual arguments and array index +! references. +! + st1 (i) = len (ch(st2 (1):8)) + st2 (i) = max (st3 (1), 4) + st3 (i) = 2 + cos (z(st1 (1), i)) ! { dg-error "is recursive" } +! +! Test the two regressions. +! + fi (n) = n *one + dshpfunc (arg)=-lambda/sigma*(arg/sigma)**(lambda-1)*exp(-(arg/sigma)**lambda) +! +! References to each statement function. +! + write(6,*) st1 (1), fi (2), dshpfunc (1.0_8) + END -- cgit v1.2.3