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
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