1 #include <stdio.h> 2 3 extern void abort (void); 4 5 __thread int tls_ie __attribute__((tls_model("initial-exec"))) = 4; 6 get_ie(void)7int get_ie (void) 8 { 9 return tls_ie; 10 } 11 get_iep(void)12int *get_iep (void) 13 { 14 return &tls_ie; 15 } 16 main(void)17int main (void) 18 { 19 int val; 20 21 val = get_ie (); 22 if (val != 4) 23 abort (); 24 25 val = *get_iep (); 26 if (val != 4) 27 abort (); 28 29 printf ("IE: %d\n", val); 30 31 return 0; 32 } 33