Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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/test/Parser/OpenMP/atomic-unparse.f90
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ program main
if (i .eq. j + 1) then
i = j
end if

!$omp atomic compare acquire
if (i .eq. j) then
i = k
Expand All @@ -178,7 +178,7 @@ program main
if (i .eq. k) then
i = j
end if

!ATOMIC
!$omp atomic
i = j
Expand Down
6 changes: 3 additions & 3 deletions flang/test/Parser/OpenMP/declare-reduction-operator.f90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ subroutine reduce_1 ( n, tts )
real(8) :: x
real(8) :: y
end type

integer :: n
type(tt) :: tts(n)
type(tt2) :: tts2(n)
Expand Down Expand Up @@ -76,7 +76,7 @@ subroutine reduce_1 ( n, tts )
!PARSE-TREE: | Flags = {}
!$omp declare reduction(+ : tt : omp_out = tt(omp_out%x - omp_in%x , omp_out%y - omp_in%y)) initializer(omp_priv = tt(0,0))


!CHECK: !$OMP DECLARE REDUCTION(+:tt2: omp_out = tt2(omp_out%x - omp_in%x , omp_out%y &
!CHECK: !$OMP&- omp_in%y)) INITIALIZER(omp_priv = tt2(0,0))

Expand Down Expand Up @@ -136,7 +136,7 @@ subroutine reduce_1 ( n, tts )
!PARSE-TREE: | | | | | | | LiteralConstant -> IntLiteralConstant = '0'
!PARSE-TREE: | Flags = {}
!$omp declare reduction(+ :tt2 : omp_out = tt2(omp_out%x - omp_in%x , omp_out%y - omp_in%y)) initializer(omp_priv = tt2(0,0))

type(tt) :: diffp = tt( 0, 0 )
type(tt2) :: diffp2 = tt2( 0, 0 )
integer :: i
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Parser/OpenMP/declare-variant.f90
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ subroutine f
y = 2
!omp simd
call f2(x, y)
!omp end simd
!omp end simd
contains
subroutine f1 (x, y)
real :: x, y
Expand Down
20 changes: 10 additions & 10 deletions flang/test/Parser/OpenMP/defaultmap-unparse.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ program main

real :: arrA(N), arrB(N)
integer, target :: arrC(N)
type(data01) :: data01_a
type(data01) :: data01_a
integer, allocatable :: alloc_arr(:)
integer, pointer :: ptrArr(:)
integer, pointer :: ptrArr(:)

arrA = 1.414
arrB = 3.14
Expand All @@ -26,8 +26,8 @@ program main
alloc_arr = -1


!CHECK: !$omp target defaultmap(tofrom:scalar)
!$omp target defaultmap(tofrom:scalar)
!CHECK: !$omp target defaultmap(tofrom:scalar)
!$omp target defaultmap(tofrom:scalar)
do i = 1, N
a = 3.14
enddo
Expand Down Expand Up @@ -66,7 +66,7 @@ program main
!CHECK: !$omp target defaultmap(none:scalar)
!$omp target defaultmap(none:scalar)
a = 4.78
!CHECK: !$omp end target
!CHECK: !$omp end target
!$omp end target

!PARSE-TREE: OmpBeginDirective
Expand Down Expand Up @@ -98,7 +98,7 @@ program main
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = Firstprivate
!PARSE-TREE: Modifier -> OmpVariableCategory -> Value = Scalar

!CHECK: !$omp target defaultmap(tofrom:aggregate)
!$omp target defaultmap(tofrom:aggregate)
arrC(1) = 10
Expand All @@ -113,8 +113,8 @@ program main
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = Tofrom
!PARSE-TREE: Modifier -> OmpVariableCategory -> Value = Aggregate
!CHECK: !$omp target defaultmap(tofrom:allocatable)

!CHECK: !$omp target defaultmap(tofrom:allocatable)
!$omp target defaultmap(tofrom:allocatable)
alloc_arr(23) = 234
!CHECK: !$omp end target
Expand All @@ -125,14 +125,14 @@ program main
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = Tofrom
!PARSE-TREE: Modifier -> OmpVariableCategory -> Value = Allocatable

!CHECK: !$omp target defaultmap(default:pointer)
!$omp target defaultmap(default:pointer)
ptrArr=>arrC
ptrArr(2) = 5
prtArr(200) = 34
!CHECK: !$omp end target
!$omp end target
!$omp end target

!PARSE-TREE: OmpBeginDirective
!PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = target
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Parser/OpenMP/if-clause-unparse.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ program if_unparse
! CHECK: !$OMP TARGET UPDATE
! CHECK-SAME: IF(TARGET UPDATE: cond)
!$omp target update if(target update: cond)

! CHECK: !$OMP TARGET UPDATE
! CHECK-SAME: IF(TARGET UPDATE: cond)
!$omp target update if(targetupdate: cond)
Expand Down
14 changes: 7 additions & 7 deletions flang/test/Parser/OpenMP/interop-construct.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! REQUIRES: openmp_runtime
! RUN: %flang_fc1 -fdebug-unparse -fopenmp-version=52 %openmp_flags %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
! RUN: %flang_fc1 -fdebug-unparse -fopenmp-version=52 %openmp_flags %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
! RUN: %flang_fc1 -fdebug-dump-parse-tree-no-sema -fopenmp-version=52 %openmp_flags %s | FileCheck --check-prefix="PARSE-TREE" %s

SUBROUTINE test_interop_01()
Expand All @@ -15,7 +15,7 @@ END SUBROUTINE test_interop_01
!PARSE-TREE: | SubroutineStmt
!PARSE-TREE: | | Name = 'test_interop_01'
!PARSE-TREE: | SpecificationPart
!PARSE-TREE: | | ImplicitPart ->
!PARSE-TREE: | | ImplicitPart ->
!PARSE-TREE: | ExecutionPart -> Block
!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPInteropConstruct -> OmpDirectiveSpecification
!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = interop
Expand Down Expand Up @@ -47,7 +47,7 @@ END SUBROUTINE test_interop_02
!PARSE-TREE: | SpecificationPart
!PARSE-TREE: | | UseStmt
!PARSE-TREE: | | | Name = 'omp_lib'
!PARSE-TREE: | | ImplicitPart ->
!PARSE-TREE: | | ImplicitPart ->
!PARSE-TREE: | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt
!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec -> KindSelector -> Scalar -> Integer -> Constant -> Expr -> Designator -> DataRef -> Name = 'omp_interop_kind'
!PARSE-TREE: | | | EntityDecl
Expand Down Expand Up @@ -90,7 +90,7 @@ END SUBROUTINE test_interop_03
!PARSE-TREE: | SpecificationPart
!PARSE-TREE: | | UseStmt
!PARSE-TREE: | | | Name = 'omp_lib'
!PARSE-TREE: | | ImplicitPart ->
!PARSE-TREE: | | ImplicitPart ->
!PARSE-TREE: | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt
!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec -> KindSelector -> Scalar -> Integer -> Constant -> Expr -> Designator -> DataRef -> Name = 'omp_interop_kind'
!PARSE-TREE: | | | EntityDecl
Expand Down Expand Up @@ -133,13 +133,13 @@ END SUBROUTINE test_interop_04
!PARSE-TREE: | SpecificationPart
!PARSE-TREE: | | UseStmt
!PARSE-TREE: | | | Name = 'omp_lib'
!PARSE-TREE: | | ImplicitPart ->
!PARSE-TREE: | | ImplicitPart ->
!PARSE-TREE: | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt
!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec -> KindSelector -> Scalar -> Integer -> Constant -> Expr -> Designator -> DataRef -> Name = 'omp_interop_kind'
!PARSE-TREE: | | | EntityDecl
!PARSE-TREE: | | | | Name = 'obj'
!PARSE-TREE: | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt
!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->
!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->
!PARSE-TREE: | | | AttrSpec -> ArraySpec -> ExplicitShapeSpec
!PARSE-TREE: | | | | SpecificationExpr -> Scalar -> Integer -> Expr -> LiteralConstant -> IntLiteralConstant = '1'
!PARSE-TREE: | | | ExplicitShapeSpec
Expand Down Expand Up @@ -185,7 +185,7 @@ END SUBROUTINE test_interop_05
!PARSE-TREE: | SpecificationPart
!PARSE-TREE: | | UseStmt
!PARSE-TREE: | | | Name = 'omp_lib'
!PARSE-TREE: | | ImplicitPart ->
!PARSE-TREE: | | ImplicitPart ->
!PARSE-TREE: | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt
!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec -> KindSelector -> Scalar -> Integer -> Constant -> Expr -> Designator -> DataRef -> Name = 'omp_interop_kind'
!PARSE-TREE: | | | EntityDecl
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Parser/OpenMP/lastprivate-clause.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=50 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
! RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=50 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=50 %s | FileCheck --check-prefix="PARSE-TREE" %s

subroutine foo1()
Expand Down
18 changes: 9 additions & 9 deletions flang/test/Parser/OpenMP/masked-unparse.f90
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
! RUN: %flang_fc1 -fdebug-unparse -fopenmp %s | FileCheck --ignore-case %s
! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s

! Check for parsing of masked directive with filter clause.
! Check for parsing of masked directive with filter clause.


subroutine test_masked()
integer :: c = 1
!PARSE-TREE: OmpBeginDirective
!PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = masked
!CHECK: !$omp masked
!$omp masked
!$omp masked
c = c + 1
!$omp end masked
!PARSE-TREE: OmpBeginDirective
!PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = masked
!PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Filter -> Scalar -> Integer -> Expr = '1_4'
!PARSE-TREE-NEXT: LiteralConstant -> IntLiteralConstant = '1'
!CHECK: !$omp masked filter(1_4)
!$omp masked filter(1)
!$omp masked filter(1)
c = c + 2
!$omp end masked
end subroutine
Expand All @@ -27,7 +27,7 @@ subroutine test_masked_taskloop_simd()
!PARSE-TREE: OmpBeginLoopDirective
!PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = masked taskloop simd
!CHECK: !$omp masked taskloop simd
!$omp masked taskloop simd
!$omp masked taskloop simd
do i=1,10
j = j + 1
end do
Expand All @@ -41,11 +41,11 @@ subroutine test_masked_taskloop
!PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Filter -> Scalar -> Integer -> Expr = '2_4'
!PARSE-TREE-NEXT: LiteralConstant -> IntLiteralConstant = '2'
!CHECK: !$omp masked taskloop filter(2_4)
!$omp masked taskloop filter(2)
!$omp masked taskloop filter(2)
do i=1,10
j = j + 1
end do
!$omp end masked taskloop
!$omp end masked taskloop
end subroutine

subroutine test_parallel_masked
Expand All @@ -70,7 +70,7 @@ subroutine test_parallel_masked_taskloop_simd
!PARSE-TREE: OmpBeginLoopDirective
!PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel masked taskloop simd
!CHECK: !$omp parallel masked taskloop simd
!$omp parallel masked taskloop simd
!$omp parallel masked taskloop simd
do i=1,10
j = j + 1
end do
Expand All @@ -84,9 +84,9 @@ subroutine test_parallel_masked_taskloop
!PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Filter -> Scalar -> Integer -> Expr = '2_4'
!PARSE-TREE-NEXT: LiteralConstant -> IntLiteralConstant = '2'
!CHECK: !$omp parallel masked taskloop filter(2_4)
!$omp parallel masked taskloop filter(2)
!$omp parallel masked taskloop filter(2)
do i=1,10
j = j + 1
end do
!$omp end parallel masked taskloop
!$omp end parallel masked taskloop
end subroutine
10 changes: 5 additions & 5 deletions flang/test/Parser/OpenMP/master-unparse.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ subroutine test_master()
!PARSE-TREE: OmpBeginDirective
!PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = master
!CHECK: !$omp master
!$omp master
!$omp master
c = c + 1
!$omp end master
end subroutine
Expand All @@ -19,7 +19,7 @@ subroutine test_master_taskloop_simd()
!PARSE-TREE: OmpBeginLoopDirective
!PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = master taskloop simd
!CHECK: !$omp master taskloop simd
!$omp master taskloop simd
!$omp master taskloop simd
do i=1,10
j = j + 1
end do
Expand All @@ -35,7 +35,7 @@ subroutine test_master_taskloop
do i=1,10
j = j + 1
end do
!$omp end master taskloop
!$omp end master taskloop
end subroutine

subroutine test_parallel_master
Expand All @@ -53,7 +53,7 @@ subroutine test_parallel_master_taskloop_simd
!PARSE-TREE: OmpBeginLoopDirective
!PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel master taskloop simd
!CHECK: !$omp parallel master taskloop simd
!$omp parallel master taskloop simd
!$omp parallel master taskloop simd
do i=1,10
j = j + 1
end do
Expand All @@ -69,5 +69,5 @@ subroutine test_parallel_master_taskloop
do i=1,10
j = j + 1
end do
!$omp end parallel master taskloop
!$omp end parallel master taskloop
end subroutine
16 changes: 8 additions & 8 deletions flang/test/Parser/acc-data-statement.f90
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ program acc_data_test
print *, "After nested data"
!$acc end data

! Negative tests
! Negative tests
! Basic data construct in program body
!$acc data copy(a, b) create(d) bogus()
!CHECK: acc-data-statement.f90:
Expand Down Expand Up @@ -67,7 +67,7 @@ program acc_data_test
!CHECK: acc-data-statement.f90:
!CHECK-SAME: error: expected OpenACC end block directive
!CHECK-NEXT: end if
!CHECK-NEXT: ^
!CHECK-NEXT: ^
!CHECK-NEXT: in the context: OpenACC construct
!CHECK-NEXT: !$acc data copyout(a)
!CHECK-NEXT: ^
Expand All @@ -85,7 +85,7 @@ program acc_data_test
!CHECK: acc-data-statement.f90:
!CHECK-SAME: error: expected OpenACC end block directive
!CHECK-NEXT: end do
!CHECK-NEXT: ^
!CHECK-NEXT: ^
!CHECK-NEXT: in the context: OpenACC construct
!CHECK-NEXT: !$acc data present(a)
!CHECK-NEXT: ^
Expand Down Expand Up @@ -137,7 +137,7 @@ program acc_data_test
contains
subroutine positive_process_array(x)
integer, intent(inout) :: x(:)

! Data construct in subroutine
!$acc data copy(x)
x = x + 1
Expand All @@ -148,17 +148,17 @@ subroutine positive_process_array(x)
function positive_compute_sum(x) result(total)
integer, intent(in) :: x(:)
integer :: total

! Data construct in function
!$acc data copyin(x) copy(total)
total = sum(x)
!$acc end data
print *, "Function finished"
end function

subroutine negative_process_array(x)
integer, intent(inout) :: x(:)

! Data construct in subroutine
!$acc data copy(x)
x = x + 1
Expand Down Expand Up @@ -188,7 +188,7 @@ function negative_compute_sum(x) result(total)
!CHECK: acc-data-statement.f90:
!CHECK-SAME: error: expected OpenACC end block directive
!CHECK-NEXT: end function
!CHECK-NEXT: ^
!CHECK-NEXT: ^
!CHECK-NEXT: in the context: OpenACC construct
!CHECK-NEXT: !$acc data copyin(x) copy(total)
!CHECK-NEXT: ^
Expand Down
Loading
Loading