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