summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Thumb2/pic-load.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-07-23 23:09:51 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-07-23 23:09:51 +0000
commiteee839dd3c5cb87e51a522b4800674d7680fef70 (patch)
treedf0def04a12a07d0f75b7159b6e7cb4db64e1e38 /test/CodeGen/Thumb2/pic-load.ll
parent535c9c3c9dda57c8aa2d96403864c57a55cd1bf3 (diff)
downloadexternal_llvm-eee839dd3c5cb87e51a522b4800674d7680fef70.zip
external_llvm-eee839dd3c5cb87e51a522b4800674d7680fef70.tar.gz
external_llvm-eee839dd3c5cb87e51a522b4800674d7680fef70.tar.bz2
Thumb2 does not allow the use of "pc" register as part of the load / store address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76909 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2/pic-load.ll')
-rw-r--r--test/CodeGen/Thumb2/pic-load.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb2/pic-load.ll b/test/CodeGen/Thumb2/pic-load.ll
new file mode 100644
index 0000000..a31d087
--- /dev/null
+++ b/test/CodeGen/Thumb2/pic-load.ll
@@ -0,0 +1,21 @@
+; RUN: llvm-as < %s | llc -mtriple=thumbv7-apple-darwin9 -relocation-model=pic | FileCheck %s
+
+ %struct.anon = type { void ()* }
+ %struct.one_atexit_routine = type { %struct.anon, i32, i8* }
+@__dso_handle = external global { } ; <{ }*> [#uses=1]
+@llvm.used = appending global [1 x i8*] [i8* bitcast (i32 (void ()*)* @atexit to i8*)], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
+
+define hidden arm_apcscc i32 @atexit(void ()* %func) nounwind {
+entry:
+; CHECK: atexit:
+; CHECK: add r1, pc
+ %r = alloca %struct.one_atexit_routine, align 4 ; <%struct.one_atexit_routine*> [#uses=3]
+ %0 = getelementptr %struct.one_atexit_routine* %r, i32 0, i32 0, i32 0 ; <void ()**> [#uses=1]
+ store void ()* %func, void ()** %0, align 4
+ %1 = getelementptr %struct.one_atexit_routine* %r, i32 0, i32 1 ; <i32*> [#uses=1]
+ store i32 0, i32* %1, align 4
+ %2 = call arm_apcscc i32 @atexit_common(%struct.one_atexit_routine* %r, i8* bitcast ({ }* @__dso_handle to i8*)) nounwind ; <i32> [#uses=1]
+ ret i32 %2
+}
+
+declare arm_apcscc i32 @atexit_common(%struct.one_atexit_routine*, i8*) nounwind