[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / PCH / delayed-template-with-pragma.cpp
blobe54388456245af60abcda385ef592b6812d9d3a4
1 // RUN: %clang_cc1 -fopenmp -emit-pch -o %t.pch %s
2 // RUN: %clang_cc1 -fopenmp -fdelayed-template-parsing -emit-pch -o %t.delayed.pch %s
3 // RUN: %clang_cc1 -DMAIN_FILE -fopenmp -include-pch %t.pch \
4 // RUN: -emit-llvm -o - %s -fopenmp | FileCheck %s
5 // RUN: %clang_cc1 -DMAIN_FILE -fopenmp -fdelayed-template-parsing -verify \
6 // RUN: -Wunused-variable -include-pch %t.delayed.pch \
7 // RUN: -emit-llvm -o - %s | FileCheck %s
9 #ifndef MAIN_FILE
10 template <typename T>
11 void a(T t) {
12 #pragma clang loop unroll_count(4)
13 for(int i=0;i<8;++i) {}
14 #pragma omp simd
15 for(int i=0;i<8;++i) {}
17 int x, y, z, zz;
18 #pragma unused(x)
19 #pragma unused(y, z)
22 #else
23 // CHECK: !llvm.loop [[LOOP1:!.*]]
24 // CHECK: !llvm.loop [[LOOP2:!.*]]
25 // CHECK: [[LOOP1]] = distinct !{[[LOOP1]], [[LOOP1A:!.*]], [[LOOP1B:!.*]]}
26 // CHECK: [[LOOP1A]] = !{!"llvm.loop.mustprogress"}
27 // CHECK: [[LOOP1B]] = !{!"llvm.loop.unroll.count", i32 4}
28 // CHECK: [[LOOP2]] = distinct !{[[LOOP2]], [[LOOP2A:!.*]], [[LOOP2B:!.*]]}
29 // CHECK: [[LOOP2A]] = !{!"llvm.loop.parallel_accesses", [[LOOP2C:!.*]]}
30 // CHECK: [[LOOP2B]] = !{!"llvm.loop.vectorize.enable", i1 true}
31 // expected-warning@17 {{unused variable 'zz'}}
32 void foo()
34 a(1);
36 #endif