blob: 7dc58f47fb3ab06a514b7717a03c8d0c4247b56a [file] [log] [blame]
Stephen Hines176edba2014-12-01 14:53:08 -08001// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
2// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
3// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
4// expected-no-diagnostics
5
6#ifndef HEADER
7#define HEADER
8
9template <class T>
10T 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
18int main() {
19 static int a;
20#pragma omp flush
21#pragma omp flush(a)
Stephen Hines0e2c34f2015-03-23 12:09:02 -070022 // CHECK: call void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
23 // CHECK: call void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
Stephen Hines176edba2014-12-01 14:53:08 -080024 return tmain(a);
25 // CHECK: call {{.*}} [[TMAIN:@.+]](
26 // CHECK: ret
27}
28
29// CHECK: [[TMAIN]]
Stephen Hines0e2c34f2015-03-23 12:09:02 -070030// CHECK: call void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
31// CHECK: call void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
Stephen Hines176edba2014-12-01 14:53:08 -080032// CHECK: ret
33
34#endif