1 ; RUN: llc -mtriple=arm-linux-gnueabi < %s \
2 ; RUN: | FileCheck -check-prefix=CHECK-NONPIC -check-prefix=COMMON %s
3 ; RUN: llc -mtriple=arm-linux-gnueabi -relocation-model=pic < %s \
4 ; RUN: | FileCheck -check-prefix=CHECK-PIC -check-prefix=COMMON %s
5 ; RUN: llc -emulated-tls -mtriple=arm-linux-gnueabi < %s \
6 ; RUN: | FileCheck -check-prefix=EMU -check-prefix=COMMON %s
7 ; RUN: llc -emulated-tls -mtriple=arm-linux-gnueabi -relocation-model=pic < %s \
8 ; RUN: | FileCheck -check-prefix=EMU -check-prefix=COMMON %s
11 @external_gd = external thread_local global i32
12 @internal_gd = internal thread_local global i32 42
14 @external_ld = external thread_local(localdynamic) global i32
15 @internal_ld = internal thread_local(localdynamic) global i32 42
17 @external_ie = external thread_local(initialexec) global i32
18 @internal_ie = internal thread_local(initialexec) global i32 42
20 @external_le = external thread_local(localexec) global i32
21 @internal_le = internal thread_local(localexec) global i32 42
23 ; ----- no model specified -----
30 ; Non-PIC code can use initial-exec, PIC code has to use general dynamic.
31 ; CHECK-NONPIC: external_gd(GOTTPOFF)
32 ; CHECK-PIC: external_gd(TLSGD)
33 ; EMU: __emutls_get_address
41 ; Non-PIC code can use local exec, PIC code can use local dynamic,
42 ; but that is not implemented, so falls back to general dynamic.
43 ; CHECK-NONPIC: internal_gd(TPOFF)
44 ; CHECK-PIC: internal_gd(TLSGD)
45 ; EMU: __emutls_get_address
49 ; ----- localdynamic specified -----
56 ; Non-PIC code can use initial exec, PIC should use local dynamic,
57 ; but that is not implemented, so falls back to general dynamic.
58 ; CHECK-NONPIC: external_ld(GOTTPOFF)
59 ; CHECK-PIC: external_ld(TLSGD)
60 ; EMU: __emutls_get_address
68 ; Non-PIC code can use local exec, PIC code can use local dynamic,
69 ; but that is not implemented, so it falls back to general dynamic.
70 ; CHECK-NONPIC: internal_ld(TPOFF)
71 ; CHECK-PIC: internal_ld(TLSGD)
72 ; EMU: __emutls_get_address
76 ; ----- initialexec specified -----
83 ; Non-PIC and PIC code will use initial exec as specified.
84 ; CHECK-NONPIC: external_ie(GOTTPOFF)
85 ; CHECK-PIC: external_ie(GOTTPOFF)
86 ; EMU: __emutls_get_address
94 ; Non-PIC code can use local exec, PIC code use initial exec as specified.
95 ; CHECK-NONPIC: internal_ie(TPOFF)
96 ; CHECK-PIC: internal_ie(GOTTPOFF)
97 ; EMU: __emutls_get_address
101 ; ----- localexec specified -----
105 ret i32* @external_le
108 ; Non-PIC and PIC code will use local exec as specified.
109 ; CHECK-NONPIC: external_le(TPOFF)
110 ; CHECK-PIC: external_le(TPOFF)
111 ; EMU: __emutls_get_address
116 ret i32* @internal_le
119 ; Non-PIC and PIC code will use local exec as specified.
120 ; CHECK-NONPIC: internal_le(TPOFF)
121 ; CHECK-PIC: internal_le(TPOFF)
122 ; EMU: __emutls_get_address
126 ; ----- emulated specified -----
128 ; External declaration has no initializer.
129 ; Internal definition has initializer.
131 ; EMU-NOT: __emutls_t.external_gd
132 ; EMU-NOT: __emutls_v.external_gd
134 ; EMU-LABEL: __emutls_v.internal_gd:
138 ; EMU-NEXT: .long __emutls_t.internal_gd
139 ; EMU-LABEL: __emutls_t.internal_gd:
141 ; EMU-NOT: __emutls_t.external_gd
143 ; __emutls_t and __emutls_v are the same for PIC and non-PIC modes.
145 ; EMU-NOT: __emutls_t.external_gd
146 ; EMU-NOT: __emutls_v.external_gd
148 ; EMU-LABEL: __emutls_v.internal_le:
152 ; EMU-NEXT: .long __emutls_t.internal_le
153 ; EMU-LABEL: __emutls_t.internal_le:
155 ; EMU-NOT: __emutls_t.external_le