aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorDavid Goodwin <david_goodwin@apple.com>2009-07-01 00:01:13 +0000
committerDavid Goodwin <david_goodwin@apple.com>2009-07-01 00:01:13 +0000
commitd1fa120aeec67e94e6ed6056593ccb630fe2db0e (patch)
tree43dab5d1dfd23fa4c5088c600effaa9e89d6051e /test/CodeGen
parentdb47ed0925ce97f3134189c96ebc35b2cdae1ce3 (diff)
downloadexternal_llvm-d1fa120aeec67e94e6ed6056593ccb630fe2db0e.tar.gz
external_llvm-d1fa120aeec67e94e6ed6056593ccb630fe2db0e.tar.bz2
external_llvm-d1fa120aeec67e94e6ed6056593ccb630fe2db0e.zip
Add PIC load and store patterns for Thumb-2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/Thumb2/load-global.ll14
-rw-r--r--test/CodeGen/Thumb2/tls1.ll20
-rw-r--r--test/CodeGen/Thumb2/tls2.ll19
3 files changed, 51 insertions, 2 deletions
diff --git a/test/CodeGen/Thumb2/load-global.ll b/test/CodeGen/Thumb2/load-global.ll
index 0ffcb9575d..1b1fe7b1b5 100644
--- a/test/CodeGen/Thumb2/load-global.ll
+++ b/test/CodeGen/Thumb2/load-global.ll
@@ -1,5 +1,15 @@
-; RUN: llvm-as < %s | llc -mtriple=thumbv7-apple-darwin
-; RUN: llvm-as < %s | llc -mtriple=thumbv7-apple-darwin -relocation-model=pic | grep add | grep pc
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=thumbv7-apple-darwin -relocation-model=static | \
+; RUN: not grep {L_G\$non_lazy_ptr}
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=thumbv7-apple-darwin -relocation-model=dynamic-no-pic | \
+; RUN: grep {L_G\$non_lazy_ptr} | count 2
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=thumbv7-apple-darwin -relocation-model=pic | \
+; RUN: grep {ldr.*pc} | count 1
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=thumbv7-linux-gnueabi -relocation-model=pic | \
+; RUN: grep {GOT} | count 1
@G = external global i32
diff --git a/test/CodeGen/Thumb2/tls1.ll b/test/CodeGen/Thumb2/tls1.ll
new file mode 100644
index 0000000000..6abb6eba63
--- /dev/null
+++ b/test/CodeGen/Thumb2/tls1.ll
@@ -0,0 +1,20 @@
+; RUN: llvm-as < %s | llc -mtriple=thumbv7-linux-gnueabi | \
+; RUN: grep {i(tpoff)}
+; RUN: llvm-as < %s | llc -mtriple=thumbv7-linux-gnueabi | \
+; RUN: grep {__aeabi_read_tp}
+; RUN: llvm-as < %s | llc -mtriple=thumbv7-linux-gnueabi \
+; RUN: -relocation-model=pic | grep {__tls_get_addr}
+
+
+@i = thread_local global i32 15 ; <i32*> [#uses=2]
+
+define i32 @f() {
+entry:
+ %tmp1 = load i32* @i ; <i32> [#uses=1]
+ ret i32 %tmp1
+}
+
+define i32* @g() {
+entry:
+ ret i32* @i
+}
diff --git a/test/CodeGen/Thumb2/tls2.ll b/test/CodeGen/Thumb2/tls2.ll
new file mode 100644
index 0000000000..3396b0ba43
--- /dev/null
+++ b/test/CodeGen/Thumb2/tls2.ll
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s | llc -mtriple=thumbv7-linux-gnueabi | \
+; RUN: grep {i(gottpoff)}
+; RUN: llvm-as < %s | llc -mtriple=thumbv7-linux-gnueabi | \
+; RUN: grep {ldr r., \[pc, r.\]}
+; RUN: llvm-as < %s | llc -mtriple=thumbv7-linux-gnueabi \
+; RUN: -relocation-model=pic | grep {__tls_get_addr}
+
+@i = external thread_local global i32 ; <i32*> [#uses=2]
+
+define i32 @f() {
+entry:
+ %tmp1 = load i32* @i ; <i32> [#uses=1]
+ ret i32 %tmp1
+}
+
+define i32* @g() {
+entry:
+ ret i32* @i
+}