2012-06-23 13:37:03 +02:00
|
|
|
; RUN: llc -march=arm -mtriple=arm-linux-gnueabi < %s | FileCheck -check-prefix=CHECK-NONPIC %s
|
|
|
|
; RUN: llc -march=arm -mtriple=arm-linux-gnueabi -relocation-model=pic < %s | FileCheck -check-prefix=CHECK-PIC %s
|
|
|
|
|
|
|
|
|
|
|
|
@external_gd = external thread_local global i32
|
|
|
|
@internal_gd = internal thread_local global i32 42
|
|
|
|
|
|
|
|
@external_ld = external thread_local(localdynamic) global i32
|
|
|
|
@internal_ld = internal thread_local(localdynamic) global i32 42
|
|
|
|
|
|
|
|
@external_ie = external thread_local(initialexec) global i32
|
|
|
|
@internal_ie = internal thread_local(initialexec) global i32 42
|
|
|
|
|
|
|
|
@external_le = external thread_local(localexec) global i32
|
|
|
|
@internal_le = internal thread_local(localexec) global i32 42
|
|
|
|
|
|
|
|
; ----- no model specified -----
|
|
|
|
|
|
|
|
define i32* @f1() {
|
|
|
|
entry:
|
|
|
|
ret i32* @external_gd
|
|
|
|
|
|
|
|
; Non-PIC code can use initial-exec, PIC code has to use general dynamic.
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-NONPIC-LABEL: f1:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-NONPIC: external_gd(gottpoff)
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-PIC-LABEL: f1:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-PIC: external_gd(tlsgd)
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32* @f2() {
|
|
|
|
entry:
|
|
|
|
ret i32* @internal_gd
|
|
|
|
|
|
|
|
; Non-PIC code can use local exec, PIC code can use local dynamic,
|
|
|
|
; but that is not implemented, so falls back to general dynamic.
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-NONPIC-LABEL: f2:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-NONPIC: internal_gd(tpoff)
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-PIC-LABEL: f2:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-PIC: internal_gd(tlsgd)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; ----- localdynamic specified -----
|
|
|
|
|
|
|
|
define i32* @f3() {
|
|
|
|
entry:
|
|
|
|
ret i32* @external_ld
|
|
|
|
|
|
|
|
; Non-PIC code can use initial exec, PIC should use local dynamic,
|
|
|
|
; but that is not implemented, so falls back to general dynamic.
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-NONPIC-LABEL: f3:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-NONPIC: external_ld(gottpoff)
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-PIC-LABEL: f3:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-PIC: external_ld(tlsgd)
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32* @f4() {
|
|
|
|
entry:
|
|
|
|
ret i32* @internal_ld
|
|
|
|
|
|
|
|
; Non-PIC code can use local exec, PIC code can use local dynamic,
|
|
|
|
; but that is not implemented, so it falls back to general dynamic.
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-NONPIC-LABEL: f4:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-NONPIC: internal_ld(tpoff)
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-PIC-LABEL: f4:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-PIC: internal_ld(tlsgd)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; ----- initialexec specified -----
|
|
|
|
|
|
|
|
define i32* @f5() {
|
|
|
|
entry:
|
|
|
|
ret i32* @external_ie
|
|
|
|
|
|
|
|
; Non-PIC and PIC code will use initial exec as specified.
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-NONPIC-LABEL: f5:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-NONPIC: external_ie(gottpoff)
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-PIC-LABEL: f5:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-PIC: external_ie(gottpoff)
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32* @f6() {
|
|
|
|
entry:
|
|
|
|
ret i32* @internal_ie
|
|
|
|
|
|
|
|
; Non-PIC code can use local exec, PIC code use initial exec as specified.
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-NONPIC-LABEL: f6:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-NONPIC: internal_ie(tpoff)
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-PIC-LABEL: f6:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-PIC: internal_ie(gottpoff)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; ----- localexec specified -----
|
|
|
|
|
|
|
|
define i32* @f7() {
|
|
|
|
entry:
|
|
|
|
ret i32* @external_le
|
|
|
|
|
|
|
|
; Non-PIC and PIC code will use local exec as specified.
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-NONPIC-LABEL: f7:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-NONPIC: external_le(tpoff)
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-PIC-LABEL: f7:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-PIC: external_le(tpoff)
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32* @f8() {
|
|
|
|
entry:
|
|
|
|
ret i32* @internal_le
|
|
|
|
|
|
|
|
; Non-PIC and PIC code will use local exec as specified.
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-NONPIC-LABEL: f8:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-NONPIC: internal_le(tpoff)
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-PIC-LABEL: f8:
|
2012-06-23 13:37:03 +02:00
|
|
|
; CHECK-PIC: internal_le(tpoff)
|
|
|
|
}
|