1 // RUN: %clang_cc1 -verify -fopenmp -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
2 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
3 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
4 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-enable-irbuilder -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
5 // RUN: %clang_cc1 -fopenmp -fopenmp-enable-irbuilder -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
6 // RUN: %clang_cc1 -fopenmp -fopenmp-enable-irbuilder -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
7 
8 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
9 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
10 // RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
11 // SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
12 // expected-no-diagnostics
13 #ifndef HEADER
14 #define HEADER
15 
16 template <class T>
17 T tmain(T argc) {
18   static T a;
19 #pragma omp flush
20 #pragma omp flush(a)
21   return a + argc;
22 }
23 
24 // CHECK-LABEL: @main
25 int main() {
26   static int a;
27 #pragma omp flush
28 #pragma omp flush(a)
29   // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
30   // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
31   return tmain(a);
32   // CHECK: call {{.*}} [[TMAIN:@.+]](
33   // CHECK: ret
34 }
35 
36 // CHECK: [[TMAIN]]
37 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
38 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
39 // CHECK: ret
40 
41 // CHECK-NOT: line: 0,
42 
43 #endif
44