diff options
author | Steven G. Kargl <kargls@comcast.net> | 2005-01-08 18:31:40 +0100 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-01-08 18:31:40 +0100 |
commit | 1dba11822e73daaaf1afc31ab17d616d85c217e3 (patch) | |
tree | d43fb74f04e9e8557cb2389a7bb093c4e6c1fb71 /gcc/testsuite | |
parent | 4634cf7ee2a5a8a322288125746cd4c28b0dceab (diff) | |
download | gcc-1dba11822e73daaaf1afc31ab17d616d85c217e3.zip gcc-1dba11822e73daaaf1afc31ab17d616d85c217e3.tar.gz gcc-1dba11822e73daaaf1afc31ab17d616d85c217e3.tar.bz2 |
select_2.f90, [...]: New.
* gfortran.dg/select_2.f90, gfortran.dg/select_3.f90,
gfortran.dg/select_4.f90: New.
From-SVN: r93087
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/select_2.f90 | 18 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/select_3.f90 | 19 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/select_4.f90 | 16 |
4 files changed, 59 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9d46008..55a54aa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-01-08 Steven G. Kargl <kargls@comcast.net> + + * gfortran.dg/select_2.f90, gfortran.dg/select_3.f90, + gfortran.dg/select_4.f90: New. + 2005-01-07 Jakub Jelinek <jakub@redhat.com> * gcc.c-torture/execute/20050107-1.c: New test. @@ -526,7 +531,7 @@ * cpp/inc/pragma-once-1a.h: Likewise. 2004-12-15 Bud Davis <bdavis9659@comcast.net> - Steven G. Kargle <kargls@comcast.net> + Steven G. Kargl <kargls@comcast.net> PR fortran/17597 * gfortran.dg/list_read_3.f90: New test. diff --git a/gcc/testsuite/gfortran.dg/select_2.f90 b/gcc/testsuite/gfortran.dg/select_2.f90 new file mode 100644 index 0000000..5859ee3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/select_2.f90 @@ -0,0 +1,18 @@ +! { dg-do run } +! Simple test for SELECT CASE +! +program select_2 + integer i + do i = 1, 4 + select case(i) + case (1) + if (i /= 1) call abort + case (2:3) + if (i /= 2 .and. i /= 3) call abort + case (4) + if (i /= 4) call abort + case default + call abort + end select + end do +end program select_2 diff --git a/gcc/testsuite/gfortran.dg/select_3.f90 b/gcc/testsuite/gfortran.dg/select_3.f90 new file mode 100644 index 0000000..022b682 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/select_3.f90 @@ -0,0 +1,19 @@ +! [dg-do run } +! Simple test program to see if gfortran eliminates the 'case (3:2)' +! statement. This is an unreachable CASE because the range is empty. +! +program select_3 + integer i + do i = 1, 4 + select case(i) + case (1) + if (i /= 1) call abort + case (3:2) + call abort + case (4) + if (i /= 4) call abort + case default + if (i /= 2 .and. i /= 3) call abort + end select + end do +end program select_3 diff --git a/gcc/testsuite/gfortran.dg/select_4.f90 b/gcc/testsuite/gfortran.dg/select_4.f90 new file mode 100644 index 0000000..8c410fc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/select_4.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! Short test program with a CASE statement that uses a range. +! +program select_4 + integer i + do i = 1, 40, 4 + select case(i) + case (:5) + if (i /= 1 .and. i /= 5) call abort + case (20:30) + if (i /= 21 .and. i /= 25 .and. i /= 29) call abort + case (34:) + if (i /= 37) call abort + end select + end do +end program select_4 |