2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / optional_dim_2.f90
blob41cbbf542aca6a6828c1d3d676d93ee7e04128b1
1 ! { dg-do run }
2 ! PR33317 CSHIFT/EOSHIFT: Rejects optional dummy for DIM=
3 ! Test case submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
4 program test
5 implicit none
6 call sub(bound=.false., dimmy=1_8)
7 call sub()
8 contains
9 subroutine sub(bound, dimmy)
10 integer(kind=8), optional :: dimmy
11 logical, optional :: bound
12 logical :: lotto(4)
13 character(20) :: testbuf
14 lotto = .false.
15 lotto = cshift((/.true.,.false.,.true.,.false./),1,dim=dimmy)
16 write(testbuf,*) lotto
17 if (trim(testbuf).ne." F T F T") call abort
18 lotto = .false.
19 lotto = eoshift((/.true.,.true.,.true.,.true./),1,boundary=bound,dim=dimmy)
20 lotto = eoshift(lotto,1,dim=dimmy)
21 write(testbuf,*) lotto
22 if (trim(testbuf).ne." T T F F") call abort
23 end subroutine
24 end program test