]>
Commit | Line | Data |
---|---|---|
94c24227 UD |
1 | #include "tst-tls10.h" |
2 | ||
63af556f | 3 | __thread int dummy __attribute__((visibility ("hidden"))) = 12; |
94c24227 | 4 | __thread struct A local = { 1, 2, 3 }; |
94c24227 UD |
5 | |
6 | #define CHECK(N, S) \ | |
7 | p = f##N##a (); \ | |
8 | if (p->a != S || p->b != S + 1 || p->c != S + 2) \ | |
9 | abort () | |
10 | ||
29955b5d AS |
11 | static int |
12 | do_test (void) | |
94c24227 | 13 | { |
94c24227 UD |
14 | struct A *p; |
15 | if (local.a != 1 || local.b != 2 || local.c != 3) | |
16 | abort (); | |
17 | if (a1.a != 4 || a1.b != 5 || a1.c != 6) | |
18 | abort (); | |
19 | if (a2.a != 22 || a2.b != 23 || a2.c != 24) | |
20 | abort (); | |
21 | if (a3.a != 10 || a3.b != 11 || a3.c != 12) | |
22 | abort (); | |
23 | if (a4.a != 25 || a4.b != 26 || a4.c != 27) | |
24 | abort (); | |
25 | check1 (); | |
26 | check2 (); | |
27 | if (f1a () != &a1 || f2a () != &a2 || f3a () != &a3 || f4a () != &a4) | |
28 | abort (); | |
29 | CHECK (5, 16); | |
30 | CHECK (6, 19); | |
31 | if (f7a () != &a2 || f8a () != &a4) | |
32 | abort (); | |
33 | CHECK (9, 28); | |
34 | CHECK (10, 31); | |
3ce1f295 | 35 | |
94c24227 UD |
36 | exit (0); |
37 | } | |
29955b5d | 38 | |
36fe25fd | 39 | #include <support/test-driver.c> |