diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp --- a/flang/lib/Lower/OpenMP.cpp +++ b/flang/lib/Lower/OpenMP.cpp @@ -173,6 +173,12 @@ } } + for (auto *ps : privatizedSymbols) { + if (ps->has()) + TODO(converter.getCurrentLocation(), + "Common Block in privatization clause"); + } + if (hasCollapse && hasLastPrivateOp) TODO(converter.getCurrentLocation(), "Collapse clause with lastprivate"); } diff --git a/flang/test/Lower/OpenMP/Todo/firstprivate-commonblock.f90 b/flang/test/Lower/OpenMP/Todo/firstprivate-commonblock.f90 new file mode 100644 --- /dev/null +++ b/flang/test/Lower/OpenMP/Todo/firstprivate-commonblock.f90 @@ -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 diff --git a/flang/test/Lower/OpenMP/Todo/lastprivate-commonblock.f90 b/flang/test/Lower/OpenMP/Todo/lastprivate-commonblock.f90 new file mode 100644 --- /dev/null +++ b/flang/test/Lower/OpenMP/Todo/lastprivate-commonblock.f90 @@ -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 diff --git a/flang/test/Lower/OpenMP/Todo/private-commonblock.f90 b/flang/test/Lower/OpenMP/Todo/private-commonblock.f90 new file mode 100644 --- /dev/null +++ b/flang/test/Lower/OpenMP/Todo/private-commonblock.f90 @@ -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