Skip to content

Commit

Permalink
[Flang][OpenMP] Add TODO message for common block privatisation
Browse files Browse the repository at this point in the history
This is a temporary message until the feature is implemented and
merged.

Note: There is a proposed patch (https://reviews.llvm.org/D127215)

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D146768
  • Loading branch information
kiranchandramohan committed Mar 24, 2023
1 parent a35e4d2 commit 90d9c1c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flang/lib/Lower/OpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ void DataSharingProcessor::collectSymbolsForPrivatization() {
}
}

for (auto *ps : privatizedSymbols) {
if (ps->has<Fortran::semantics::CommonBlockDetails>())
TODO(converter.getCurrentLocation(),
"Common Block in privatization clause");
}

if (hasCollapse && hasLastPrivateOp)
TODO(converter.getCurrentLocation(), "Collapse clause with lastprivate");
}
Expand Down
10 changes: 10 additions & 0 deletions flang/test/Lower/OpenMP/Todo/firstprivate-commonblock.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s

! CHECK: not yet implemented: Common Block in privatization clause
subroutine firstprivate_common
common /c/ x, y
real x, y
!$omp parallel firstprivate(/c/)
!$omp end parallel
end subroutine
12 changes: 12 additions & 0 deletions flang/test/Lower/OpenMP/Todo/lastprivate-commonblock.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s

! CHECK: not yet implemented: Common Block in privatization clause
subroutine lastprivate_common
common /c/ x, y
real x, y
!$omp do lastprivate(/c/)
do i=1,100
end do
!$omp end do
end subroutine
10 changes: 10 additions & 0 deletions flang/test/Lower/OpenMP/Todo/private-commonblock.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s

! CHECK: not yet implemented: Common Block in privatization clause
subroutine private_common
common /c/ x, y
real x, y
!$omp parallel private(/c/)
!$omp end parallel
end subroutine

0 comments on commit 90d9c1c

Please sign in to comment.