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
15 template <class T
, int N
>
17 T b
= argc
, c
, d
, e
, f
, g
;
20 #pragma omp distribute dist_schedule(static,10)
21 // CHECK-NEXT: #pragma omp distribute dist_schedule(static, 10){{$}}
22 for (int i
=0; i
< 2; ++i
)a
=2;
23 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
25 #pragma omp distribute dist_schedule(static,a)
26 // CHECK-NEXT: #pragma omp distribute dist_schedule(static, a)
27 for (int i
=0; i
< 2; ++i
)a
=2;
28 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
32 #pragma omp distribute dist_schedule(static,2)
33 for (int i
= 0; i
< 10; ++i
)
34 for (int j
= 0; j
< 10; ++j
)foo();
35 // CHECK-NEXT: #pragma omp target
36 // CHECK-NEXT: #pragma omp teams
37 // CHECK-NEXT: #pragma omp distribute dist_schedule(static, 2)
38 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
39 // CHECK-NEXT: for (int j = 0; j < 10; ++j)
43 #pragma omp distribute dist_schedule(static,a)
44 for (int i
= 0; i
< 10; ++i
)
45 for (int j
= 0; j
< 10; ++j
)foo();
46 // CHECK-NEXT: #pragma omp target
47 // CHECK-NEXT: #pragma omp teams
48 // CHECK-NEXT: #pragma omp distribute dist_schedule(static, a)
49 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
50 // CHECK-NEXT: for (int j = 0; j < 10; ++j)
52 for (int i
= 0; i
< 10; ++i
)foo();
53 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
55 #pragma omp distribute
56 // CHECK: #pragma omp distribute
57 for (int i
= 0; i
< 10; ++i
)foo();
58 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
63 int main (int argc
, char **argv
) {
64 // CHECK: int main(int argc, char **argv) {
65 int b
= argc
, c
, d
, e
, f
, g
;
67 // CHECK: static int a;
68 #pragma omp distribute dist_schedule(static,10)
69 // CHECK-NEXT: #pragma omp distribute dist_schedule(static, 10)
70 for (int i
=0; i
< 2; ++i
)a
=2;
71 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
73 #pragma omp distribute dist_schedule(static,b)
74 // CHECK-NEXT: #pragma omp distribute dist_schedule(static, b)
75 for (int i
=0; i
< 2; ++i
)a
=2;
76 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
80 #pragma omp distribute dist_schedule(static,2)
81 for (int i
= 0; i
< 10; ++i
)
82 for (int j
= 0; j
< 10; ++j
)foo();
83 // CHECK-NEXT: #pragma omp target
84 // CHECK-NEXT: #pragma omp teams
85 // CHECK-NEXT: #pragma omp distribute dist_schedule(static, 2)
86 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
87 // CHECK-NEXT: for (int j = 0; j < 10; ++j)
91 #pragma omp distribute dist_schedule(static,a)
92 for (int i
= 0; i
< 10; ++i
)
93 for (int j
= 0; j
< 10; ++j
)foo();
94 // CHECK-NEXT: #pragma omp target
95 // CHECK-NEXT: #pragma omp teams
96 // CHECK-NEXT: #pragma omp distribute dist_schedule(static, a)
97 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
98 // CHECK-NEXT: for (int j = 0; j < 10; ++j)
100 for (int i
= 0; i
< 10; ++i
)foo();
101 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
102 // CHECK-NEXT: foo();
103 #pragma omp distribute
104 // CHECK: #pragma omp distribute
105 for (int i
= 0; i
< 10; ++i
)foo();
106 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
107 // CHECK-NEXT: foo();
108 return (tmain
<int, 5>(argc
) + tmain
<char, 1>(argv
[0][0]));