1 // RUN: %clang_cc1 -emit-pch -o %t.a %s
2 // RUN: %clang_cc1 -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)
27 inline void run1(int *List
, int Length
) {
29 #pragma clang loop vectorize_width(4)
30 #pragma clang loop interleave_count(8)
31 #pragma clang loop unroll_count(16)
38 inline void run2(int *List
, int Length
) {
40 #pragma clang loop vectorize(enable)
41 #pragma clang loop interleave(disable)
42 #pragma clang loop unroll(disable)
43 #pragma clang loop distribute(enable)
44 while (i
- 1 < Length
) {
50 inline void run3(int *List
, int Length
) {
52 #pragma clang loop vectorize(disable)
53 #pragma clang loop interleave(enable)
54 #pragma clang loop unroll(full)
55 #pragma clang loop distribute(disable)
56 while (i
- 3 < Length
) {
62 inline void run4(int *List
, int Length
) {
65 while (i
- 3 < Length
) {
71 inline void run5(int *List
, int Length
) {
74 while (i
- 3 < Length
) {
80 inline void run6(int *List
, int Length
) {
83 while (i
- 3 < Length
) {
89 template <int V
, int I
>
90 inline void run7(int *List
, int Length
) {
91 #pragma clang loop vectorize_width(V)
92 #pragma clang loop interleave_count(I)
93 for (int i
= 0; i
< Length
; i
++) {
111 pt
.run7
<2, 4>(List
, 100);