Skip to content

[Flang][OpenMP]Add tests for align and allocator in allocate clauses #121356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flang/lib/Parser/openmp-parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ static TypeDeclarationStmt makeIterSpecDecl(std::list<ObjectName> &&names) {

TYPE_PARSER(construct<OmpAlignment>(scalarIntExpr))

TYPE_PARSER(construct<OmpAlignModifier>( //
"ALIGN" >> parenthesized(scalarIntExpr)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here (and below) is that the actual source word starts a line. This makes is easier to visually break it down.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I kinda realized that when I saw it in the review. I'll undo that.

TYPE_PARSER(
construct<OmpAlignModifier>("ALIGN"_tok >> parenthesized(scalarIntExpr)))

TYPE_PARSER(construct<OmpAllocatorComplexModifier>(
"ALLOCATOR" >> parenthesized(scalarIntExpr)))
Expand Down
14 changes: 14 additions & 0 deletions flang/test/Lower/OpenMP/Todo/allocate-clause-align.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -fopenmp-version=51 -o - %s 2>&1 | FileCheck %s

! CHECK: not yet implemented: OmpAllocateClause ALIGN modifier
program p
use omp_lib
integer :: x
integer :: a
integer :: i
!$omp parallel private(x) allocate(align(4): x)
do i=1,10
a = a + i
end do
!$omp end parallel
end program p
15 changes: 15 additions & 0 deletions flang/test/Lower/OpenMP/Todo/allocate-clause-allocator.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
! RUN: %not_todo_cmd %flang_fc1 -emit-llvm -fopenmp -fopenmp-version=51 -o - %s 2>&1 | FileCheck %s

! CHECK: not yet implemented: Unhandled clause allocate in omp.parallel
! CHECK: LLVM Translation failed for operation: omp.parallel
program p
use omp_lib
integer :: x
integer :: a
integer :: i
!$omp parallel private(x) allocate(allocator(omp_default_mem_alloc): x)
do i=1,10
a = a + i
end do
!$omp end parallel
end program p
Loading