summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/module_write_1.f90
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/module_write_1.f90
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
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.
Diffstat (limited to 'gcc/testsuite/gfortran.dg/module_write_1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/module_write_1.f9059
1 files changed, 59 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/module_write_1.f90 b/gcc/testsuite/gfortran.dg/module_write_1.f90
new file mode 100644
index 000000000..3b488ce55
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/module_write_1.f90
@@ -0,0 +1,59 @@
+! { dg-do compile }
+!
+! PR fortran/41869
+!
+! Was ICEing while module write of symbol 'vs_str' in m_dom_dom
+! because of "len" being private in fox_m_fsys_format.
+!
+module fox_m_fsys_array_str
+contains
+ pure function str_vs(vs) result(s)
+ character, dimension(:), intent(in) :: vs
+ character(len=size(vs)) :: s
+ s = transfer(vs, s)
+ end function str_vs
+ pure function vs_str(s) result(vs)
+ character(len=*), intent(in) :: s
+ character, dimension(len(s)) :: vs
+ vs = transfer(s, vs)
+ end function vs_str
+end module fox_m_fsys_array_str
+
+module fox_m_fsys_format
+ private
+ interface str
+ module procedure str_logical_array
+ end interface str
+ interface len
+ module procedure str_logical_array_len
+ end interface
+ public :: str
+contains
+ pure function str_logical_array_len(la) result(n)
+ logical, dimension(:), intent(in) :: la
+ end function str_logical_array_len
+ pure function str_logical_array(la) result(s)
+ logical, dimension(:), intent(in) :: la
+ character(len=len(la)) :: s
+ end function str_logical_array
+ pure function checkFmt(fmt) result(good)
+ character(len=*), intent(in) :: fmt
+ logical :: good
+ good = len(fmt) > 0
+ end function checkFmt
+end module fox_m_fsys_format
+
+module m_dom_dom
+ use fox_m_fsys_array_str, only: str_vs, vs_str
+end module m_dom_dom
+
+module FoX_dom
+ use fox_m_fsys_format
+ use m_dom_dom
+end module FoX_dom
+
+use FoX_dom
+implicit none
+print *, vs_str("ABC")
+end
+! { dg-final { cleanup-modules "fox_m_fsys_array_str fox_m_fsys_format m_dom_dom fox_dom" } }