1 // RUN: %clang_cc1 -ast-print %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -DMS_EXT -fsyntax-only -fms-extensions %s -triple x86_64-pc-win32 -ast-print | FileCheck %s --check-prefix=MS-EXT
4 // CHECK: #pragma clang loop vectorize_width(4)
5 // CHECK-NEXT: #pragma clang loop interleave_count(8){{$}}
7 void test(int *List
, int Length
) {
9 #pragma clang loop vectorize_width(4)
10 #pragma clang loop interleave_count(8)
11 // CHECK-NEXT: while (i < Length)
18 // CHECK: #pragma clang loop vectorize_width(4, scalable)
20 #pragma clang loop vectorize_width(4, scalable)
21 // CHECK-NEXT: while (i < Length)
28 // CHECK: #pragma clang loop vectorize_width(fixed)
30 #pragma clang loop vectorize_width(fixed)
31 // CHECK-NEXT: while (i < Length)
38 // CHECK: #pragma clang loop vectorize_width(scalable)
40 #pragma clang loop vectorize_width(scalable)
41 // CHECK-NEXT: while (i < Length)
47 // CHECK: #pragma clang loop distribute(disable)
48 // CHECK-NEXT: #pragma clang loop vectorize(enable)
49 // CHECK-NEXT: #pragma clang loop interleave(disable)
50 // CHECK-NEXT: #pragma clang loop vectorize_predicate(disable)
52 #pragma clang loop distribute(disable)
53 #pragma clang loop vectorize(enable)
54 #pragma clang loop interleave(disable)
55 #pragma clang loop vectorize_predicate(disable)
56 // CHECK-NEXT: while (i - 1 < Length)
57 while (i
- 1 < Length
) {
62 // CHECK: #pragma clang loop distribute(enable)
63 // CHECK-NEXT: #pragma clang loop vectorize(disable)
64 // CHECK-NEXT: #pragma clang loop interleave(enable)
65 // CHECK-NEXT: #pragma clang loop vectorize_predicate(enable)
67 #pragma clang loop distribute(enable)
68 #pragma clang loop vectorize(disable)
69 #pragma clang loop interleave(enable)
70 #pragma clang loop vectorize_predicate(enable)
71 // CHECK-NEXT: while (i - 2 < Length)
72 while (i
- 2 < Length
) {
78 template <int V
, int I
>
79 void test_nontype_template_param(int *List
, int Length
) {
80 #pragma clang loop vectorize_width(V) interleave_count(I)
81 for (int i
= 0; i
< Length
; i
++) {
86 // CHECK: #pragma clang loop vectorize_width(V)
87 // CHECK: #pragma clang loop interleave_count(I)
89 void test_templates(int *List
, int Length
) {
90 test_nontype_template_param
<2, 4>(List
, Length
);
94 #pragma init_seg(compiler)
95 // MS-EXT: #pragma init_seg (.CRT$XCC){{$}}
96 // MS-EXT-NEXT: __declspec(thread) int x = 3;
97 __declspec(thread
) int x
= 3;