.
[glibc.git] / elf / tst-tlsmod3.c
blob4a8aad659f6aee294417b99ddbdeaed5737e7500
1 #include <stdio.h>
3 #include <tls.h>
5 #ifdef USE_TLS
6 # include "tls-macros.h"
8 extern int in_dso (int n, int *caller_foop);
10 COMMON_INT_DEF(comm_n);
15 int
16 in_dso2 (void)
18 int *foop;
19 int result = 0;
20 static int n;
21 int *np;
23 puts ("foo"); /* Make sure PLT is used before macros. */
24 asm ("" ::: "memory");
26 foop = TLS_GD (foo);
27 np = TLS_GD (comm_n);
29 if (n != *np)
31 printf ("n = %d != comm_n = %d\n", n, *np);
32 result = 1;
35 result |= in_dso (*foop = 42 + n++, foop);
37 *foop = 16;
39 return result;
41 #endif