re PR fortran/35475 (gfortran fails to compile valid code with ICE erro in fold-const.c)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 14 Mar 2008 03:13:17 +0000 (03:13 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 14 Mar 2008 03:13:17 +0000 (03:13 +0000)
2008-03-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/35475
* gfortran.dg/derived_sub.f90: New test.

From-SVN: r133205

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/derived_sub.f90 [new file with mode: 0644]

index 919025dc3edac45a19610de406cf800b0fdf0dad..7ae9de185894e6fc65d97a23064dcf550e331a36 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/35475
+       * gfortran.dg/derived_sub.f90: New test.
+
 2008-03-13  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR testsuite/35558
diff --git a/gcc/testsuite/gfortran.dg/derived_sub.f90 b/gcc/testsuite/gfortran.dg/derived_sub.f90
new file mode 100644 (file)
index 0000000..1750ada
--- /dev/null
@@ -0,0 +1,33 @@
+! { dg-do compile }
+! PR35475  gfortran fails to compile valid code with ICE error in fold-const.c
+! Test case from PR report added to avoid future regression
+module modone
+  type mytype
+    real :: myvar
+  end type
+end module
+
+module modtwo
+  interface
+    subroutine subone(mytype_cur)
+      use modone
+      type (mytype) mytype_cur
+    end subroutine
+  end interface
+
+contains
+
+  subroutine subtwo(mytype_cur)
+    use modone
+    type (mytype) mytype_cur,mytype_fin
+    mytype_fin=mytype_cur
+    return
+  end subroutine
+
+  subroutine subthree(mytype_cur)
+    use modone
+    type (mytype) mytype_cur
+    call subone(mytype_cur)
+  end subroutine 
+
+end module