1 /* glibc test for TLS in ld.so. */
5 #include "tls-macros.h"
8 /* Two 'int' variables in TLS. */
21 /* Set the variable using the local exec model. */
22 puts ("set bar to 1 (LE)");
27 /* Get variables using initial exec model. */
28 fputs ("get sum of foo and bar (IE)", stdout
);
31 printf (" = %d\n", *ap
+ *bp
);
32 result
|= *ap
+ *bp
!= 1;
35 printf ("foo = %d\n", *ap
);
40 printf ("bar = %d\n", *bp
);
45 /* Get variables using local dynamic model. */
46 fputs ("get sum of foo and bar (LD)", stdout
);
49 printf (" = %d\n", *ap
+ *bp
);
50 result
|= *ap
+ *bp
!= 1;
53 printf ("foo = %d\n", *ap
);
58 printf ("bar = %d\n", *bp
);
63 /* Get variables using generic dynamic model. */
64 fputs ("get sum of foo and bar (GD)", stdout
);
67 printf (" = %d\n", *ap
+ *bp
);
68 result
|= *ap
+ *bp
!= 1;
71 printf ("foo = %d\n", *ap
);
76 printf ("bar = %d\n", *bp
);