Mention IFUNC enhancements to testsuite in NEWS.
[platform/upstream/glibc.git] / elf / tst-tlsmod3.c
1 #include <stdio.h>
2
3 #include <tls.h>
4
5 #include "tls-macros.h"
6
7 extern int in_dso (int n, int *caller_foop);
8
9 COMMON_INT_DEF(comm_n);
10
11
12
13
14 int
15 in_dso2 (void)
16 {
17   int *foop;
18   int result = 0;
19   static int n;
20   int *np;
21
22   puts ("foo");                 /* Make sure PLT is used before macros.  */
23   asm ("" ::: "memory");
24
25   foop = TLS_GD (foo);
26   np = TLS_GD (comm_n);
27
28   if (n != *np)
29     {
30       printf ("n = %d != comm_n = %d\n", n, *np);
31       result = 1;
32     }
33
34   result |= in_dso (*foop = 42 + n++, foop);
35
36   *foop = 16;
37
38   return result;
39 }