[flang] Change vector always errors to warnings (#95908)

This commit is contained in:
David Truby
2024-06-18 14:25:56 +01:00
committed by GitHub
parent 74941d053c
commit 506b4cdae0
3 changed files with 5 additions and 8 deletions

View File

@@ -2609,9 +2609,6 @@ private:
if (e->isA<Fortran::parser::NonLabelDoStmt>())
e->dirs.push_back(&dir);
else
fir::emitFatalError(toLocation(),
"loop directive must appear before a loop");
}
void genFIR(const Fortran::parser::CompilerDirective &dir) {

View File

@@ -104,7 +104,7 @@ void CanonicalizationOfDirectives::CheckLoopDirective(
std::string s{parser::ToUpperCaseLetters(dir.source.ToString())};
s.pop_back(); // Remove trailing newline from source string
messages_.Say(
dir.source, "A DO loop must follow the %s directive"_err_en_US, s);
dir.source, "A DO loop must follow the %s directive"_warn_en_US, s);
}
}

View File

@@ -1,19 +1,19 @@
! RUN: %python %S/test_errors.py %s %flang
! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror
subroutine empty
! ERROR: A DO loop must follow the VECTOR ALWAYS directive
! WARNING: A DO loop must follow the VECTOR ALWAYS directive
!dir$ vector always
end subroutine empty
subroutine non_do
! ERROR: A DO loop must follow the VECTOR ALWAYS directive
! WARNING: A DO loop must follow the VECTOR ALWAYS directive
!dir$ vector always
a = 1
end subroutine non_do
subroutine execution_part
do i=1,10
! ERROR: A DO loop must follow the VECTOR ALWAYS directive
! WARNING: A DO loop must follow the VECTOR ALWAYS directive
!dir$ vector always
end do
end subroutine execution_part