tst-tlsmod13a.c 260 B

12345678910111213141516
  1. #include <tls.h>
  2. #if defined USE_TLS && defined HAVE___THREAD \
  3. && defined HAVE_TLS_MODEL_ATTRIBUTE
  4. __thread int b[2] __attribute__ ((tls_model ("initial-exec")));
  5. #else
  6. int b[2];
  7. #endif
  8. extern int foo (void);
  9. int
  10. bar (void)
  11. {
  12. return foo () + b[0];
  13. }