OSDN Git Service

2011-09-26 Janus Weil <janus@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / exit_2.f08
1 ! { dg-do compile }
2 ! { dg-options "-std=f2008" }
3
4 ! PR fortran/44709
5 ! Check that the resolving of loop names in parent namespaces introduced to
6 ! handle intermediate BLOCK's does not go too far and other sanity checks.
7
8 ! Contributed by Daniel Kraft, d@domob.eu.
9
10 PROGRAM main
11   IMPLICIT NONE
12   
13   EXIT ! { dg-error "is not within a construct" }
14   EXIT foobar ! { dg-error "is unknown" }
15   EXIT main ! { dg-error "is not a construct name" }
16
17   mainLoop: DO
18     CALL test ()
19   END DO mainLoop
20
21   otherLoop: DO
22     EXIT mainLoop ! { dg-error "is not within construct 'mainloop'" }
23   END DO otherLoop
24
25 CONTAINS
26
27   SUBROUTINE test ()
28     EXIT mainLoop ! { dg-error "is unknown" }
29   END SUBROUTINE test
30
31 END PROGRAM main