2 ! Check the fix for PR20839, which concerned non-compliance with one of the
3 ! constraints for block-do-constructs (8.1.4.1.1):
4 ! Constraint: If the do-stmt of a block-do-construct is identified by a
5 ! do-construct-name, the corresponding end-do shall be an end-do-stmt
6 ! specifying the same do-construct-name. (Tests a & b)
7 ! If the do-stmt of a block-do-construct is not identified by a
8 ! do-construct-name, the corresponding end-do shall not specify a
9 ! do-construct-name. (Tests c & d)
10 ! Constraint: If the do-stmt is a nonlabel-do-stmt, the corresponding end-do
11 ! shall be an end-do-stmt.
12 ! Constraint: If the do-stmt is a label-do-stmt, the corresponding end-do shall
13 ! be identified with the same label.
15 ! Test a - this was the PR
16 doi
: DO 111 i
=1,3 ! { dg-error "requires matching ENDDO name" }
20 112 enddo doij
! { dg-error "Expected label" }
23 113 enddo doik
! { dg-error "Syntax error" }
26 enddo doil
! { dg-error "Syntax error" }
29 enddo doj
! { dg-error "doesn't match DO label" }
31 ! Correct block do constructs
42 ! Correct non-block do constructs
49 ! These prevent an EOF error, arising from the previous errors.