1 // RUN: %clang_cc1 -fopenmp -emit-pch -o %t.a %s
2 // RUN: %clang_cc1 -fopenmp -include-pch %t.a %s -ast-print -o - | FileCheck %s
4 // CHECK: #pragma clang loop vectorize_width(4)
5 // CHECK: #pragma clang loop interleave_count(8)
6 // CHECK: #pragma clang loop unroll_count(16){{$}}
7 // CHECK: #pragma clang loop vectorize(enable)
8 // CHECK: #pragma clang loop interleave(disable)
9 // CHECK: #pragma clang loop unroll(disable)
10 // CHECK: #pragma clang loop distribute(enable)
11 // CHECK: #pragma clang loop vectorize(disable)
12 // CHECK: #pragma clang loop interleave(enable)
13 // CHECK: #pragma clang loop unroll(full)
14 // CHECK: #pragma clang loop distribute(disable)
15 // FIXME: "#pragma unroll (enable)" is invalid and is not the input source.
16 // CHECK: #pragma unroll (enable){{$}}
17 // CHECK: #pragma unroll (32){{$}}
18 // CHECK: #pragma nounroll{{$}}
19 // CHECK: #pragma clang loop vectorize_width(V)
20 // CHECK: #pragma clang loop interleave_count(I)
21 // CHECK: #pragma omp loop bind(thread)
22 // CHECK: #pragma omp loop bind(parallel)
23 // CHECK: #pragma omp loop bind(teams)
30 inline void run1(int *List
, int Length
) {
32 #pragma clang loop vectorize_width(4)
33 #pragma clang loop interleave_count(8)
34 #pragma clang loop unroll_count(16)
41 inline void run2(int *List
, int Length
) {
43 #pragma clang loop vectorize(enable)
44 #pragma clang loop interleave(disable)
45 #pragma clang loop unroll(disable)
46 #pragma clang loop distribute(enable)
47 while (i
- 1 < Length
) {
53 inline void run3(int *List
, int Length
) {
55 #pragma clang loop vectorize(disable)
56 #pragma clang loop interleave(enable)
57 #pragma clang loop unroll(full)
58 #pragma clang loop distribute(disable)
59 while (i
- 3 < Length
) {
65 inline void run4(int *List
, int Length
) {
68 while (i
- 3 < Length
) {
74 inline void run5(int *List
, int Length
) {
77 while (i
- 3 < Length
) {
83 inline void run6(int *List
, int Length
) {
86 while (i
- 3 < Length
) {
92 template <int V
, int I
>
93 inline void run7(int *List
, int Length
) {
94 #pragma clang loop vectorize_width(V)
95 #pragma clang loop interleave_count(I)
96 for (int i
= 0; i
< Length
; i
++) {
101 inline void run8(int *List
, int Length
) {
103 #pragma omp loop bind(thread)
104 for (int i
= 0; i
< Length
; i
++) {
109 inline void run9(int *List
, int Length
) {
111 #pragma omp loop bind(parallel)
112 for (int i
= 0; i
< Length
; i
++) {
117 inline void run10(int *List
, int Length
) {
121 for (int i
= 0; i
< Length
; i
++) {
122 #pragma omp loop bind(teams)
123 for (int j
= 0; j
< Length
; j
++) {
142 pt
.run7
<2, 4>(List
, 100);