1 /* glibc test for TLS in ld.so. */
4 #include "tls-macros.h"
7 /* Two common 'int' variables in TLS. */
12 #define TEST_FUNCTION do_test ()
20 /* Set the variable using the local exec model. */
21 puts ("set bar to 1 (LE)");
26 /* Get variables using initial exec model. */
27 fputs ("get sum of foo and bar (IE)", stdout
);
30 printf (" = %d\n", *ap
+ *bp
);
31 result
|= *ap
+ *bp
!= 1;
34 printf ("foo = %d\n", *ap
);
39 printf ("bar = %d\n", *bp
);
44 /* Get variables using local dynamic model. */
45 fputs ("get sum of foo and bar (LD)", stdout
);
48 printf (" = %d\n", *ap
+ *bp
);
49 result
|= *ap
+ *bp
!= 1;
52 printf ("foo = %d\n", *ap
);
57 printf ("bar = %d\n", *bp
);
62 /* Get variables using generic dynamic model. */
63 fputs ("get sum of foo and bar (GD)", stdout
);
66 printf (" = %d\n", *ap
+ *bp
);
67 result
|= *ap
+ *bp
!= 1;
70 printf ("foo = %d\n", *ap
);
75 printf ("bar = %d\n", *bp
);
83 #include "../test-skeleton.c"