OSDN Git Service

2008-03-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Mar 2008 03:13:17 +0000 (03:13 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Mar 2008 03:13:17 +0000 (03:13 +0000)
PR fortran/35475
* gfortran.dg/derived_sub.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133205 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 919025d..7ae9de1 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