-; RUN: llvm-as < %s | \
-; RUN: llc -mtriple=i686-pc-linux-gnu -asm-verbose=false -o %t -f
-; RUN: grep set %t | count 7
-; RUN: grep globl %t | count 6
-; RUN: grep weak %t | count 1
-; RUN: grep hidden %t | count 1
-; RUN: grep protected %t | count 1
-
-@bar = external global i32
-@foo1 = alias i32* @bar
-@foo2 = alias i32* @bar
+; RUN: llc < %s -mtriple=i686-pc-linux-gnu -asm-verbose=false \
+; RUN: -relocation-model=pic | FileCheck %s
+
+@thread_var = thread_local global i32 42, align 4
+@thread_alias = thread_local(localdynamic) alias i32, i32* @thread_var
+
+; CHECK-LABEL: get_thread_var
+define i32* @get_thread_var() {
+; CHECK: leal thread_var@TLSGD
+ ret i32* @thread_var
+}
+
+; CHECK-LABEL: get_thread_alias
+define i32* @get_thread_alias() {
+; CHECK: leal thread_alias@TLSLD
+ ret i32* @thread_alias
+}
+
+@bar = global i32 42
+
+; CHECK-DAG: .globl foo1
+@foo1 = alias i32, i32* @bar
+
+; CHECK-DAG: .globl foo2
+@foo2 = alias i32, i32* @bar