xref: /llvm-project/flang/test/Semantics/label14.f90 (revision 80f0bb5971e9a778e025d2bb91cbcb8b84a56d07)
1! Tests implemented for this standard
2! 11.1.4 - 4 It is permissible to branch to an end-block-stmt only within its
3!            Block Construct
4
5! RUN: not %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s
6! CHECK: Label '20' is in a construct that prevents its use as a branch target here
7
8subroutine s1
9  block
10    goto (10) 1
1110  end block
12
13  block
1420  end block
15end
16
17subroutine s2
18  block
19    goto (20) 1
2010  end block
21
22  block
2320  end block
24end
25
26subroutine s3
27  block
28    block
29      goto (10) 1
3010  end block
3120  end block
32end
33
34subroutine s4
35  block
36    block
37      goto (20) 1
3810  end block
3920  end block
40end
41