unistd: Improve fortify with clang
[glibc.git] / elf / tst-tlsmod3.c
blobd6e7498fd8331cb791c9f0e7cf70a78cba39d010
1 #include <stdio.h>
4 extern int in_dso (int n, int *caller_foop);
6 extern __thread int foo;
7 __thread int comm_n;
12 int
13 in_dso2 (void)
15 int *foop;
16 int result = 0;
17 static int n;
18 int *np;
20 puts ("foo"); /* Make sure PLT is used before macros. */
21 asm ("" ::: "memory");
23 foop = &foo;
24 np = &comm_n;
26 if (n != *np)
28 printf ("n = %d != comm_n = %d\n", n, *np);
29 result = 1;
32 result |= in_dso (*foop = 42 + n++, foop);
34 *foop = 16;
36 return result;