1 // RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck --check-prefix=LINUX %s
2 // RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple x86_64-apple-darwin12 | FileCheck --check-prefix=DARWIN %s
3 
4 // Regression test for PR40327
5 
6 // LINUX: @default_tls = thread_local global i32
7 // LINUX: @hidden_tls = hidden thread_local global i32
8 // LINUX: define weak_odr hidden i32* @_ZTW11default_tls()
9 // LINUX: define weak_odr hidden i32* @_ZTW10hidden_tls()
10 //
11 // DARWIN: @default_tls = internal thread_local global i32
12 // DARWIN: @hidden_tls = internal thread_local global i32
13 // DARWIN: define cxx_fast_tlscc i32* @_ZTW11default_tls()
14 // DARWIN: define hidden cxx_fast_tlscc i32* @_ZTW10hidden_tls()
15 
16 __attribute__((visibility("default"))) thread_local int default_tls;
17 __attribute__((visibility("hidden"))) thread_local int hidden_tls;
18