]>
Commit | Line | Data |
---|---|---|
fc093be1 UD |
1 | #include <stdio.h> |
2 | ||
3 | #include <tls.h> | |
fc093be1 UD |
4 | |
5 | #ifdef USE_TLS | |
ebda6173 UD |
6 | # include "tls-macros.h" |
7 | ||
fc093be1 UD |
8 | extern int in_dso (int n, int *caller_foop); |
9 | ||
10 | COMMON_INT_DEF(comm_n); | |
11 | ||
12 | ||
13 | ||
14 | ||
15 | int | |
16 | in_dso2 (void) | |
17 | { | |
18 | int *foop = TLS_GD (foo); | |
19 | int result = 0; | |
20 | static int n; | |
21 | int *np = TLS_GD (comm_n); | |
22 | ||
23 | if (n != *np) | |
24 | { | |
25 | printf ("n = %d != comm_n = %d\n", n, *np); | |
26 | result = 1; | |
27 | } | |
28 | ||
29 | result |= in_dso (*foop = 42 + n++, foop); | |
30 | ||
31 | *foop = 16; | |
32 | ||
33 | return result; | |
34 | } | |
35 | #endif |