unwind.h: Move to libc/sysdeps from nptl sysdeps
[uclibc-ng.git] / test / tls / tst-tlsmod4.c
blob4893cdae716b1959946dd197216335427d14252d
1 #include <stdio.h>
3 #include <tls.h>
5 #ifdef USE_TLS
6 # include "tls-macros.h"
9 COMMON_INT_DEF(baz);
12 int
13 in_dso (int n, int *caller_bazp)
15 int *bazp;
16 int result = 0;
18 puts ("foo"); /* Make sure PLT is used before macros. */
19 __asm__ ("" ::: "memory");
21 bazp = TLS_GD (baz);
23 if (caller_bazp != NULL && bazp != caller_bazp)
25 printf ("callers address of baz differs: %p vs %p\n", caller_bazp, bazp);
26 result = 1;
28 else if (*bazp != n)
30 printf ("baz != %d\n", n);
31 result = 1;
34 *bazp = 16;
36 return result;
38 #endif