1 // expected-no-diagnostics
3 //RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp \
4 //RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
5 //RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
6 //RUN: -ast-print %s | FileCheck %s --check-prefix=PRINT
8 //RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp \
9 //RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
10 //RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
11 //RUN: -ast-dump %s | FileCheck %s --check-prefix=DUMP
13 //RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp \
14 //RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
15 //RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
16 //RUN: -emit-pch -o %t %s
18 //RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp \
19 //RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
20 //RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
21 //RUN: -include-pch %t -ast-print %s | FileCheck %s --check-prefix=PRINT
23 //RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp \
24 //RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \
25 //RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \
26 //RUN: -include-pch %t -ast-dump-all %s | FileCheck %s --check-prefix=DUMP
37 template <unsigned int nRHS
>
39 #pragma omp parallel default(firstprivate)
45 // PRINT: #pragma omp parallel default(firstprivate)
47 // PRINT-NEXT: [=]() -> int {
48 // PRINT-NEXT: return this->targetDev++;
51 // DUMP: -OMPParallelDirective
52 // DUMP-NEXT: -OMPDefaultClause
53 // DUMP-NOT: -OMPFirstprivateClause
55 // PRINT: template<> void apply<32U>()
56 // PRINT: #pragma omp parallel default(firstprivate)
58 // PRINT-NEXT: [=]() -> int {
59 // PRINT-NEXT: return this->targetDev++;
62 // DUMP: -OMPParallelDirective
63 // DUMP-NEXT: -OMPDefaultClause
64 // DUMP-NEXT: -OMPFirstprivateClause
65 // DUMP-NEXT: -DeclRefExpr {{.*}} 'targetDev'
75 #pragma omp parallel default(firstprivate)
77 // PRINT: #pragma omp parallel default(firstprivate)
79 // DUMP: -OMPParallelDirective
80 // DUMP-NEXT: -OMPDefaultClause
81 // DUMP-NEXT: -OMPFirstprivateClause {{.*}} <implicit>
82 // DUMP-NEXT: -DeclRefExpr {{.*}} 'a'
95 #pragma omp parallel default(firstprivate)
103 // PRINT: #pragma omp parallel default(firstprivate)
104 // DUMP: -OMPParallelDirective
105 // DUMP-NEXT: -OMPDefaultClause
106 // DUMP-NEXT: -OMPFirstprivateClause {{.*}} <implicit>
107 // DUMP-NEXT: -DeclRefExpr {{.*}} 'a'
108 // DUMP-NEXT: -DeclRefExpr {{.*}} 'yy'
109 // DUMP-NEXT: -DeclRefExpr {{.*}} 'y'
118 #pragma omp parallel firstprivate(z) default(firstprivate)
126 // PRINT: #pragma omp parallel firstprivate(this->z) default(firstprivate)
127 // DUMP: -OMPParallelDirective
128 // DUMP-NEXT: -OMPFirstprivateClause
129 // DUMP-NEXT: -DeclRefExpr {{.*}} 'z'
130 // DUMP-NEXT: -OMPDefaultClause
131 // DUMP-NEXT: -OMPFirstprivateClause {{.*}} <implicit>
132 // DUMP-NEXT: -DeclRefExpr {{.*}} 'f'
133 // DUMP: -CXXThisExpr {{.*}} 'A *' implicit this
134 // DUMP-NEXT: -DeclRefExpr {{.*}} 'z'
135 // DUMP-NEXT: -DeclRefExpr {{.*}} 'f'
137 #pragma omp parallel firstprivate(z) default(firstprivate)
139 #pragma omp parallel private(z) default(firstprivate)
148 // PRINT: #pragma omp parallel firstprivate(this->z) default(firstprivate)
149 // PRINT: #pragma omp parallel private(this->z) default(firstprivate)
150 // DUMP: -OMPParallelDirective
151 // DUMP-NEXT: -OMPFirstprivateClause
152 // DUMP-NEXT: -DeclRefExpr {{.*}} 'z'
153 // DUMP-NEXT: -OMPDefaultClause
154 // DUMP: -OMPParallelDirective
155 // DUMP-NEXT: -OMPPrivateClaus
156 // DUMP-NEXT: -DeclRefExpr {{.*}} 'z'
157 // DUMP-NEXT: -OMPDefaultClause
158 // DUMP-NEXT: -OMPFirstprivateClause {{.*}} <implicit>
159 // DUMP-NEXT: -DeclRefExpr {{.*}} 'f'
160 // DUMP: -CXXThisExpr {{.*}} 'A *' implicit this
161 // DUMP-NEXT: -DeclRefExpr {{.*}} 'f'
162 // DUMP: -MemberExpr {{.*}}
163 // DUMP-NEXT: -CXXThisExpr
164 // DUMP: -CXXThisExpr {{.*}} 'A *' implicit this
165 // DUMP-NEXT: -DeclRefExpr {{.*}} 'z'