2017-08-02 06:20:49 +08:00
|
|
|
; RUN: llc < %s -mtriple=arm-linux-gnueabi \
|
2009-10-27 14:16:45 +08:00
|
|
|
; RUN: | FileCheck %s -check-prefix=CHECK-NONPIC
|
2017-08-02 06:20:49 +08:00
|
|
|
; RUN: llc < %s -mtriple=arm-linux-gnueabi -relocation-model=pic \
|
|
|
|
; RUN: | FileCheck %s -check-prefix=CHECK-PIC
|
2007-04-28 05:08:48 +08:00
|
|
|
|
|
|
|
@i = external thread_local global i32 ; <i32*> [#uses=2]
|
|
|
|
|
|
|
|
define i32 @f() {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-NONPIC-LABEL: f:
|
2010-03-18 01:52:21 +08:00
|
|
|
; CHECK-NONPIC: ldr {{r.}}, [pc, {{r.}}]
|
2013-12-05 06:43:20 +08:00
|
|
|
; CHECK-NONPIC: i(GOTTPOFF)
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-PIC-LABEL: f:
|
2009-10-27 14:16:45 +08:00
|
|
|
; CHECK-PIC: __tls_get_addr
|
2007-04-28 05:08:48 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load i32, i32* @i ; <i32> [#uses=1]
|
2007-04-28 05:08:48 +08:00
|
|
|
ret i32 %tmp1
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32* @g() {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-NONPIC-LABEL: g:
|
2010-03-18 01:52:21 +08:00
|
|
|
; CHECK-NONPIC: ldr {{r.}}, [pc, {{r.}}]
|
2013-12-05 06:43:20 +08:00
|
|
|
; CHECK-NONPIC: i(GOTTPOFF)
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-PIC-LABEL: g:
|
2009-10-27 14:16:45 +08:00
|
|
|
; CHECK-PIC: __tls_get_addr
|
2007-04-28 05:08:48 +08:00
|
|
|
entry:
|
|
|
|
ret i32* @i
|
|
|
|
}
|