re PR fortran/65045 ([F08] ICE when using the same name for a block and a variable)
authorPaul Thomas <pault@gcc.gnu.org>
Sun, 3 Jan 2016 20:55:19 +0000 (20:55 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Sun, 3 Jan 2016 20:55:19 +0000 (20:55 +0000)
2016-01-03  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/65045
* gfortran.dg/pr65045.f90: New test.

From-SVN: r232042

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr65045.f90 [new file with mode: 0644]

index 27a03a062c85e232d54e3e147f9ddf23333e7c48..91499e3d6aa1e8fab5ae940ab2f1661e61fea156 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-03  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/65045
+       * gfortran.dg/pr65045.f90: New test.
+
 2016-01-02  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/specs/debug1.ads: Delete.
diff --git a/gcc/testsuite/gfortran.dg/pr65045.f90 b/gcc/testsuite/gfortran.dg/pr65045.f90
new file mode 100644 (file)
index 0000000..5b838d5
--- /dev/null
@@ -0,0 +1,15 @@
+! { dg-do compile }
+!
+! Contributed by Walt Brainerd  <walt.brainerd@gmail.com>
+!
+real :: i = 9.9
+i:block
+ if (i>7.7) then ! { dg-error "is not appropriate for an expression" }
+     exit i
+   else          ! { dg-error "Unexpected ELSE statement" }
+     i = 2.2     ! { dg-error "is not a variable" }
+   end if        ! { dg-error "Expecting END BLOCK statement" }
+end block i      ! { dg-error "Expecting END PROGRAM statement" }
+print*,i         ! { dg-error "not appropriate for an expression" }
+end
+! { dg-excess-errors "Unexpected end of file" }