Skip to content

Commit 37380fa

Browse files
committed
[flang][OpenMP] Add TODOs for target [teams|parallel] private
Using the private clause on `target teams` or `target parallel` is not currently implemented and causes crashes during lowering. Add appropriate TODOs. Signed-off-by: Kajetan Puchalski <[email protected]>
1 parent bdcbe67 commit 37380fa

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4317,6 +4317,13 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
43174317
parser::ToUpperCaseLetters(llvm::omp::getOpenMPClauseName(clause.id));
43184318
TODO(clauseLocation, name + " clause is not implemented yet");
43194319
}
4320+
4321+
if (std::holds_alternative<clause::Private>(clause.u) &&
4322+
origDirective == llvm::omp::Directive::OMPD_target_teams)
4323+
TODO(clauseLocation, "TARGET TEAMS PRIVATE is not implemented yet");
4324+
if (std::holds_alternative<clause::Private>(clause.u) &&
4325+
origDirective == llvm::omp::Directive::OMPD_target_parallel)
4326+
TODO(clauseLocation, "TARGET PARALLEL PRIVATE is not implemented yet");
43204327
}
43214328

43224329
llvm::omp::Directive directive =
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -fopenmp-version=50 -o - %s 2>&1 | FileCheck %s
2+
! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -fopenmp-version=50 -o - %s 2>&1 | FileCheck %s
3+
4+
!===============================================================================
5+
! `private` clause on `target parallel`
6+
!===============================================================================
7+
8+
! CHECK: not yet implemented: TARGET PARALLEL PRIVATE is not implemented yet
9+
subroutine target_teams_private()
10+
integer, dimension(3) :: i
11+
!$omp target parallel private(i)
12+
!$omp end target parallel
13+
end subroutine
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -fopenmp-version=50 -o - %s 2>&1 | FileCheck %s
2+
! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -fopenmp-version=50 -o - %s 2>&1 | FileCheck %s
3+
4+
!===============================================================================
5+
! `private` clause on `target teams`
6+
!===============================================================================
7+
8+
! CHECK: not yet implemented: TARGET TEAMS PRIVATE is not implemented yet
9+
subroutine target_teams_private()
10+
integer, dimension(3) :: i
11+
!$omp target teams private(i)
12+
!$omp end target teams
13+
end subroutine

0 commit comments

Comments
 (0)