mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 08:56:07 +00:00

-fopenmp turns on OpenMP support and links libiomp5 as OpenMP library. Also there is -fopenmp={libiomp5|libgomp} option that allows to override effect of -fopenmp and link libgomp library (if -fopenmp=libgomp is specified). Differential Revision: http://reviews.llvm.org/D9736 llvm-svn: 237769
27 lines
586 B
C++
27 lines
586 B
C++
// no PCH
|
|
// RUN: %clang_cc1 -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s
|
|
// with PCH
|
|
// RUN: %clang_cc1 -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s
|
|
#if !defined(PASS1)
|
|
#define PASS1
|
|
|
|
extern "C" int* malloc (int size);
|
|
int *a = malloc(20);
|
|
|
|
#elif !defined(PASS2)
|
|
#define PASS2
|
|
|
|
#pragma omp threadprivate(a)
|
|
|
|
#else
|
|
|
|
// CHECK: call {{.*}} @__kmpc_threadprivate_register(
|
|
|
|
// CHECK-LABEL: foo
|
|
int foo() {
|
|
return *a;
|
|
// CHECK: call {{.*}} @__kmpc_global_thread_num(
|
|
// CHECK: call {{.*}} @__kmpc_threadprivate_cached(
|
|
}
|
|
#endif
|