re PR fortran/16938 (Internal compiler error using constructor of derived type that...
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Mon, 27 Sep 2004 16:01:58 +0000 (18:01 +0200)
committerTobias Schlüter <tobi@gcc.gnu.org>
Mon, 27 Sep 2004 16:01:58 +0000 (18:01 +0200)
PR fortran/16938
* gfortran.dg/pr16938.f90: New test.

From-SVN: r88180

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

index 36f51a14b95e50e7cdb0ca7c6dd1406bba681f4a..092fb986ecf1517366cffaa59a1122059bd99f7e 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-27  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/16938
+       * gfortran.dg/pr16938.f90: New test.
+
 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/17585
diff --git a/gcc/testsuite/gfortran.dg/pr16938.f90 b/gcc/testsuite/gfortran.dg/pr16938.f90
new file mode 100644 (file)
index 0000000..8a9c286
--- /dev/null
@@ -0,0 +1,27 @@
+! { dg-do run }
+! We used to get an internal error in the backend when trying to compile this
+! Added some code which verifies that we're actually doing the right thing.
+  program Array_List 
+    implicit none 
+    type :: Compound 
+      integer                       :: Count 
+      character (len = 4)           :: Name 
+    end type Compound 
+
+    type :: Table 
+      type (Compound)               :: Data (2)  
+      integer :: L_Size  
+    end type Table 
+    type (Table) :: ElementTable
+    ElementTable%Data(1) = Compound(1,"one")
+    ElementTable%Data(2) = Compound(2,"two")
+    ElementTable%L_size  = 2 
+
+    if (elementtable%data(1)%count /= 1) call abort
+    if (elementtable%data(2)%count /= 2) call abort
+    if (elementtable%data(1)%name /= "one ") call abort
+    if (elementtable%data(2)%name /= "two ") call abort
+    if (elementtable%l_size /= 2) call abort
+  end program Array_List