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 -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP50
4 // RUN: %clang_cc1 -verify -fopenmp -DOMP51 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP51
5 // RUN: %clang_cc1 -fopenmp -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s
6 // RUN: %clang_cc1 -fopenmp -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP51
8 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP50
9 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s
10 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP50
11 // RUN: %clang_cc1 -verify -fopenmp-simd -DOMP51 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP51
12 // RUN: %clang_cc1 -fopenmp-simd -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s
13 // RUN: %clang_cc1 -fopenmp-simd -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP51
14 // expected-no-diagnostics
21 template <class T
, int N
>
23 T b
= argc
, c
, d
, e
, f
, g
;
26 #pragma omp taskgroup allocate(d) task_reduction(+: d)
27 #pragma omp parallel master taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+:g) allocate(g) simdlen(8)
28 // CHECK-NEXT: #pragma omp taskgroup allocate(d) task_reduction(+: d)
29 // CHECK-NEXT: #pragma omp parallel master taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+: g) allocate(g) simdlen(8){{$}}
30 for (int i
= 0; i
< 2; ++i
)
32 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
35 #pragma omp parallel master taskloop simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) nogroup num_tasks(N) safelen(8)
36 for (int i
= 0; i
< 2; ++i
)
37 for (int j
= 0; j
< 2; ++j
)
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 i
= 0; i
< 2; ++i
)
42 for (int j
= 0; j
< 2; ++j
)
43 for (int j
= 0; j
< 2; ++j
)
44 for (int j
= 0; j
< 2; ++j
)
45 for (int j
= 0; j
< 2; ++j
)
47 // CHECK-NEXT: #pragma omp parallel
48 // CHECK-NEXT: #pragma omp parallel master taskloop simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) nogroup num_tasks(N) safelen(8)
49 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
50 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
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 i = 0; i < 2; ++i)
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 j = 0; j < 2; ++j)
58 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
63 // CHECK-LABEL: int main(int argc, char **argv) {
64 int main(int argc
, char **argv
) {
65 int b
= argc
, c
, d
, e
, f
, g
, h
;
67 // CHECK: static int a;
68 #pragma omp taskgroup task_reduction(+: d)
69 #pragma omp parallel master taskloop simd if(parallel: a) default(none) shared(a, b, argc) final(b) priority(5) num_tasks(argc) reduction(*: g) aligned(argv: 8) linear(c:b)
70 // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d)
71 // CHECK-NEXT: #pragma omp parallel master taskloop simd if(parallel: a) default(none) shared(a,b,argc) final(b) priority(5) num_tasks(argc) reduction(*: g) aligned(argv: 8) linear(c: step(b))
72 for (int i
= 0; i
< 2; ++i
)
74 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
78 #pragma omp parallel master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd:argc) mergeable priority(argc) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d) order(reproducible:concurrent)
80 #pragma omp parallel master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd:argc) mergeable priority(argc) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d) order(concurrent)
82 #pragma omp parallel master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) 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 parallel master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d) order(concurrent)
89 // OMP51-NEXT: #pragma omp parallel master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d) order(reproducible: concurrent)
90 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
91 // CHECK-NEXT: for (int j = 0; j < 10; ++j)
93 return (tmain
<int, 5>(argc
) + tmain
<char, 1>(argv
[0][0]));