mirror of
https://github.com/intel/llvm.git
synced 2026-01-18 07:57:36 +08:00
[flang] Change vector always errors to warnings (#95908)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user