brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 21b9f68 Raw
41 lines · cpp
1// no PCH2// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -emit-llvm -include %s -include %s %s -o - | FileCheck %s3// with PCH4// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s5// no PCH6// RUN: %clang_cc1 -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-17// RUN: %clang_cc1 -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-28// with PCH9// RUN: %clang_cc1 -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-110// RUN: %clang_cc1 -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-211// // UNSUPPORTED: target={{.*}}-zos{{.*}}12 13#if !defined(PASS1)14#define PASS115 16extern "C" int* malloc (int size);17int *a = malloc(20);18 19#elif !defined(PASS2)20#define PASS221 22#pragma omp threadprivate(a)23 24#else25 26// CHECK: call {{.*}} @__kmpc_threadprivate_register(27// CHECK-TLS-1: @{{a|\"\?a@@3PE?AHE?A\"}} = {{.*}}thread_local {{.*}}global {{.*}}ptr28 29// CHECK-LABEL: foo30// CHECK-TLS-LABEL: foo31int foo() {32  return *a;33  // CHECK: call {{.*}} @__kmpc_global_thread_num(34  // CHECK: call {{.*}} @__kmpc_threadprivate_cached(35  // CHECK-TLS-1: call {{.*}} @{{_ZTW1a|\"\?\?__Ea@@YAXXZ\"}}()36}37 38// CHECK-TLS-2: define {{.*}} @{{_ZTW1a|\"\?\?__Ea@@YAXXZ\"}}()39 40#endif41