[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / PCH / chain-openmp-threadprivate.cpp
blob05cd65063789b6a84417e3f5f0b31fa4e071e63b
1 // no PCH
2 // RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -emit-llvm -include %s -include %s %s -o - | FileCheck %s
3 // with PCH
4 // RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s
5 // no PCH
6 // RUN: %clang_cc1 -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-1
7 // RUN: %clang_cc1 -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-2
8 // with PCH
9 // RUN: %clang_cc1 -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-1
10 // RUN: %clang_cc1 -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-2
12 #if !defined(PASS1)
13 #define PASS1
15 extern "C" int* malloc (int size);
16 int *a = malloc(20);
18 #elif !defined(PASS2)
19 #define PASS2
21 #pragma omp threadprivate(a)
23 #else
25 // CHECK: call {{.*}} @__kmpc_threadprivate_register(
26 // CHECK-TLS-1: @{{a|\"\?a@@3PE?AHE?A\"}} = {{.*}}thread_local {{.*}}global {{.*}}ptr
28 // CHECK-LABEL: foo
29 // CHECK-TLS-LABEL: foo
30 int foo() {
31 return *a;
32 // CHECK: call {{.*}} @__kmpc_global_thread_num(
33 // CHECK: call {{.*}} @__kmpc_threadprivate_cached(
34 // CHECK-TLS-1: call {{.*}} @{{_ZTW1a|\"\?\?__Ea@@YAXXZ\"}}()
37 // CHECK-TLS-2: define {{.*}} @{{_ZTW1a|\"\?\?__Ea@@YAXXZ\"}}()
39 #endif