blob: a5f3c9005af0a148b14fba54b3737968504a6492 [file] [log] [blame]
Hans Wennborgce718ff2012-06-23 11:37:03 +00001; 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
3
4
5@external_gd = external thread_local global i32
6@internal_gd = internal thread_local global i32 42
7
8@external_ld = external thread_local(localdynamic) global i32
9@internal_ld = internal thread_local(localdynamic) global i32 42
10
11@external_ie = external thread_local(initialexec) global i32
12@internal_ie = internal thread_local(initialexec) global i32 42
13
14@external_le = external thread_local(localexec) global i32
15@internal_le = internal thread_local(localexec) global i32 42
16
17; ----- no model specified -----
18
19define i32* @f1() {
20entry:
21 ret i32* @external_gd
22
23 ; Non-PIC code can use initial-exec, PIC code has to use general dynamic.
24 ; CHECK-NONPIC: f1:
25 ; CHECK-NONPIC: external_gd(gottpoff)
26 ; CHECK-PIC: f1:
27 ; CHECK-PIC: external_gd(tlsgd)
28}
29
30define i32* @f2() {
31entry:
32 ret i32* @internal_gd
33
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: f2:
37 ; CHECK-NONPIC: internal_gd(tpoff)
38 ; CHECK-PIC: f2:
39 ; CHECK-PIC: internal_gd(tlsgd)
40}
41
42
43; ----- localdynamic specified -----
44
45define i32* @f3() {
46entry:
47 ret i32* @external_ld
48
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: f3:
52 ; CHECK-NONPIC: external_ld(gottpoff)
53 ; CHECK-PIC: f3:
54 ; CHECK-PIC: external_ld(tlsgd)
55}
56
57define i32* @f4() {
58entry:
59 ret i32* @internal_ld
60
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: f4:
64 ; CHECK-NONPIC: internal_ld(tpoff)
65 ; CHECK-PIC: f4:
66 ; CHECK-PIC: internal_ld(tlsgd)
67}
68
69
70; ----- initialexec specified -----
71
72define i32* @f5() {
73entry:
74 ret i32* @external_ie
75
76 ; Non-PIC and PIC code will use initial exec as specified.
77 ; CHECK-NONPIC: f5:
78 ; CHECK-NONPIC: external_ie(gottpoff)
79 ; CHECK-PIC: f5:
80 ; CHECK-PIC: external_ie(gottpoff)
81}
82
83define i32* @f6() {
84entry:
85 ret i32* @internal_ie
86
87 ; Non-PIC code can use local exec, PIC code use initial exec as specified.
88 ; CHECK-NONPIC: f6:
89 ; CHECK-NONPIC: internal_ie(tpoff)
90 ; CHECK-PIC: f6:
91 ; CHECK-PIC: internal_ie(gottpoff)
92}
93
94
95; ----- localexec specified -----
96
97define i32* @f7() {
98entry:
99 ret i32* @external_le
100
101 ; Non-PIC and PIC code will use local exec as specified.
102 ; CHECK-NONPIC: f7:
103 ; CHECK-NONPIC: external_le(tpoff)
104 ; CHECK-PIC: f7:
105 ; CHECK-PIC: external_le(tpoff)
106}
107
108define i32* @f8() {
109entry:
110 ret i32* @internal_le
111
112 ; Non-PIC and PIC code will use local exec as specified.
113 ; CHECK-NONPIC: f8:
114 ; CHECK-NONPIC: internal_le(tpoff)
115 ; CHECK-PIC: f8:
116 ; CHECK-PIC: internal_le(tpoff)
117}