File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -2286,6 +2286,7 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Reduction &x) {
2286
2286
CheckReductionTypeList (x);
2287
2287
}
2288
2288
}
2289
+
2289
2290
bool OmpStructureChecker::CheckReductionOperators (
2290
2291
const parser::OmpClause::Reduction &x) {
2291
2292
@@ -2356,6 +2357,16 @@ void OmpStructureChecker::CheckReductionTypeList(
2356
2357
if (llvm::omp::nestedReduceWorkshareAllowedSet.test (GetContext ().directive )) {
2357
2358
CheckSharedBindingInOuterContext (ompObjectList);
2358
2359
}
2360
+
2361
+ SymbolSourceMap symbols;
2362
+ GetSymbolsInObjectList (ompObjectList, symbols);
2363
+ for (auto &[symbol, source] : symbols) {
2364
+ if (IsProcedurePointer (*symbol)) {
2365
+ context_.Say (source,
2366
+ " A procedure pointer '%s' must not appear in a REDUCTION clause." _err_en_US,
2367
+ symbol->name ());
2368
+ }
2369
+ }
2359
2370
}
2360
2371
2361
2372
void OmpStructureChecker::CheckIntentInPointerAndDefinable (
Original file line number Diff line number Diff line change
1
+ ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
2
+
3
+ ! OpenMP 5.2: Section 5.5.5 : A procedure pointer must not appear in a
4
+ ! reduction clause.
5
+
6
+ procedure (foo), pointer :: ptr
7
+ integer :: i
8
+ ptr = > foo
9
+ ! ERROR: A procedure pointer 'ptr' must not appear in a REDUCTION clause.
10
+ ! $omp do reduction (+ : ptr)
11
+ do i = 1 , 10
12
+ end do
13
+ contains
14
+ subroutine foo
15
+ end subroutine
16
+ end
You can’t perform that action at this time.
0 commit comments