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