1 /* { dg-do compile } */ 2 /* { dg-require-weak "" } */ 3 /* { dg-require-visibility "" } */ 4 /* { dg-require-effective-target tls_emulated } */ 5 /* { dg-add-options tls } */ 6 __attribute__((weak)) 7 __attribute__((visibility ("hidden"))) 8 __thread int tlsvar = 3; 9 /* { dg-final { scan-assembler ".weak_definition ___emutls_t.tlsvar" { target *-*-darwin* } } } */ 10 /* { dg-final { scan-assembler ".private_extern ___emutls_t.tlsvar" { target *-*-darwin* } } } */ 11