[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-fortran
Subject:    [PATCH] Fix gfortran.dg/unlimited_polymorphic_13.f90
From:       Andreas Schwab <schwab () linux-m68k ! org>
Date:       2014-03-17 9:23:26
Message-ID: 87k3bt2n75.fsf () igel ! home
[Download RAW message or body]

Tested on {x86_64,m68k}-suse-linux and installed as obvious.

Andreas.

	PR testsuite/58851
	* gfortran.dg/unlimited_polymorphic_13.f90: Properly compute
	storage size.
---
 gcc/testsuite/gfortran.dg/unlimited_polymorphic_13.f90 | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_13.f90 \
b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_13.f90 index 0e27b17..8225738 \
                100644
--- a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_13.f90
+++ b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_13.f90
@@ -23,18 +23,24 @@ contains
     integer :: k
     integer :: sz
 
+    sz = 0
     select case (k)
      case (4)
       sz = storage_size(r1)*2
+    end select
+    select case (k)
      case (8)
       sz = storage_size(r2)*2
-     case (10)
+    end select
+    select case (k)
+     case (real_kinds(size(real_kinds)-1))
       sz = storage_size(r3)*2
-     case (16)
+    end select
+    select case (k)
+     case (real_kinds(size(real_kinds)))
       sz = storage_size(r4)*2
-     case default
-       call abort()
     end select
+    if (sz .eq. 0) call abort()
 
     if (storage_size(o) /= sz) call abort()
 
-- 
1.9.0

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic