diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2007-01-15 08:16:17 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2007-01-15 08:16:17 +0000 |
commit | 9ebe2d22e7201bca8e75111ec66ccae8454896ae (patch) | |
tree | a550028d50f83d692906ac5ccf4710e018f70359 /gcc/testsuite/gfortran.dg/stfunc_4.f90 | |
parent | 32d6b8aef41aa68e506f2e66ca10b1fdafbb3aaf (diff) | |
download | gcc-9ebe2d22e7201bca8e75111ec66ccae8454896ae.tar.gz |
re PR fortran/28172 ([4.2 and 4.1 only] alternate return in contained procedure segfaults)
2007-01-15 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28172
* trans-stmt.c (gfc_trans_call): If it does not have one, get
a backend_decl for an alternate return.
PR fortran/29389
* resolve.c (pure_function): Statement functions are pure. Note
that this will have to recurse to comply fully with F95.
PR fortran/29712
* resolve.c (resolve_function): Only a reference to the final
dimension of an assumed size array is an error in an inquiry
function.
PR fortran/30283
* resolve.c (resolve_function): Make sure that the function
expression has a type.
2007-01-15 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28172
* gfortran.dg/altreturn_4.f90: New test.
PR fortran/29389
* gfortran.dg/stfunc_4.f90: New test.
PR fortran/29712
* gfortran.dg/bound_2.f90: Reinstate commented out line.
* gfortran.dg/initialization_1.f90: Change warning.
PR fortran/30283
* gfortran.dg/specification_type_resolution_2.f90: New test.
From-SVN: r120790
Diffstat (limited to 'gcc/testsuite/gfortran.dg/stfunc_4.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/stfunc_4.f90 | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/stfunc_4.f90 b/gcc/testsuite/gfortran.dg/stfunc_4.f90 new file mode 100644 index 00000000000..e995fb86bec --- /dev/null +++ b/gcc/testsuite/gfortran.dg/stfunc_4.f90 @@ -0,0 +1,19 @@ +! { dg-do run } +! Tests the fix for PR29389, in which the statement function would not be +! recognised as PURE within a PURE procedure. + +! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + INTEGER :: st1, i = 99, a(4), q = 6 + st1 (i) = i * i * i + FORALL(i=1:4) a(i) = st1 (i) + FORALL(i=1:4) a(i) = u (a(i)) - a(i)** 2 + if (any (a .ne. 0)) call abort () + if (i .ne. 99) call abort () +contains + pure integer function u (x) + integer,intent(in) :: x + st2 (i) = i * i + u = st2(x) + end function +end |