Commit 36005795 by Roger Sayle Committed by Roger Sayle

where_10.f90: New test case.


	* gfortran.fortran-torture/execute/where_10.f90: New test case.
	* gfortran.fortran-torture/execute/where_11.f90: Likewise.
	* gfortran.fortran-torture/execute/where_12.f90: Likewise.
	* gfortran.fortran-torture/execute/where_13.f90: Likewise.
	* gfortran.fortran-torture/execute/where_14.f90: Likewise.
	* gfortran.fortran-torture/execute/where_15.f90: Likewise.
	* gfortran.fortran-torture/execute/where_16.f90: Likewise.

From-SVN: r111204
parent a3543e3a
2006-02-16 Roger Sayle <roger@eyesopen.com>
* gfortran.fortran-torture/execute/where_10.f90: New test case.
* gfortran.fortran-torture/execute/where_11.f90: Likewise.
* gfortran.fortran-torture/execute/where_12.f90: Likewise.
* gfortran.fortran-torture/execute/where_13.f90: Likewise.
* gfortran.fortran-torture/execute/where_14.f90: Likewise.
* gfortran.fortran-torture/execute/where_15.f90: Likewise.
* gfortran.fortran-torture/execute/where_16.f90: Likewise.
2006-02-16 Jeff Law <law@redhat.com>
* gcc.dg/tree-ssa/vrp24.c: Update expected output.
! Check whether conditional ELSEWHEREs work
! (with final unconditional ELSEWHERE)
program where_10
integer :: a(5)
integer :: b(5)
a = (/1, 2, 3, 4, 5/)
b = (/0, 0, 0, 0, 0/)
where (a .eq. 1)
b = 3
elsewhere (a .eq. 2)
b = 1
elsewhere (a .eq. 3)
b = 4
elsewhere (a .eq. 4)
b = 1
elsewhere
b = 5
endwhere
if (any (b .ne. (/3, 1, 4, 1, 5/))) &
call abort
end program
! Check whether conditional ELSEWHEREs work
! (without unconditional ELSEWHERE)
program where_11
integer :: a(5)
integer :: b(5)
a = (/1, 2, 3, 4, 5/)
b = (/0, 0, 0, 0, 0/)
where (a .eq. 1)
b = 3
elsewhere (a .eq. 2)
b = 1
elsewhere (a .eq. 3)
b = 4
elsewhere (a .eq. 4)
b = 1
elsewhere (a .eq. 5)
b = 5
endwhere
if (any (b .ne. (/3, 1, 4, 1, 5/))) &
call abort
end program
! Check empty WHEREs work
program where_12
integer :: a(5)
a = (/1, 2, 3, 4, 5/)
where (a .eq. 1)
endwhere
end program
! Check empty WHERE and empty ELSEWHERE works
program where_13
integer :: a(5)
a = (/1, 2, 3, 4, 5/)
where (a .eq. 2)
elsewhere
endwhere
end program
! Check whether an empty ELSEWHERE works
program where_14
integer :: a(5)
integer :: b(5)
a = (/1, 2, 3, 4, 5/)
b = (/0, 0, 0, 0, 0/)
where (a .eq. 1)
b = 3
elsewhere
endwhere
if (any (b .ne. (/3, 0, 0, 0, 0/))) &
call abort
end program
! Check whether an empty WHERE works
program where_15
integer :: a(5)
integer :: b(5)
a = (/1, 2, 3, 4, 5/)
b = (/0, 0, 0, 0, 0/)
where (a .eq. 1)
elsewhere
b = 2
endwhere
if (any (b .ne. (/0, 2, 2, 2, 2/))) &
call abort
end program
! Check whether nested WHEREs work
program where_16
integer :: a(9)
integer :: b(9)
integer :: c(9)
a = (/0, 0, 0, 1, 1, 1, 2, 2, 2/)
b = (/0, 1, 2, 0, 1, 2, 0, 1, 2/)
c = (/0, 0, 0, 0, 0, 0, 0, 0, 0/)
where (a .eq. 0)
where (b .eq. 0)
c = 1
else where (b .eq. 1)
c = 2
else where
c = 3
endwhere
elsewhere (a .eq. 1)
where (b .eq. 0)
c = 4
else where (b .eq. 1)
c = 5
else where
c = 6
endwhere
elsewhere
where (b .eq. 0)
c = 7
else where (b .eq. 1)
c = 8
else where
c = 9
endwhere
endwhere
if (any (c .ne. (/1, 2, 3, 4, 5, 6, 7, 8, 9/))) &
call abort
end program
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment