[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / AST / ast-print-pragmas.cpp
blob5059c5710189ee79d005817a873d5cb505b5eeb3
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) {
8 int i = 0;
9 #pragma clang loop vectorize_width(4)
10 #pragma clang loop interleave_count(8)
11 // CHECK-NEXT: while (i < Length)
12 while (i < Length) {
13 List[i] = i * 2;
14 i++;
16 i = 0;
18 // CHECK: #pragma clang loop vectorize_width(4, scalable)
20 #pragma clang loop vectorize_width(4, scalable)
21 // CHECK-NEXT: while (i < Length)
22 while (i < Length) {
23 List[i] = i * 2;
24 i++;
26 i = 0;
28 // CHECK: #pragma clang loop vectorize_width(fixed)
30 #pragma clang loop vectorize_width(fixed)
31 // CHECK-NEXT: while (i < Length)
32 while (i < Length) {
33 List[i] = i * 2;
34 i++;
36 i = 0;
38 // CHECK: #pragma clang loop vectorize_width(scalable)
40 #pragma clang loop vectorize_width(scalable)
41 // CHECK-NEXT: while (i < Length)
42 while (i < Length) {
43 List[i] = i * 2;
44 i++;
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) {
58 List[i] = i * 2;
59 i++;
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) {
73 List[i] = i * 2;
74 i++;
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++) {
82 List[i] = 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);
93 #ifdef MS_EXT
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;
98 #endif //MS_EXT