[VPlan] Perform DT expensive input DT verification earlier (NFC).
[llvm-project.git] / clang / test / OpenMP / flush_codegen.cpp
blobfa2586d9fe258dae5147eec92b6c8c4919fac1f7
1 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
2 // RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -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=51 -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=51 -fopenmp-enable-irbuilder -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
5 // RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -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=51 -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
8 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
9 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -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=51 -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
16 template <class T>
17 T tmain(T argc) {
18 static T a;
19 #pragma omp flush
20 #pragma omp flush seq_cst
21 #pragma omp flush acq_rel
22 #pragma omp flush acquire
23 #pragma omp flush release
24 #pragma omp flush(a)
25 return a + argc;
28 // CHECK-LABEL: @main
29 int main() {
30 static int a;
31 #pragma omp flush
32 #pragma omp flush seq_cst
33 #pragma omp flush acq_rel
34 #pragma omp flush acquire
35 #pragma omp flush release
36 #pragma omp flush(a)
37 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
38 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
39 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
40 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
41 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
42 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
43 return tmain(a);
44 // CHECK: call {{.*}} [[TMAIN:@.+]](
45 // CHECK: ret
48 // CHECK: [[TMAIN]]
49 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
50 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
51 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
52 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
53 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
54 // CHECK: call {{.*}}void @__kmpc_flush(ptr {{(@|%).+}})
55 // CHECK: ret
57 // CHECK-NOT: line: 0,
59 #endif