]> git.ipfire.org Git - thirdparty/glibc.git/blame - elf/tst-tlsmod2.c
test-container: Fix "unused code" warnings on HURD
[thirdparty/glibc.git] / elf / tst-tlsmod2.c
CommitLineData
aed283dd
UD
1#include <stdio.h>
2
fc093be1 3
33c50ef4 4__thread int foo;
aed283dd
UD
5
6
7int
8in_dso (int n, int *caller_foop)
9{
e6f52680 10 int *foop;
aed283dd
UD
11 int result = 0;
12
e6f52680 13 puts ("foo"); /* Make sure PLT is used before macros. */
046b4069 14 asm ("" ::: "memory");
e6f52680 15
33c50ef4 16 foop = &foo;
e6f52680 17
aed283dd
UD
18 if (caller_foop != NULL && foop != caller_foop)
19 {
20 printf ("callers address of foo differs: %p vs %p\n", caller_foop, foop);
21 result = 1;
22 }
23 else if (*foop != n)
24 {
25 printf ("foo != %d\n", n);
26 result = 1;
27 }
28
29 *foop = 16;
30
31 return result;
32}