1 | #include <stdio.h> |
---|---|
2 | |
3 | |
4 | extern int in_dso (int n, int *caller_foop); |
5 | |
6 | extern __thread int foo; |
7 | __thread int comm_n; |
8 | |
9 | |
10 | |
11 | |
12 | int |
13 | in_dso2 (void) |
14 | { |
15 | int *foop; |
16 | int result = 0; |
17 | static int n; |
18 | int *np; |
19 | |
20 | puts (s: "foo"); /* Make sure PLT is used before macros. */ |
21 | asm (""::: "memory"); |
22 | |
23 | foop = &foo; |
24 | np = &comm_n; |
25 | |
26 | if (n != *np) |
27 | { |
28 | printf (format: "n = %d != comm_n = %d\n", n, *np); |
29 | result = 1; |
30 | } |
31 | |
32 | result |= in_dso (n: *foop = 42 + n++, caller_foop: foop); |
33 | |
34 | *foop = 16; |
35 | |
36 | return result; |
37 | } |
38 |