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 check2(void)12check2 (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 * f7a(void)25f7a (void) 26 { 27 return &a2; 28 } 29 30 struct A * f8a(void)31f8a (void) 32 { 33 return &a4; 34 } 35 36 struct A * f9a(void)37f9a (void) 38 { 39 return &local1; 40 } 41 42 struct A * f10a(void)43f10a (void) 44 { 45 return &local2; 46 } 47 48 int f7b(void)49f7b (void) 50 { 51 return a2.b; 52 } 53 54 int f8b(void)55f8b (void) 56 { 57 return a4.a; 58 } 59 60 int f9b(void)61f9b (void) 62 { 63 return local1.b; 64 } 65 66 int f10b(void)67f10b (void) 68 { 69 return local2.c; 70 } 71