brintos

brintos / llvm-project-archived public Read only

0
0
Text · 384 B · 4cbdb77 Raw
22 lines · cpp
1// Test that executable with ELF-TLS will link/run successfully2// RUN: %clangxx -fno-emulated-tls %s -o %t3// RUN: %run %t 2>&14// REQUIRES: android-295 6#include <stdio.h>7#include <stdlib.h>8 9__thread void *tls_var;10int var;11 12void set_var() {13  var = 123;14  tls_var = &var;15}16int main() {17  set_var();18  fprintf(stderr, "Test alloc: %p\n", tls_var);19  fflush(stderr);20  return 0;21}22