This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [3.3 branch, Fortran, committed] was: [Trunk, Fortran,committed]Patch to enable use of any kind integer in case statements.


On Sat, 2003-01-04 at 08:34, Kaveh R. Ghazi wrote:
>  >  > Toon Moene wrote:
>  >  > 
>  >  > I committed the attached patch after bootstrap, check (C and
>  >  > Fortran only) on powerpc-unknown-linux-gnu (Debian testing as of
>  >  > three weeks ago).
>  >  > 
>  >  > It allows use of INTEGER*{1,2,8} in CASE statements and issues a
>  >  > warning when the case labels exceed the range of the KIND.
>  > 
>  >  And ditto for the 3.3 branch (it's a bug that this wasn't supported).
> 
> Testcases?
> 
> --
> Kaveh R. Ghazi			ghazi@caip.rutgers.edu
> 


Attached is a testcase for the above mentioned patch. The file should go
in gcc/testsuite/g77.f-torture/execute/select.f, please.
 
And of course, it does PASS on a current cvs checkout of gcc:)

--bud davis

       IMPLICIT NONE 
C this test demonstrates the acceptance of all integer types
C in SELECT / CASE 
C
       INTEGER*1 IB /1/
       INTEGER*2 IH /2/
       INTEGER*4 IW /3/
       INTEGER*8 ID /4/
C
C
       SELECT CASE (IB)
       CASE (1)
       CASE (2)
          CALL ABORT
       CASE (3)
          CALL ABORT
       CASE DEFAULT
          CALL ABORT
       END SELECT

       SELECT CASE (IH)
       CASE (1)
          CALL ABORT
       CASE (2)
       CASE (3)
          CALL ABORT
       CASE DEFAULT
          CALL ABORT
       END SELECT

       SELECT CASE (IW)
       CASE (1)
          CALL ABORT 
       CASE (2)
          CALL ABORT
       CASE (3)
       CASE DEFAULT
          CALL ABORT
       END SELECT

       SELECT CASE (ID)
       CASE (1)
          CALL ABORT
       CASE (2)
          CALL ABORT
       CASE (3)
          CALL ABORT
       CASE DEFAULT
       END SELECT

       END


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]