1 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP50
2 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s
3 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP50
5 // RUN: %clang_cc1 -verify -fopenmp -ast-print %s -DOMP51 | FileCheck %s --check-prefix CHECK --check-prefix OMP51
6 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51
7 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -verify %s -ast-print -DOMP51 | FileCheck %s --check-prefix CHECK --check-prefix OMP51
9 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP50
10 // RUN: %clang_cc1 -fopenmp-simd -DOMP5 -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s
11 // RUN: %clang_cc1 -fopenmp-simd -DOMP5 -fopenmp-version=50 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP50
13 // RUN: %clang_cc1 -verify -fopenmp-simd -DOMP51 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP51
14 // RUN: %clang_cc1 -fopenmp-simd -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s
15 // RUN: %clang_cc1 -fopenmp-simd -DOMP51 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP51
16 // expected-no-diagnostics
23 template <class T
, int N
>
25 T b
= argc
, c
, d
, e
, f
, g
;
29 #pragma omp taskgroup task_reduction(+: d) allocate(d)
30 #pragma omp master taskloop simd allocate(d) if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+:g) in_reduction(+: d)
31 // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d) allocate(d)
32 // CHECK-NEXT: #pragma omp master taskloop simd allocate(d) if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+: g) in_reduction(+: d){{$}}
33 for (int i
= 0; i
< 2; ++i
)
35 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
38 #pragma omp master taskloop simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) simdlen(N) nogroup num_tasks(N)
39 for (int i
= 0; i
< 2; ++i
)
40 for (int j
= 0; j
< 2; ++j
)
41 for (int j
= 0; j
< 2; ++j
)
42 for (int j
= 0; j
< 2; ++j
)
43 for (int j
= 0; j
< 2; ++j
)
44 for (int i
= 0; i
< 2; ++i
)
45 for (int j
= 0; j
< 2; ++j
)
46 for (int j
= 0; j
< 2; ++j
)
47 for (int j
= 0; j
< 2; ++j
)
48 for (int j
= 0; j
< 2; ++j
)
50 // CHECK-NEXT: #pragma omp parallel
51 // CHECK-NEXT: #pragma omp master taskloop simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) simdlen(N) nogroup num_tasks(N)
52 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
53 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
54 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
55 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
56 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
57 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
58 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
59 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
60 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
61 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
66 // CHECK-LABEL: int main(int argc, char **argv) {
67 int main(int argc
, char **argv
) {
68 int b
= argc
, c
, d
, e
, f
, g
, h
;
70 // CHECK: static int a;
71 #pragma omp taskgroup task_reduction(+: d)
72 #pragma omp master taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b), aligned(argv) num_tasks(argc) reduction(*: g) in_reduction(+: d)
73 // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d)
74 // CHECK-NEXT: #pragma omp master taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b) aligned(argv) num_tasks(argc) reduction(*: g) in_reduction(+: d)
75 for (int i
= 0; i
< 2; ++i
)
77 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
81 #pragma omp master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd:argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d) order(unconstrained:concurrent)
83 #pragma omp master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd:argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d) order(concurrent)
85 #pragma omp master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e)
87 for (int i
= 0; i
< 10; ++i
)
88 for (int j
= 0; j
< 10; ++j
)
90 // CHECK-NEXT: #pragma omp parallel
91 // OMP50-NEXT: #pragma omp master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d) order(concurrent)
92 // OMP51-NEXT: #pragma omp master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d) order(unconstrained: concurrent)
93 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
94 // CHECK-NEXT: for (int j = 0; j < 10; ++j)
96 return (tmain
<int, 5>(argc
) + tmain
<char, 1>(argv
[0][0]));