xref: /llvm-project/flang/test/Semantics/canondo08.f90 (revision 31ad5c14fefa66085eff3629c0cc8393556ba849)
164ab3302SCarolineConcatto! Error test -- DO loop uses obsolete loop termination statement
264ab3302SCarolineConcatto! See R1131 and C1133
364ab3302SCarolineConcatto
464ab3302SCarolineConcatto! By default, this is not an error and label do are rewritten to non-label do.
5*31ad5c14SArnamoy Bhattacharyya! A warning is generated with -pedantic
664ab3302SCarolineConcatto
764ab3302SCarolineConcatto
8*31ad5c14SArnamoy Bhattacharyya! RUN: %flang_fc1 -fdebug-unparse-with-symbols -pedantic %s 2>%t.stderr | FileCheck %s
964ab3302SCarolineConcatto
1064ab3302SCarolineConcatto! CHECK: end do
1164ab3302SCarolineConcatto
1264ab3302SCarolineConcatto! The following CHECK-NOT actively uses the fact that the leading zero of labels
1364ab3302SCarolineConcatto! would be removed in the unparse but not the line linked to warnings. We do
1464ab3302SCarolineConcatto! not want to see label do in the unparse only.
1564ab3302SCarolineConcatto! CHECK-NOT: do [1-9]
1664ab3302SCarolineConcatto
17ae742523SRichard Barton! RUN: FileCheck --check-prefix=ERR --input-file=%t.stderr %s
18ae742523SRichard Barton! ERR: A DO loop should terminate with an END DO or CONTINUE
1964ab3302SCarolineConcatto
2064ab3302SCarolineConcattosubroutine foo1()
2164ab3302SCarolineConcatto  do 01 k=1,2
2264ab3302SCarolineConcatto    do i=3,4
2364ab3302SCarolineConcatto      print*, i+k
2464ab3302SCarolineConcatto01  end do
2564ab3302SCarolineConcattoend subroutine
26