Back to index

glibc  2.9
tst-tlsmod8.c
Go to the documentation of this file.
00001 #include "tst-tls10.h"
00002 
00003 #ifdef USE_TLS__THREAD
00004 __thread long long dummy __attribute__((visibility ("hidden"))) = 12;
00005 __thread struct A a2 = { 22, 23, 24 };
00006 __thread struct A a4 __attribute__((tls_model("initial-exec")))
00007   = { 25, 26, 27 };
00008 static __thread struct A local1 = { 28, 29, 30 };
00009 static __thread struct A local2 __attribute__((tls_model("initial-exec")))
00010   = { 31, 32, 33 };
00011 
00012 void
00013 check2 (void)
00014 {
00015   if (a2.a != 22 || a2.b != 23 || a2.c != 24)
00016     abort ();
00017   if (a4.a != 25 || a4.b != 26 || a4.c != 27)
00018     abort ();
00019   if (local1.a != 28 || local1.b != 29 || local1.c != 30)
00020     abort ();
00021   if (local2.a != 31 || local2.b != 32 || local2.c != 33)
00022     abort ();
00023 }
00024 
00025 struct A *
00026 f7a (void)
00027 {
00028   return &a2;
00029 }
00030 
00031 struct A *
00032 f8a (void)
00033 {
00034   return &a4;
00035 }
00036 
00037 struct A *
00038 f9a (void)
00039 {
00040   return &local1;
00041 }
00042 
00043 struct A *
00044 f10a (void)
00045 {
00046   return &local2;
00047 }
00048 
00049 int
00050 f7b (void)
00051 {
00052   return a2.b;
00053 }
00054 
00055 int
00056 f8b (void)
00057 {
00058   return a4.a;
00059 }
00060 
00061 int
00062 f9b (void)
00063 {
00064   return local1.b;
00065 }
00066 
00067 int
00068 f10b (void)
00069 {
00070   return local2.c;
00071 }
00072 #endif