summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2013-01-05 13:20:08 +0000
committerMikael Morin <mikael@gcc.gnu.org>2013-01-05 13:20:08 +0000
commitd00be3a3a3747f72ebe0dd45ade214c5e4944f0a (patch)
tree38bcf78f6b520d21c46b008748295d557020b2a4 /gcc/testsuite
parent9e04287b861dc1cc8f19dce11b9c3147213c34b7 (diff)
downloadgcc-d00be3a3a3747f72ebe0dd45ade214c5e4944f0a.tar.gz
re PR fortran/55827 (ICE with multiple fortran modules and character lenght determined by an interfaced pure function)
2013-01-05 Steven G. Kargl <kargl@gcc.gnu.org> Mikael Morin <mikael@gcc.gnu.org> PR fortran/55827 * class.c (gfc_fix_class_refs): Adapt ts initialization for the case e->symtree == NULL. * trans-expr.c (gfc_conv_function_expr): Init sym earlier. Use it. 2013-01-05 Steven G. Kargl <kargl@gcc.gnu.org> Mikael Morin <mikael@gcc.gnu.org> PR fortran/55827 * gfortran.dg/use_22.f90: New test. Co-Authored-By: Mikael Morin <mikael@gcc.gnu.org> From-SVN: r194928
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/use_22.f9035
2 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 388d1cef143..e730140f5b1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-05 Steven G. Kargl <kargl@gcc.gnu.org>
+ Mikael Morin <mikael@gcc.gnu.org>
+
+ * gfortran.dg/use_22.f90: New test.
+
2013-01-04 Andrew Pinski <apinski@cavium.com>
* gcc.target/aarch64/cmp-1.c: New testcase.
diff --git a/gcc/testsuite/gfortran.dg/use_22.f90 b/gcc/testsuite/gfortran.dg/use_22.f90
new file mode 100644
index 00000000000..d61df671322
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/use_22.f90
@@ -0,0 +1,35 @@
+! { dg-do compile }
+!
+! PR fortran/55827
+! gfortran used to ICE with the call to `tostring' depending on how the
+! `tostring' symbol was USE-associated.
+!
+! Contributed by Lorenz Hüdepohl <bugs@stellardeath.org>
+
+module stringutils
+ interface
+ pure function strlen(handle) result(len)
+ integer, intent(in) :: handle
+ integer :: len
+ end function
+ end interface
+end module
+module intermediate ! does not die if this module is merged with stringutils
+ contains
+ function tostring(handle) result(string)
+ use stringutils
+ integer, intent(in) :: handle
+ character(len=strlen(handle)) :: string
+ end function
+end module
+module usage
+ contains
+ subroutine dies_here(handle)
+ use stringutils ! does not die if this unnecessary line is omitted or placed after "use intermediate"
+ use intermediate
+ integer :: handle
+ write(*,*) tostring(handle) ! ICE
+ end subroutine
+end module
+
+