[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / tls-init-funcs.cpp
blobd22d491b782494bdb76a4e972d2a36171256dcc7
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
17 struct A {
18 ~A();
21 thread_local A a;
23 extern thread_local int ext;
24 int &get_ext() { return ext; }
26 template <typename T>
27 thread_local int vt = 5;
29 int get_vt() { return vt<int>; }
31 inline int &inl() {
32 thread_local int loc;
33 return loc;
35 int &use_inl() { return inl(); }
37 template int vt<void>;
38 int &get_vt_void() { return vt<void>; }