Skip to content

Commit f12b1ed

Browse files
authored
[flang][OpenMP] Add TODOs for target [teams|parallel] private (#143706)
Using the private clause on `target teams` or `target parallel` is not currently implemented and causes crashes during lowering. Add appropriate TODOs. Resolves #116428. Signed-off-by: Kajetan Puchalski <[email protected]>
1 parent f6eaa2b commit f12b1ed

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
@@ -4024,6 +4024,13 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
40244024
parser::ToUpperCaseLetters(llvm::omp::getOpenMPClauseName(clause.id));
40254025
TODO(clauseLocation, name + " clause is not implemented yet");
40264026
}
4027+
4028+
if (std::holds_alternative<clause::Private>(clause.u) &&
4029+
origDirective == llvm::omp::Directive::OMPD_target_teams)
4030+
TODO(clauseLocation, "TARGET TEAMS PRIVATE is not implemented yet");
4031+
if (std::holds_alternative<clause::Private>(clause.u) &&
4032+
origDirective == llvm::omp::Directive::OMPD_target_parallel)
4033+
TODO(clauseLocation, "TARGET PARALLEL PRIVATE is not implemented yet");
40274034
}
40284035

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