blob: d932f90e4c10fe4b10fd152e15c3af5b25e2ffa6 [file] [log] [blame]
Dan Gohmanda594cf2009-09-09 00:09:15 +00001; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi \
Bob Wilsone811eeb2009-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
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005
6@i = external thread_local global i32 ; <i32*> [#uses=2]
7
8define i32 @f() {
Bob Wilsone811eeb2009-10-27 06:16:45 +00009; CHECK-NONPIC: f:
10; CHECK-NONPIC: ldr {{r.}}, [pc, +{{r.}}]
11; CHECK-NONPIC: i(gottpoff)
12; CHECK-PIC: f:
13; CHECK-PIC: __tls_get_addr
Dan Gohmanf17a25c2007-07-18 16:29:46 +000014entry:
15 %tmp1 = load i32* @i ; <i32> [#uses=1]
16 ret i32 %tmp1
17}
18
19define i32* @g() {
Bob Wilsone811eeb2009-10-27 06:16:45 +000020; CHECK-NONPIC: g:
21; CHECK-NONPIC: ldr {{r.}}, [pc, +{{r.}}]
22; CHECK-NONPIC: i(gottpoff)
23; CHECK-PIC: g:
24; CHECK-PIC: __tls_get_addr
Dan Gohmanf17a25c2007-07-18 16:29:46 +000025entry:
26 ret i32* @i
27}