1 ; RUN: llc -march=arm -mtriple=arm-linux-gnueabi < %s | FileCheck -check-prefix=CHECK-NONPIC %s
2 ; RUN: llc -march=arm -mtriple=arm-linux-gnueabi -relocation-model=pic < %s | FileCheck -check-prefix=CHECK-PIC %s
5 @external_gd = external thread_local global i32
6 @internal_gd = internal thread_local global i32 42
8 @external_ld = external thread_local(localdynamic) global i32
9 @internal_ld = internal thread_local(localdynamic) global i32 42
11 @external_ie = external thread_local(initialexec) global i32
12 @internal_ie = internal thread_local(initialexec) global i32 42
14 @external_le = external thread_local(localexec) global i32
15 @internal_le = internal thread_local(localexec) global i32 42
17 ; ----- no model specified -----
23 ; Non-PIC code can use initial-exec, PIC code has to use general dynamic.
24 ; CHECK-NONPIC-LABEL: f1:
25 ; CHECK-NONPIC: external_gd(gottpoff)
26 ; CHECK-PIC-LABEL: f1:
27 ; CHECK-PIC: external_gd(tlsgd)
34 ; Non-PIC code can use local exec, PIC code can use local dynamic,
35 ; but that is not implemented, so falls back to general dynamic.
36 ; CHECK-NONPIC-LABEL: f2:
37 ; CHECK-NONPIC: internal_gd(tpoff)
38 ; CHECK-PIC-LABEL: f2:
39 ; CHECK-PIC: internal_gd(tlsgd)
43 ; ----- localdynamic specified -----
49 ; Non-PIC code can use initial exec, PIC should use local dynamic,
50 ; but that is not implemented, so falls back to general dynamic.
51 ; CHECK-NONPIC-LABEL: f3:
52 ; CHECK-NONPIC: external_ld(gottpoff)
53 ; CHECK-PIC-LABEL: f3:
54 ; CHECK-PIC: external_ld(tlsgd)
61 ; Non-PIC code can use local exec, PIC code can use local dynamic,
62 ; but that is not implemented, so it falls back to general dynamic.
63 ; CHECK-NONPIC-LABEL: f4:
64 ; CHECK-NONPIC: internal_ld(tpoff)
65 ; CHECK-PIC-LABEL: f4:
66 ; CHECK-PIC: internal_ld(tlsgd)
70 ; ----- initialexec specified -----
76 ; Non-PIC and PIC code will use initial exec as specified.
77 ; CHECK-NONPIC-LABEL: f5:
78 ; CHECK-NONPIC: external_ie(gottpoff)
79 ; CHECK-PIC-LABEL: f5:
80 ; CHECK-PIC: external_ie(gottpoff)
87 ; Non-PIC code can use local exec, PIC code use initial exec as specified.
88 ; CHECK-NONPIC-LABEL: f6:
89 ; CHECK-NONPIC: internal_ie(tpoff)
90 ; CHECK-PIC-LABEL: f6:
91 ; CHECK-PIC: internal_ie(gottpoff)
95 ; ----- localexec specified -----
101 ; Non-PIC and PIC code will use local exec as specified.
102 ; CHECK-NONPIC-LABEL: f7:
103 ; CHECK-NONPIC: external_le(tpoff)
104 ; CHECK-PIC-LABEL: f7:
105 ; CHECK-PIC: external_le(tpoff)
110 ret i32* @internal_le
112 ; Non-PIC and PIC code will use local exec as specified.
113 ; CHECK-NONPIC-LABEL: f8:
114 ; CHECK-NONPIC: internal_le(tpoff)
115 ; CHECK-PIC-LABEL: f8:
116 ; CHECK-PIC: internal_le(tpoff)