re PR fortran/15314 (ICE caused by array initializer in derived type definition)
authorPaul Brook <pbrook@gcc.gnu.org>
Thu, 13 May 2004 23:22:13 +0000 (23:22 +0000)
committerPaul Brook <pbrook@gcc.gnu.org>
Thu, 13 May 2004 23:22:13 +0000 (23:22 +0000)
PR fortran/15314
* gfortran.fortran-torture/execute/der_init_s.f90: New test.

From-SVN: r81818

gcc/fortran/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.fortran-torture/execute/der_init_2.f90 [new file with mode: 0644]

index e32d1885ed81d28b9a05f011f8d46df684e0fc82..8939fc452d35cb9847e6ad1ecee4b020a1035333 100644 (file)
@@ -1,4 +1,4 @@
-2004-05-13  Paul Brook  <paul@codesourcery.com>
+2004-05-13  Victor Leikehman  <lei@haifasphere.co.il>
 
        PR fortran/15314
        * trans-expr.c (gfc_conv_structure): Use field type, not expr type.
index 65705ecedc936e3d154312f71b448c451cf98142..4ac96daa5626b400bee4602f61eac8d88087dcbb 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-13  Paul Brook  <paul@codesourcery.com>
+
+       PR fortran/15314
+       * gfortran.fortran-torture/execute/der_init_s.f90: New test.
+
 2004-05-13  Andrew Pinski  <pinskia@physics.uc.edu>
 
        * gcc.dg/uninit-H.c: Test for __PPC__ and __ppc__
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/der_init_2.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/der_init_2.f90
new file mode 100644 (file)
index 0000000..d0448a5
--- /dev/null
@@ -0,0 +1,15 @@
+! PR 15314
+! We were looking at the type of the initialization expression, not the type
+! of the field.
+program der_init_2
+  implicit none
+  type foo
+    integer :: a(3) = 42
+    integer :: b = 123
+  end type
+
+  type (foo) :: v
+
+  if ((v%b .ne. 123) .or. any (v%a .ne. 42)) call abort ();
+end program
+