43 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! C1131, C1133 -- check valid and invalid DO loop naming3! C1131 (R1119) If the do-stmt of a do-construct specifies a do-construct-name,4! the corresponding end-do shall be an end-do-stmt specifying the same5! do-construct-name. If the do-stmt of a do-construct does not specify a6! do-construct-name, the corresponding end-do shall not specify a7! do-construct-name.8!9! C1133 (R1119) If the do-stmt is a label-do-stmt, the corresponding end-do10! shall be identified with the same label.11 12subroutine s1()13 implicit none14 ! Valid construct15 validdo: do while (.true.)16 print *, "hello"17 cycle validdo18 print *, "Weird to get here"19 end do validdo20 21 validdo: do while (.true.)22 print *, "Hello"23 end do validdo24 25 ! Missing name on initial DO26 do while (.true.)27 print *, "Hello"28!ERROR: DO construct name unexpected29 end do formerlabelmissing30 31 dolabel: do while (.true.)32 print *, "Hello"33!ERROR: DO construct name mismatch34 end do differentlabel35 36 dowithcycle: do while (.true.)37 print *, "Hello"38!ERROR: CYCLE construct-name is not in scope39 cycle validdo40 end do dowithcycle41 42end subroutine s143