]>
Commit | Line | Data |
---|---|---|
ebda6173 UD |
1 | #include <stdio.h> |
2 | ||
ebda6173 | 3 | |
33c50ef4 | 4 | __thread int baz; |
ebda6173 UD |
5 | |
6 | ||
7 | int | |
8 | in_dso (int n, int *caller_bazp) | |
9 | { | |
e6f52680 | 10 | int *bazp; |
ebda6173 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 | bazp = &baz; |
e6f52680 | 17 | |
ebda6173 UD |
18 | if (caller_bazp != NULL && bazp != caller_bazp) |
19 | { | |
20 | printf ("callers address of baz differs: %p vs %p\n", caller_bazp, bazp); | |
21 | result = 1; | |
22 | } | |
23 | else if (*bazp != n) | |
24 | { | |
25 | printf ("baz != %d\n", n); | |
26 | result = 1; | |
27 | } | |
28 | ||
29 | *bazp = 16; | |
30 | ||
31 | return result; | |
32 | } |