Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flang/lib/Semantics/check-omp-structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4942,7 +4942,7 @@ void OmpStructureChecker::CheckTraitSetSelector(
void OmpStructureChecker::CheckTraitScore(const parser::OmpTraitScore &score) {
// [6.0:322:23]
// A score-expression must be a non-negative constant integer expression.
if (auto value{GetIntValue(score)}; !value || value <= 0) {
if (auto value{GetIntValue(score)}; !value || value < 0) {
context_.Say(score.source,
"SCORE expression must be a non-negative constant integer expression"_err_en_US);
}
Expand Down
5 changes: 5 additions & 0 deletions flang/test/Semantics/OpenMP/metadirective-common.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ subroutine f02
!$omp & when(user={condition(score(-2): .true.)}: nothing)
end

subroutine f02_zero_score
!$omp metadirective &
!$omp & when(user={condition(score(0): .true.)}: nothing)
end

subroutine f03(x)
integer :: x
!$omp metadirective &
Expand Down
Loading