]>
Commit | Line | Data |
---|---|---|
aed283dd UD |
1 | #include <stdio.h> |
2 | ||
fc093be1 | 3 | |
33c50ef4 | 4 | __thread int foo; |
aed283dd UD |
5 | |
6 | ||
7 | int | |
8 | in_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 | } |