1 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.8 -std=c++1y -S -emit-llvm %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64-windows-gnu -std=c++1y -S -emit-llvm %s -o - | FileCheck %s --check-prefix=MINGW
4 // CHECK: @a = internal thread_local global
5 // CHECK: @_Z2vtIiE = linkonce_odr thread_local global i32 5
6 // CHECK: @_ZZ3inlvE3loc = linkonce_odr thread_local global i32 0
7 // CHECK: @_tlv_atexit({{.*}}@_ZN1AD1Ev
8 // CHECK: call cxx_fast_tlscc i32* @_ZTW3ext()
9 // CHECK: declare cxx_fast_tlscc noundef i32* @_ZTW3ext()
10 // CHECK-DAG: define weak_odr hidden cxx_fast_tlscc noundef i32* @_ZTW2vtIiE()
11 // CHECK-DAG: define weak_odr hidden cxx_fast_tlscc noundef i32* @_ZTW2vtIvE()
12 // CHECK-DAG: define {{.*}} @_ZTW1a
14 // MINGW-DAG: define weak_odr hidden noundef i32* @_ZTW2vtIiE() {{.*}} comdat
15 // MINGW-DAG: define weak_odr hidden noundef i32* @_ZTW2vtIvE() {{.*}} comdat
23 extern thread_local
int ext
;
24 int &get_ext() { return ext
; }
27 thread_local
int vt
= 5;
29 int get_vt() { return vt
<int>; }
35 int &use_inl() { return inl(); }
37 template int vt
<void>;
38 int &get_vt_void() { return vt
<void>; }