aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/emptyif.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/emptyif.f90')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/emptyif.f9020
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/emptyif.f90 b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/emptyif.f90
new file mode 100644
index 000000000..0c19fa571
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/emptyif.f90
@@ -0,0 +1,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
+