binutils-gdb/ld/testsuite/ld-i386/tlsdesc1a.c
H.J. Lu 1670f9c154 x86: Add run-time tests for -mtls-dialect=gnu2
* testsuite/config/default.exp (GNU2_CFLAGS): New.  Set
	to -mtls-dialect=gnu2 if target compiler supports it.
	* testsuite/ld-i386/tls.exp: Run -mtls-dialect=gnu2 tests.
	* testsuite/ld-x86-64/tls.exp: Likewise.
	* testsuite/ld-i386/tlsdesc1a.c: New file.
	* testsuite/ld-i386/tlsdesc1b.c: Likewise.
	* testsuite/ld-x86-64/tlsdesc1a.c: Likewise.
	* testsuite/ld-x86-64/tlsdesc1b.c: Likewise.
2017-04-28 12:42:18 -07:00

20 lines
234 B
C

#include <stdlib.h>
#include <stdio.h>
extern int foo (void);
extern __thread int yyy;
__thread int zzz = 20;
int
main (void)
{
if (foo () != zzz)
abort ();
if (yyy != 100)
abort ();
printf ("PASS\n");
return 0;
}