summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/g77/19990419-1.f
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/g77/19990419-1.f')
-rw-r--r--gcc/testsuite/gfortran.dg/g77/19990419-1.f22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/g77/19990419-1.f b/gcc/testsuite/gfortran.dg/g77/19990419-1.f
new file mode 100644
index 000000000..e6a4a9bc0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/g77/19990419-1.f
@@ -0,0 +1,22 @@
+c { dg-do run }
+* Test DO WHILE, to make sure it fully reevaluates its expression.
+* Belongs in execute/.
+ common /x/ ival
+ j = 0
+ do while (i() .eq. 1)
+ j = j + 1
+ if (j .gt. 5) call abort
+ end do
+ if (j .ne. 4) call abort
+ if (ival .ne. 5) call abort
+ end
+ function i()
+ common /x/ ival
+ ival = ival + 1
+ i = 10
+ if (ival .lt. 5) i = 1
+ end
+ block data
+ common /x/ ival
+ data ival/0/
+ end