minix/sys/external/bsd/compiler_rt/dist/lib/lsan/lit_tests/TestCases/SharedLibs/huge_tls_lib_so.cc
Lionel Sambuc 4684ddb6aa LLVM Minix changes
- import libcxx
 - reduce targets to the one when compiled as a tools

Change-Id: Iabb8427f80ff8e89463559a28bcb8b4f2bdbc496
2014-07-28 17:05:59 +02:00

12 lines
528 B
C++

// A loadable module with a large thread local section, which would require
// allocation of a new TLS storage chunk when loaded with dlopen(). We use it
// to test the reachability of such chunks in LSan tests.
// This must be large enough that it doesn't fit into preallocated static TLS
// space (see STATIC_TLS_SURPLUS in glibc).
__thread void *huge_thread_local_array[(1 << 20) / sizeof(void *)]; // NOLINT
extern "C" void **StoreToTLS(void *p) {
huge_thread_local_array[0] = p;
return &huge_thread_local_array[0];
}