-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[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
Conversation
No functional change. (Also, tried to filter out all ALLOCATOR modifiers, but that makes some other tests fail).
@llvm/pr-subscribers-flang-parser @llvm/pr-subscribers-flang-openmp Author: Mats Petersson (Leporacanthicus) ChangesNo functional change. (Also, tried to filter out all ALLOCATOR modifiers, but that makes some other tests fail). Full diff: https://github.com/llvm/llvm-project/pull/121356.diff 3 Files Affected:
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index 67385c03f66c80..dea4102205be0c 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -157,8 +157,8 @@ static TypeDeclarationStmt makeIterSpecDecl(std::list<ObjectName> &&names) {
TYPE_PARSER(construct<OmpAlignment>(scalarIntExpr))
-TYPE_PARSER(construct<OmpAlignModifier>( //
- "ALIGN" >> parenthesized(scalarIntExpr)))
+TYPE_PARSER(
+ construct<OmpAlignModifier>("ALIGN"_tok >> parenthesized(scalarIntExpr)))
TYPE_PARSER(construct<OmpAllocatorComplexModifier>(
"ALLOCATOR" >> parenthesized(scalarIntExpr)))
diff --git a/flang/test/Lower/OpenMP/Todo/allocate-clause-align.f90 b/flang/test/Lower/OpenMP/Todo/allocate-clause-align.f90
new file mode 100644
index 00000000000000..c51ba9be84235b
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/allocate-clause-align.f90
@@ -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
diff --git a/flang/test/Lower/OpenMP/Todo/allocate-clause-allocator.f90 b/flang/test/Lower/OpenMP/Todo/allocate-clause-allocator.f90
new file mode 100644
index 00000000000000..01a91e84a0d477
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/allocate-clause-allocator.f90
@@ -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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a parse tree / unparse tests?
There are existing tests that covers the same clause in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added 'REQUIRES` line is now causing these tests to be skipped, at least in the Linux tests:
UNSUPPORTED: Flang :: Lower/OpenMP/Todo/allocate-clause-align.f90 (1066 of 3198)
UNSUPPORTED: Flang :: Lower/OpenMP/Todo/allocate-clause-allocator.f90 (1067 of 3198)
Did you check locally that these two behave properly when the runtime is present?
flang/lib/Parser/openmp-parsers.cpp
Outdated
TYPE_PARSER(construct<OmpAlignModifier>( // | ||
"ALIGN" >> parenthesized(scalarIntExpr))) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
I did. But I also realize that I can remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/15102 Here is the relevant piece of the build log for the reference
|
Did anybody else see this error? The bot appears to be still failing. |
It appears that omp_lib is not correctly (or maybe not at all?) found from the build directory. This made a few buildbots break after [PR#121356](#121356) landed. This is a workaround to unblock the buildbots. https://lab.llvm.org/staging/#/builders/130/builds/12654 https://lab.llvm.org/buildbot/#/builders/140/builds/15102 https://lab.llvm.org/staging/#/builders/105/builds/13855
It appears that omp_lib is not correctly (or maybe not at all?) found from the build directory. This made a few buildbots break after [PR#121356](llvm/llvm-project#121356) landed. This is a workaround to unblock the buildbots. https://lab.llvm.org/staging/#/builders/130/builds/12654 https://lab.llvm.org/buildbot/#/builders/140/builds/15102 https://lab.llvm.org/staging/#/builders/105/builds/13855
No functional change.
(Also, tried to filter out all ALLOCATOR modifiers, but that makes some other tests fail).