xref: /openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/gcc.dg/tls/alias-1.c (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1*c87b03e5Sespie /* { dg-do link } */
2*c87b03e5Sespie /* Test that encode_section_info handles the change from externally
3*c87b03e5Sespie    defined to locally defined (via hidden).   Extracted from glibc.  */
4*c87b03e5Sespie 
5*c87b03e5Sespie struct __res_state {
6*c87b03e5Sespie 	char x[123];
7*c87b03e5Sespie };
8*c87b03e5Sespie 
9*c87b03e5Sespie extern __thread struct __res_state bar
10*c87b03e5Sespie   __attribute__ ((tls_model ("initial-exec")));
11*c87b03e5Sespie 
main()12*c87b03e5Sespie int main()
13*c87b03e5Sespie {
14*c87b03e5Sespie   bar.x[0] = 0;
15*c87b03e5Sespie   return 0;
16*c87b03e5Sespie }
17*c87b03e5Sespie 
18*c87b03e5Sespie __thread struct __res_state foo;
19*c87b03e5Sespie extern __thread struct __res_state bar
20*c87b03e5Sespie   __attribute__ ((alias ("foo")))
21*c87b03e5Sespie   __attribute__ ((visibility ("hidden")));
22