Skip to content

Commit 28325ab

Browse files
[Flang][OpenMP]Add tests for align and allocator in allocate clauses
No functional change. (Also, tried to filter out all ALLOCATOR modifiers, but that makes some other tests fail).
1 parent 8e1cb96 commit 28325ab

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

flang/lib/Parser/openmp-parsers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ static TypeDeclarationStmt makeIterSpecDecl(std::list<ObjectName> &&names) {
157157

158158
TYPE_PARSER(construct<OmpAlignment>(scalarIntExpr))
159159

160-
TYPE_PARSER(construct<OmpAlignModifier>( //
161-
"ALIGN" >> parenthesized(scalarIntExpr)))
160+
TYPE_PARSER(
161+
construct<OmpAlignModifier>("ALIGN"_tok >> parenthesized(scalarIntExpr)))
162162

163163
TYPE_PARSER(construct<OmpAllocatorComplexModifier>(
164164
"ALLOCATOR" >> parenthesized(scalarIntExpr)))
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -fopenmp-version=51 -o - %s 2>&1 | FileCheck %s
2+
3+
! CHECK: not yet implemented: OmpAllocateClause ALIGN modifier
4+
program p
5+
use omp_lib
6+
integer :: x
7+
integer :: a
8+
integer :: i
9+
!$omp parallel private(x) allocate(align(4): x)
10+
do i=1,10
11+
a = a + i
12+
end do
13+
!$omp end parallel
14+
end program p
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
! RUN: %not_todo_cmd %flang_fc1 -emit-llvm -fopenmp -fopenmp-version=51 -o - %s 2>&1 | FileCheck %s
2+
3+
! CHECK: not yet implemented: Unhandled clause allocate in omp.parallel
4+
! CHECK: LLVM Translation failed for operation: omp.parallel
5+
program p
6+
use omp_lib
7+
integer :: x
8+
integer :: a
9+
integer :: i
10+
!$omp parallel private(x) allocate(allocator(omp_default_mem_alloc): x)
11+
do i=1,10
12+
a = a + i
13+
end do
14+
!$omp end parallel
15+
end program p

0 commit comments

Comments
 (0)