summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.fortran-torture/execute/emptyif.f90
blob: 0c19fa57108f1be4aa40dde85ab3792a8aab0c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! Test empty if statements.  We Used to fail this because we folded
! the if stmt before we finished building it.
program emptyif
  implicit none
  integer i
  
  i=1
  if(i .le. 0) then
  else
    i = 2
  endif
  if (i .ne. 2) call abort()

  if (i .eq. 0) then
  elseif (i .eq. 2) then
    i = 3
  end if
  if (i .ne. 3) call abort()
end