2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / noplt-ld-1.c
blob87698301bff16daeeaff21228367c34b63f4d8ff
1 /* { dg-do compile { target { *-*-linux* && tls_get_addr_via_got } } } */
2 /* { dg-options "-fpic -fno-plt" } */
4 static __thread int ld;
6 int *
7 get_ld (void)
9 return &ld;
12 void
13 set_ld (int i)
15 ld = i;
18 int
19 test_ld (int i)
21 return ld == i;
24 /* { dg-final { scan-assembler "call\[ \t\]\\*__tls_get_addr@GOTPCREL" { target { ! ia32 } } } } */
25 /* { dg-final { scan-assembler "call\[ \t\]\\*___tls_get_addr@GOT\\(" { target ia32 } } } */
26 /* { dg-final { scan-assembler-not "call\[ \t\]__tls_get_addr@PLT" { target { ! ia32 } } } } */
27 /* { dg-final { scan-assembler-not "call\[ \t\]___tls_get_addr@PLT" { target ia32 } } } */