2012-06-23 11:37:03 +00:00
|
|
|
; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64 %s
|
|
|
|
; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu -relocation-model=pic | FileCheck -check-prefix=X64_PIC %s
|
|
|
|
; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32 %s
|
|
|
|
; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic | FileCheck -check-prefix=X32_PIC %s
|
|
|
|
|
|
|
|
; Darwin always uses the same model.
|
|
|
|
; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin | FileCheck -check-prefix=DARWIN %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 06:24:09 +00:00
|
|
|
; X64-LABEL: f1:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64: external_gd@GOTTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32-LABEL: f1:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32: external_gd@INDNTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64_PIC-LABEL: f1:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64_PIC: external_gd@TLSGD
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32_PIC-LABEL: f1:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32_PIC: external_gd@TLSGD
|
2013-07-14 06:24:09 +00:00
|
|
|
; DARWIN-LABEL: f1:
|
2012-06-23 11:37:03 +00:00
|
|
|
; DARWIN: _external_gd@TLVP
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32* @f2() {
|
|
|
|
entry:
|
|
|
|
ret i32* @internal_gd
|
|
|
|
|
|
|
|
; Non-PIC code can use local exec, PIC code can use local dynamic.
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64-LABEL: f2:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64: internal_gd@TPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32-LABEL: f2:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32: internal_gd@NTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64_PIC-LABEL: f2:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64_PIC: internal_gd@TLSLD
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32_PIC-LABEL: f2:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32_PIC: internal_gd@TLSLDM
|
2013-07-14 06:24:09 +00:00
|
|
|
; DARWIN-LABEL: f2:
|
2012-06-23 11:37:03 +00:00
|
|
|
; DARWIN: _internal_gd@TLVP
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; ----- localdynamic specified -----
|
|
|
|
|
|
|
|
define i32* @f3() {
|
|
|
|
entry:
|
|
|
|
ret i32* @external_ld
|
|
|
|
|
|
|
|
; Non-PIC code can use initial exec, PIC code use local dynamic as specified.
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64-LABEL: f3:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64: external_ld@GOTTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32-LABEL: f3:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32: external_ld@INDNTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64_PIC-LABEL: f3:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64_PIC: external_ld@TLSLD
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32_PIC-LABEL: f3:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32_PIC: external_ld@TLSLDM
|
2013-07-14 06:24:09 +00:00
|
|
|
; DARWIN-LABEL: f3:
|
2012-06-23 11:37:03 +00:00
|
|
|
; DARWIN: _external_ld@TLVP
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32* @f4() {
|
|
|
|
entry:
|
|
|
|
ret i32* @internal_ld
|
|
|
|
|
|
|
|
; Non-PIC code can use local exec, PIC code can use local dynamic.
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64-LABEL: f4:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64: internal_ld@TPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32-LABEL: f4:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32: internal_ld@NTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64_PIC-LABEL: f4:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64_PIC: internal_ld@TLSLD
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32_PIC-LABEL: f4:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32_PIC: internal_ld@TLSLDM
|
2013-07-14 06:24:09 +00:00
|
|
|
; DARWIN-LABEL: f4:
|
2012-06-23 11:37:03 +00:00
|
|
|
; DARWIN: _internal_ld@TLVP
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; ----- initialexec specified -----
|
|
|
|
|
|
|
|
define i32* @f5() {
|
|
|
|
entry:
|
|
|
|
ret i32* @external_ie
|
|
|
|
|
|
|
|
; Non-PIC and PIC code will use initial exec as specified.
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64-LABEL: f5:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64: external_ie@GOTTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32-LABEL: f5:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32: external_ie@INDNTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64_PIC-LABEL: f5:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64_PIC: external_ie@GOTTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32_PIC-LABEL: f5:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32_PIC: external_ie@GOTNTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; DARWIN-LABEL: f5:
|
2012-06-23 11:37:03 +00:00
|
|
|
; DARWIN: _external_ie@TLVP
|
|
|
|
}
|
|
|
|
|
|
|
|
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 06:24:09 +00:00
|
|
|
; X64-LABEL: f6:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64: internal_ie@TPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32-LABEL: f6:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32: internal_ie@NTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64_PIC-LABEL: f6:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64_PIC: internal_ie@GOTTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32_PIC-LABEL: f6:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32_PIC: internal_ie@GOTNTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; DARWIN-LABEL: f6:
|
2012-06-23 11:37:03 +00:00
|
|
|
; DARWIN: _internal_ie@TLVP
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; ----- localexec specified -----
|
|
|
|
|
|
|
|
define i32* @f7() {
|
|
|
|
entry:
|
|
|
|
ret i32* @external_le
|
|
|
|
|
|
|
|
; Non-PIC and PIC code will use local exec as specified.
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64-LABEL: f7:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64: external_le@TPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32-LABEL: f7:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32: external_le@NTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64_PIC-LABEL: f7:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64_PIC: external_le@TPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32_PIC-LABEL: f7:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32_PIC: external_le@NTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; DARWIN-LABEL: f7:
|
2012-06-23 11:37:03 +00:00
|
|
|
; DARWIN: _external_le@TLVP
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32* @f8() {
|
|
|
|
entry:
|
|
|
|
ret i32* @internal_le
|
|
|
|
|
|
|
|
; Non-PIC and PIC code will use local exec as specified.
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64-LABEL: f8:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64: internal_le@TPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32-LABEL: f8:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32: internal_le@NTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X64_PIC-LABEL: f8:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X64_PIC: internal_le@TPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; X32_PIC-LABEL: f8:
|
2012-06-23 11:37:03 +00:00
|
|
|
; X32_PIC: internal_le@NTPOFF
|
2013-07-14 06:24:09 +00:00
|
|
|
; DARWIN-LABEL: f8:
|
2012-06-23 11:37:03 +00:00
|
|
|
; DARWIN: _internal_le@TLVP
|
|
|
|
}
|