lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | #include "tst-tls10.h" |
| 2 | |
| 3 | __thread long long dummy __attribute__((visibility ("hidden"))) = 12; |
| 4 | __thread struct A a2 = { 22, 23, 24 }; |
| 5 | __thread struct A a4 __attribute__((tls_model("initial-exec"))) |
| 6 | = { 25, 26, 27 }; |
| 7 | static __thread struct A local1 = { 28, 29, 30 }; |
| 8 | static __thread struct A local2 __attribute__((tls_model("initial-exec"))) |
| 9 | = { 31, 32, 33 }; |
| 10 | |
| 11 | void |
| 12 | check2 (void) |
| 13 | { |
| 14 | if (a2.a != 22 || a2.b != 23 || a2.c != 24) |
| 15 | abort (); |
| 16 | if (a4.a != 25 || a4.b != 26 || a4.c != 27) |
| 17 | abort (); |
| 18 | if (local1.a != 28 || local1.b != 29 || local1.c != 30) |
| 19 | abort (); |
| 20 | if (local2.a != 31 || local2.b != 32 || local2.c != 33) |
| 21 | abort (); |
| 22 | } |
| 23 | |
| 24 | struct A * |
| 25 | f7a (void) |
| 26 | { |
| 27 | return &a2; |
| 28 | } |
| 29 | |
| 30 | struct A * |
| 31 | f8a (void) |
| 32 | { |
| 33 | return &a4; |
| 34 | } |
| 35 | |
| 36 | struct A * |
| 37 | f9a (void) |
| 38 | { |
| 39 | return &local1; |
| 40 | } |
| 41 | |
| 42 | struct A * |
| 43 | f10a (void) |
| 44 | { |
| 45 | return &local2; |
| 46 | } |
| 47 | |
| 48 | int |
| 49 | f7b (void) |
| 50 | { |
| 51 | return a2.b; |
| 52 | } |
| 53 | |
| 54 | int |
| 55 | f8b (void) |
| 56 | { |
| 57 | return a4.a; |
| 58 | } |
| 59 | |
| 60 | int |
| 61 | f9b (void) |
| 62 | { |
| 63 | return local1.b; |
| 64 | } |
| 65 | |
| 66 | int |
| 67 | f10b (void) |
| 68 | { |
| 69 | return local2.c; |
| 70 | } |