1 // no PCH
2 // RUN: %clang_cc1 -fopenmp=libiomp5 -emit-llvm -include %s -include %s %s -o - | FileCheck %s
3 // with PCH
4 // RUN: %clang_cc1 -fopenmp=libiomp5 -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s
5 #if !defined(PASS1)
6 #define PASS1
7 
8 extern "C" int* malloc (int size);
9 int *a = malloc(20);
10 
11 #elif !defined(PASS2)
12 #define PASS2
13 
14 #pragma omp threadprivate(a)
15 
16 #else
17 
18 // CHECK: call {{.*}} @__kmpc_threadprivate_register(
19 
20 // CHECK-LABEL: foo
foo()21 int foo() {
22   return *a;
23   // CHECK: call {{.*}} @__kmpc_global_thread_num(
24   // CHECK: call {{.*}} @__kmpc_threadprivate_cached(
25 }
26 #endif
27