brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 1a2bbbc Raw
59 lines · plain
1! RUN: %flang_fc1 -fdebug-unparse -fopenmp %s | FileCheck --ignore-case %s2! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s3 4! Check for parsing scan directive5subroutine test_scan(n, a, b)6  implicit none7  integer n8  integer a(n), b(n)9  integer x,y,k10 11  ! a(k) is included in the computation of producing results in b(k)12  !$omp parallel do simd reduction(inscan,+: x)13  do k = 1, n14    x = x + a(k)15    !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPSimpleStandaloneConstruct -> OmpDirectiveSpecification16    !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = scan17    !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Inclusive -> OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'18    !CHECK: !$omp scan inclusive(x)19    !$omp scan inclusive(x)20      b(k) = x21  end do22 23  ! a(k) is not included in the computation of producing results in b(k)24  !$omp parallel do simd reduction(inscan,+: x)25  do k = 1, n26    b(k) = x27    !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPSimpleStandaloneConstruct -> OmpDirectiveSpecification28    !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = scan29    !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Exclusive -> OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'30    !CHECK: !$omp scan exclusive(x)31    !$omp scan exclusive(x)32    x = x + a(k)33  end do34 35  !$omp parallel do simd reduction(inscan,+: x, y)36  do k = 1, n37    x = x + a(k)38    !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPSimpleStandaloneConstruct -> OmpDirectiveSpecification39    !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = scan40    !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Inclusive -> OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'41    !PARSE-TREE-NEXT: OmpObject -> Designator -> DataRef -> Name = 'y'42    !CHECK: !$omp scan inclusive(x,y)43    !$omp scan inclusive(x, y)44      b(k) = x45  end do46 47  !$omp parallel do simd reduction(inscan,+: x, y)48  do k = 1, n49    x = x + a(k)50    !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPSimpleStandaloneConstruct -> OmpDirectiveSpecification51    !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = scan52    !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Exclusive -> OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'53    !PARSE-TREE-NEXT: OmpObject -> Designator -> DataRef -> Name = 'y'54    !CHECK: !$omp scan exclusive(x,y)55    !$omp scan exclusive(x, y)56      b(k) = x57  end do58end subroutine59