1// RUN: %clang_cc1 -triple i686-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s
2
3// CHECK: @b = external thread_local global
4// CHECK: @d.e = internal thread_local global
5// CHECK: @d.f = internal thread_local global
6// CHECK: @f.a = internal thread_local(initialexec) global
7// CHECK: @a = thread_local global
8// CHECK: @g = thread_local global
9// CHECK: @h = thread_local(localdynamic) global
10// CHECK: @i = thread_local(initialexec) global
11// CHECK: @j = thread_local(localexec) global
12
13// CHECK-NOT: @_ZTW
14// CHECK-NOT: @_ZTH
15
16__thread int a;
17extern __thread int b;
18int c() { return *&b; }
19int d() {
20  __thread static int e;
21  __thread static union {float a; int b;} f = {.b = 1};
22  return 0;
23}
24
25__thread int g __attribute__((tls_model("global-dynamic")));
26__thread int h __attribute__((tls_model("local-dynamic")));
27__thread int i __attribute__((tls_model("initial-exec")));
28__thread int j __attribute__((tls_model("local-exec")));
29
30int f() {
31  __thread static int a __attribute__((tls_model("initial-exec")));
32  return a++;
33}
34