summaryrefslogtreecommitdiff
path: root/test/CodeGen/SPARC
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-04-13 19:02:23 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-04-13 19:02:23 +0000
commit41d59c61307002823c246c14589048266a6bf423 (patch)
tree5063dec8d1841b3a5f507d24e0976e8394c54a8b /test/CodeGen/SPARC
parent41b585ca0e706a6d43ca185e88a609178e8629e7 (diff)
downloadllvm-41d59c61307002823c246c14589048266a6bf423.tar.gz
llvm-41d59c61307002823c246c14589048266a6bf423.tar.bz2
llvm-41d59c61307002823c246c14589048266a6bf423.tar.xz
Define SPARC code models.
Currently, only abs32 and pic32 are implemented. Add a test case for abs32 with 64-bit code. 64-bit PIC code is currently broken. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179463 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SPARC')
-rw-r--r--test/CodeGen/SPARC/globals.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGen/SPARC/globals.ll b/test/CodeGen/SPARC/globals.ll
new file mode 100644
index 0000000000..869e9218e2
--- /dev/null
+++ b/test/CodeGen/SPARC/globals.ll
@@ -0,0 +1,23 @@
+; RUN: llc < %s -march=sparc -relocation-model=static -code-model=small | FileCheck --check-prefix=abs32 %s
+; RUN: llc < %s -march=sparcv9 -relocation-model=static -code-model=small | FileCheck --check-prefix=abs32 %s
+; RUN: llc < %s -march=sparc -relocation-model=pic -code-model=medium | FileCheck --check-prefix=v8pic32 %s
+
+@G = external global i8
+
+define zeroext i8 @loadG() {
+ %tmp = load i8* @G
+ ret i8 %tmp
+}
+
+; abs32: loadG
+; abs32: sethi %hi(G), %[[R:[gilo][0-7]]]
+; abs32: ldub [%[[R]]+%lo(G)], %i0
+; abs32: jmp %i7+8
+
+; v8pic32: loadG
+; v8pic32: _GLOBAL_OFFSET_TABLE_
+; v8pic32: sethi %hi(G), %[[R1:[gilo][0-7]]]
+; v8pic32: add %[[R1]], %lo(G), %[[Goffs:[gilo][0-7]]]
+; v8pic32: ld [%[[GOT:[gilo][0-7]]]+%[[Goffs]]], %[[Gaddr:[gilo][0-7]]]
+; v8pic32: ldub [%[[Gaddr]]], %i0
+; v8pic32: jmp %i7+8