blob: 24b4794b061a2622677582a2d8d8931aa974b570 [file] [log] [blame]
Dan Gohmanc8054d92009-09-09 00:09:15 +00001; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi \
Bob Wilsond169e6c2009-10-27 06:16:45 +00002; RUN: | FileCheck %s -check-prefix=CHECK-NONPIC
3; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi \
4; RUN: -relocation-model=pic | FileCheck %s -check-prefix=CHECK-PIC
Lauro Ramos Venancio04750a12007-04-27 21:08:48 +00005
6@i = external thread_local global i32 ; <i32*> [#uses=2]
7
8define i32 @f() {
Stephen Lind24ab202013-07-14 06:24:09 +00009; CHECK-NONPIC-LABEL: f:
Johnny Chen8f3004c2010-03-17 17:52:21 +000010; CHECK-NONPIC: ldr {{r.}}, [pc, {{r.}}]
David Peixotto8ad70b32013-12-04 22:43:20 +000011; CHECK-NONPIC: i(GOTTPOFF)
Stephen Lind24ab202013-07-14 06:24:09 +000012; CHECK-PIC-LABEL: f:
Bob Wilsond169e6c2009-10-27 06:16:45 +000013; CHECK-PIC: __tls_get_addr
Lauro Ramos Venancio04750a12007-04-27 21:08:48 +000014entry:
15 %tmp1 = load i32* @i ; <i32> [#uses=1]
16 ret i32 %tmp1
17}
18
19define i32* @g() {
Stephen Lind24ab202013-07-14 06:24:09 +000020; CHECK-NONPIC-LABEL: g:
Johnny Chen8f3004c2010-03-17 17:52:21 +000021; CHECK-NONPIC: ldr {{r.}}, [pc, {{r.}}]
David Peixotto8ad70b32013-12-04 22:43:20 +000022; CHECK-NONPIC: i(GOTTPOFF)
Stephen Lind24ab202013-07-14 06:24:09 +000023; CHECK-PIC-LABEL: g:
Bob Wilsond169e6c2009-10-27 06:16:45 +000024; CHECK-PIC: __tls_get_addr
Lauro Ramos Venancio04750a12007-04-27 21:08:48 +000025entry:
26 ret i32* @i
27}