diff gcc/testsuite/gfortran.dg/realloc_on_assign_16a.f90 @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gfortran.dg/realloc_on_assign_16a.f90	Thu Oct 25 07:37:49 2018 +0900
@@ -0,0 +1,29 @@
+! { dg-do compile }
+! { dg-options "-Ofast -fno-tree-forwprop" }
+! Test that PR 82976 is fixed, this used to ICE.
+!
+! Contributed by Stefan Mauerberger  <stefan.mauerberger@gmail.com>
+!
+PROGRAM main
+    !USE MPI
+
+    TYPE :: test_typ
+        REAL, ALLOCATABLE :: a(:)
+    END TYPE
+
+    TYPE(test_typ) :: xx, yy
+    TYPE(test_typ), ALLOCATABLE :: conc(:)
+
+    !CALL MPI_INIT(i)
+
+    xx = test_typ( [1.0,2.0] )
+    yy = test_typ( [4.0,4.9] )
+
+    conc = [ xx, yy ]
+
+    if (any (int (10.0*conc(1)%a) .ne. [10,20])) STOP 1
+    if (any (int (10.0*conc(2)%a) .ne. [40,49])) STOP 2
+
+    !CALL MPI_FINALIZE(i)
+
+END PROGRAM main