• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // expected-no-diagnostics
5 // REQUIRES: x86-registered-target
6 #ifndef HEADER
7 #define HEADER
8 
9 template <class T>
tmain(T argc)10 T tmain(T argc) {
11   static T a;
12 #pragma omp flush
13 #pragma omp flush(a)
14   return a + argc;
15 }
16 
17 // CHECK-LABEL: @main
main()18 int main() {
19   static int a;
20 #pragma omp flush
21 #pragma omp flush(a)
22   // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
23   // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
24   return tmain(a);
25   // CHECK: call {{.*}} [[TMAIN:@.+]](
26   // CHECK: ret
27 }
28 
29 // CHECK: [[TMAIN]]
30 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
31 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
32 // CHECK: ret
33 
34 #endif
35