1 // RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s
2 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s
3 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s
5 // RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s
6 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
7 // RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s
8 // expected-no-diagnostics
19 SS(int &d
) : a(0), b(0), c(d
) {
20 #pragma omp parallel firstprivate(a, b, c)
21 #pragma omp single copyprivate(a, this->b, (this)->c)
22 // CHECK: #pragma omp parallel firstprivate(this->a,this->b,this->c)
23 // CHECK-NEXT: #pragma omp single copyprivate(this->a,this->b,this->c){{$}}
24 ++this->a
, --b
, (this)->c
/= 1;
32 // CHECK: #pragma omp parallel firstprivate(this->a)
33 // CHECK-NEXT: #pragma omp single copyprivate(this->a)
34 // CHECK: #pragma omp parallel firstprivate(this->a)
35 // CHECK-NEXT: #pragma omp single copyprivate(this->a)
36 #pragma omp parallel firstprivate(a)
37 #pragma omp single copyprivate(this->a)
42 template <class T
, int N
>
44 T b
= argc
, c
, d
, e
, f
, g
;
48 #pragma omp parallel private(g)
49 #pragma omp single private(argc, b), firstprivate(c, d), nowait allocate(d)
51 // CHECK: #pragma omp parallel private(g)
52 // CHECK-NEXT: #pragma omp single private(argc,b) firstprivate(c,d) nowait allocate(d)
54 #pragma omp parallel private(g)
55 #pragma omp single allocate(argc) private(argc, b), firstprivate(c, d), copyprivate(g)
57 // CHECK-NEXT: #pragma omp parallel private(g)
58 // CHECK-NEXT: #pragma omp single allocate(argc) private(argc,b) firstprivate(c,d) copyprivate(g)
63 int main(int argc
, char **argv
) {
64 // CHECK: int main(int argc, char **argv) {
65 int b
= argc
, c
, d
, e
, f
, g
;
68 // CHECK: static int a;
69 #pragma omp parallel private(g)
70 #pragma omp single private(argc, b), firstprivate(argv, c), nowait
72 // CHECK: #pragma omp parallel private(g)
73 // CHECK-NEXT: #pragma omp single private(argc,b) firstprivate(argv,c) nowait
75 #pragma omp parallel private(g)
76 #pragma omp single private(argc, b), firstprivate(c, d), copyprivate(g)
78 // CHECK-NEXT: #pragma omp parallel private(g)
79 // CHECK-NEXT: #pragma omp single private(argc,b) firstprivate(c,d) copyprivate(g)
81 return (tmain
<int, 5>(argc
) + tmain
<char, 1>(argv
[0][0]));