This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [3.3 branch, Fortran, committed] was: [Trunk, Fortran,committed]Patch to enable use of any kind integer in case statements.
- From: bud davis <bdavis11 at directvinternet dot com>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: toon at moene dot indiv dot nluug dot nl, gcc-patches at gcc dot gnu dot org
- Date: 08 Jan 2003 22:19:55 -0600
- Subject: Re: [3.3 branch, Fortran, committed] was: [Trunk, Fortran,committed]Patch to enable use of any kind integer in case statements.
- References: <200301041434.JAA09709@caip.rutgers.edu>
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