Skip to content

[Frontend][OpenMP] Reduction modifier must be applied somewhere #92160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2024
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
14 changes: 14 additions & 0 deletions flang/test/Lower/OpenMP/invalid-reduction-modifier.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
!Remove the --crash below once we can diagnose the issue more gracefully.
!RUN: not --crash %flang_fc1 -fopenmp -emit-hlfir -o - %s

! Check that we reject the "task" reduction modifier on the "simd" directive.

subroutine fred(x)
integer, intent(inout) :: x

!$omp simd reduction(task, +:x)
do i = 1, 100
x = foo(i)
enddo
!$omp end simd
end
3 changes: 2 additions & 1 deletion llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,8 @@ bool ConstructDecompositionT<C, H>::applyClause(
// Apply clause without modifier.
leaf.clauses.push_back(unmodified);
}
applied = true;
// The modifier must be applied to some construct.
applied = effectiveApplied;
}

if (!applied)
Expand Down
Loading