1 ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -asm-verbose=false \
2 ; RUN: -relocation-model=pic | FileCheck %s
4 @thread_var = thread_local global i32 42, align 4
5 @thread_alias = thread_local(localdynamic) alias i32, i32* @thread_var
7 ; CHECK-LABEL: get_thread_var
8 define i32* @get_thread_var() {
9 ; CHECK: leal thread_var@TLSGD
13 ; CHECK-LABEL: get_thread_alias
14 define i32* @get_thread_alias() {
15 ; CHECK: leal thread_alias@TLSLD
16 ret i32* @thread_alias
21 ; CHECK-DAG: .globl foo1
22 @foo1 = alias i32, i32* @bar
24 ; CHECK-DAG: .globl foo2
25 @foo2 = alias i32, i32* @bar
32 ; CHECK-DAG: .weak bar_f
33 @bar_f = weak alias %FunTy, %FunTy* @foo_f
35 @bar_l = linkonce_odr alias i32, i32* @bar
36 ; CHECK-DAG: .weak bar_l
38 @bar_i = internal alias i32, i32* @bar
41 @A = alias i64, bitcast (i32* @bar to i64*)
43 ; CHECK-DAG: .globl bar_h
44 ; CHECK-DAG: .hidden bar_h
45 @bar_h = hidden alias i32, i32* @bar
47 ; CHECK-DAG: .globl bar_p
48 ; CHECK-DAG: .protected bar_p
49 @bar_p = protected alias i32, i32* @bar
51 ; CHECK-DAG: .set test2, bar+4
52 @test2 = alias i32, getelementptr(i32, i32* @bar, i32 1)
54 ; CHECK-DAG: .set test3, 42
55 @test3 = alias i32, inttoptr(i32 42 to i32*)
57 ; CHECK-DAG: .set test4, bar
58 @test4 = alias i32, inttoptr(i64 ptrtoint (i32* @bar to i64) to i32*)
60 ; CHECK-DAG: .set test5, test2-bar
61 @test5 = alias i32, inttoptr(i32 sub (i32 ptrtoint (i32* @test2 to i32),
62 i32 ptrtoint (i32* @bar to i32)) to i32*)
64 ; CHECK-DAG: .globl test
67 %tmp = load i32, i32* @foo1
68 %tmp1 = load i32, i32* @foo2
69 %tmp0 = load i32, i32* @bar_i
70 %tmp2 = call i32 @foo_f()
71 %tmp3 = add i32 %tmp, %tmp2
72 %tmp4 = call i32 @bar_f()
73 %tmp5 = add i32 %tmp3, %tmp4
74 %tmp6 = add i32 %tmp1, %tmp5
75 %tmp7 = add i32 %tmp6, %tmp0