Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 1 | // 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 | |
| 9 | template <class T> |
| 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 |
| 18 | int main() { |
| 19 | static int a; |
| 20 | #pragma omp flush |
| 21 | #pragma omp flush(a) |
Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 22 | // CHECK: call void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) |
| 23 | // CHECK: call void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 24 | return tmain(a); |
| 25 | // CHECK: call {{.*}} [[TMAIN:@.+]]( |
| 26 | // CHECK: ret |
| 27 | } |
| 28 | |
| 29 | // CHECK: [[TMAIN]] |
Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 30 | // CHECK: call void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) |
| 31 | // CHECK: call void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 32 | // CHECK: ret |
| 33 | |
| 34 | #endif |