1 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s 2 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s 3 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -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-version=50 -fopenmp-enable-irbuilder -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s 5 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -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-version=50 -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 -fopenmp-version=50 -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s 9 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s 10 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -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 acq_rel 21 #pragma omp flush acquire 22 #pragma omp flush(a) 23 return a + argc; 24 } 25 26 // CHECK-LABEL: @main 27 int main() { 28 static int a; 29 #pragma omp flush 30 #pragma omp flush acq_rel 31 #pragma omp flush acquire 32 #pragma omp flush(a) 33 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) 34 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) 35 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) 36 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) 37 return tmain(a); 38 // CHECK: call {{.*}} [[TMAIN:@.+]]( 39 // CHECK: ret 40 } 41 42 // CHECK: [[TMAIN]] 43 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) 44 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) 45 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) 46 // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}}) 47 // CHECK: ret 48 49 // CHECK-NOT: line: 0, 50 51 #endif 52