Files
clang-p2996/compiler-rt/test/sanitizer_common/TestCases/Linux/use_tls_test.cpp
Ryan Prichard b834d63094 [sanitizer] Android ELF TLS is supported from Q (API 29)
Reviewed By: oontvoo, MaskRay

Differential Revision: https://reviews.llvm.org/D103214
2021-05-27 14:53:49 -07:00

22 lines
384 B
C++

// Test that executable with ELF-TLS will link/run successfully
// RUN: %clangxx -fno-emulated-tls %s -o %t
// RUN: %run %t 2>&1
// REQUIRES: android-29
#include <stdio.h>
#include <stdlib.h>
__thread void *tls_var;
int var;
void set_var() {
var = 123;
tls_var = &var;
}
int main() {
set_var();
fprintf(stderr, "Test alloc: %p\n", tls_var);
fflush(stderr);
return 0;
}