1  /* { dg-do compile } */
       2  /* { dg-require-effective-target fpic } */
       3  /* { dg-require-effective-target tls } */
       4  /* { dg-options "-O2 -fPIC -fdump-ipa-whole-program" } */
       5  
       6  
       7  #pragma GCC visibility push(hidden)
       8  
       9  // tls_model should be global-dynamic due to explicitly specified attribute
      10  __attribute__((tls_model("global-dynamic")))
      11  __thread int x;
      12  
      13  #pragma GCC visibility pop
      14  
      15  void reference() { x++; }
      16  
      17  /* { dg-final { scan-ipa-dump "Varpool flags: tls-global-dynamic" "whole-program" } } */