1 !RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=52 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
2 !RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=52 %s | FileCheck --check-prefix="PARSE-TREE" %s
5 !$omp target defaultmap(from)
9 !UNPARSE: SUBROUTINE f00
10 !UNPARSE: !$OMP TARGET DEFAULTMAP(FROM)
11 !UNPARSE: !$OMP END TARGET
12 !UNPARSE: END SUBROUTINE
14 !PARSE-TREE: OmpBeginBlockDirective
15 !PARSE-TREE: | OmpBlockDirective -> llvm::omp::Directive = target
16 !PARSE-TREE: | OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
17 !PARSE-TREE: | | ImplicitBehavior = From
21 !$omp target defaultmap(firstprivate: aggregate)
25 !UNPARSE: SUBROUTINE f01
26 !UNPARSE: !$OMP TARGET DEFAULTMAP(FIRSTPRIVATE:AGGREGATE)
27 !UNPARSE: !$OMP END TARGET
28 !UNPARSE: END SUBROUTINE
30 !PARSE-TREE: OmpBeginBlockDirective
31 !PARSE-TREE: | OmpBlockDirective -> llvm::omp::Directive = target
32 !PARSE-TREE: | OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
33 !PARSE-TREE: | | ImplicitBehavior = Firstprivate
34 !PARSE-TREE: | | Modifier -> OmpVariableCategory -> Value = Aggregate
37 !$omp target defaultmap(alloc: all)
41 !UNPARSE: SUBROUTINE f02
42 !UNPARSE: !$OMP TARGET DEFAULTMAP(ALLOC:ALL)
43 !UNPARSE: !$OMP END TARGET
44 !UNPARSE: END SUBROUTINE
46 !PARSE-TREE: OmpBeginBlockDirective
47 !PARSE-TREE: | OmpBlockDirective -> llvm::omp::Directive = target
48 !PARSE-TREE: | OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
49 !PARSE-TREE: | | ImplicitBehavior = Alloc
50 !PARSE-TREE: | | Modifier -> OmpVariableCategory -> Value = All
52 ! Both "all" and "allocatable" are valid, and "all" is a prefix of
53 ! "allocatable". Make sure we parse this correctly.
55 !$omp target defaultmap(alloc: allocatable)
59 !UNPARSE: SUBROUTINE f03
60 !UNPARSE: !$OMP TARGET DEFAULTMAP(ALLOC:ALLOCATABLE)
61 !UNPARSE: !$OMP END TARGET
62 !UNPARSE: END SUBROUTINE
64 !PARSE-TREE: OmpBeginBlockDirective
65 !PARSE-TREE: | OmpBlockDirective -> llvm::omp::Directive = target
66 !PARSE-TREE: | OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
67 !PARSE-TREE: | | ImplicitBehavior = Alloc
68 !PARSE-TREE: | | Modifier -> OmpVariableCategory -> Value = Allocatable
71 !$omp target defaultmap(tofrom: scalar)
75 !UNPARSE: SUBROUTINE f04
76 !UNPARSE: !$OMP TARGET DEFAULTMAP(TOFROM:SCALAR)
77 !UNPARSE: !$OMP END TARGET
78 !UNPARSE: END SUBROUTINE
80 !PARSE-TREE: OmpBeginBlockDirective
81 !PARSE-TREE: | OmpBlockDirective -> llvm::omp::Directive = target
82 !PARSE-TREE: | OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
83 !PARSE-TREE: | | ImplicitBehavior = Tofrom
84 !PARSE-TREE: | | Modifier -> OmpVariableCategory -> Value = Scalar