1 // RUN: %clang_cc1 -verify -fopenmp -DOMP5 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP50
2 // RUN: %clang_cc1 -fopenmp -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s
3 // RUN: %clang_cc1 -fopenmp -DOMP5 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP50
4 // RUN: %clang_cc1 -verify -fopenmp -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
5 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
6 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
8 // RUN: %clang_cc1 -verify -fopenmp-simd -DOMP5 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP50
9 // RUN: %clang_cc1 -fopenmp-simd -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s
10 // RUN: %clang_cc1 -fopenmp-simd -DOMP5 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP50
11 // RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
12 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
13 // RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
14 // expected-no-diagnostics
21 template <class T
, int N
>
23 T b
= argc
, c
, d
, e
, f
, g
;
27 #pragma omp taskgroup task_reduction(+: d) allocate(d)
28 #pragma omp masked 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)
29 // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d) allocate(d)
30 // CHECK-NEXT: #pragma omp masked 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 for (int i
= 0; i
< 2; ++i
)
33 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
36 #pragma omp masked 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)
37 for (int i
= 0; i
< 2; ++i
)
38 for (int j
= 0; j
< 2; ++j
)
39 for (int j
= 0; j
< 2; ++j
)
40 for (int j
= 0; j
< 2; ++j
)
41 for (int j
= 0; j
< 2; ++j
)
42 for (int i
= 0; i
< 2; ++i
)
43 for (int j
= 0; j
< 2; ++j
)
44 for (int j
= 0; j
< 2; ++j
)
45 for (int j
= 0; j
< 2; ++j
)
46 for (int j
= 0; j
< 2; ++j
)
48 // CHECK-NEXT: #pragma omp parallel
49 // CHECK-NEXT: #pragma omp masked 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)
50 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
51 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
52 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
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 i = 0; i < 2; ++i)
56 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
57 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
58 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
59 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
64 // CHECK-LABEL: int main(int argc, char **argv) {
65 int main(int argc
, char **argv
) {
66 int b
= argc
, c
, d
, e
, f
, g
, h
;
69 // CHECK: static int a;
70 #pragma omp taskgroup task_reduction(+: d)
71 #pragma omp masked 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) filter(tid)
72 // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d)
73 // CHECK-NEXT: #pragma omp masked 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) filter(tid)
74 for (int i
= 0; i
< 2; ++i
)
76 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
80 #pragma omp masked 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) filter(tid)
82 #pragma omp masked 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)
84 for (int i
= 0; i
< 10; ++i
)
85 for (int j
= 0; j
< 10; ++j
)
87 // CHECK-NEXT: #pragma omp parallel
88 // OMP50-NEXT: #pragma omp masked 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) filter(tid)
89 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
90 // CHECK-NEXT: for (int j = 0; j < 10; ++j)
92 return (tmain
<int, 5>(argc
) + tmain
<char, 1>(argv
[0][0]));