4 __thread
int foo
, bar
__attribute__ ((tls_model("global-dynamic")));
5 extern __thread
int baz
__attribute__ ((tls_model("global-dynamic")));
6 extern __thread
int foo_ie
asm ("foo") __attribute__ ((tls_model("initial-exec")));
7 extern __thread
int bar_ie
asm ("bar") __attribute__ ((tls_model("initial-exec")));
8 extern __thread
int baz_ie
asm ("baz") __attribute__ ((tls_model("initial-exec")));
11 extern int in_dso (void);
19 /* Get variables using initial exec model. */
20 fputs ("get sum of foo and bar (IE)", stdout
);
21 asm ("" ::: "memory");
24 printf (" = %d\n", *ap
+ *bp
);
25 result
|= *ap
+ *bp
!= 3;
28 printf ("foo = %d\n", *ap
);
33 printf ("bar = %d\n", *bp
);
38 /* Get variables using generic dynamic model or TLSDESC. */
39 fputs ("get sum of foo and bar and baz (GD or TLSDESC)", stdout
);
43 printf (" = %d\n", *ap
+ *bp
+ *cp
);
44 result
|= *ap
+ *bp
+ *cp
!= 6;
47 printf ("foo = %d\n", *ap
);
52 printf ("bar = %d\n", *bp
);
57 printf ("baz = %d\n", *cp
);