aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/ARM/unaligned_load_store.ll
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-08-01 19:34:21 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-08-01 19:34:21 +0000
commitf3c13c82e34b8e90f1080cfe06c6f1328a2d44e1 (patch)
tree4af86fd56c3098b0a4d6ca2bce901a8abfcaa1b5 /test/CodeGen/ARM/unaligned_load_store.ll
parent4eda05855012deeed85ce6eb6b443d12e6159a27 (diff)
downloadexternal_llvm-f3c13c82e34b8e90f1080cfe06c6f1328a2d44e1.zip
external_llvm-f3c13c82e34b8e90f1080cfe06c6f1328a2d44e1.tar.gz
external_llvm-f3c13c82e34b8e90f1080cfe06c6f1328a2d44e1.tar.bz2
Expand unaligned loads/stores when the target doesn't support them. (PR1548)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40682 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/unaligned_load_store.ll')
-rw-r--r--test/CodeGen/ARM/unaligned_load_store.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/unaligned_load_store.ll b/test/CodeGen/ARM/unaligned_load_store.ll
new file mode 100644
index 0000000..211d748
--- /dev/null
+++ b/test/CodeGen/ARM/unaligned_load_store.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -march=arm -o %t -f
+; RUN: grep -c ldrb %t | grep 4
+; RUN: grep -c strb %t | grep 4
+
+
+ %struct.p = type <{ i8, i32 }>
+@t = global %struct.p <{ i8 1, i32 10 }> ; <%struct.p*> [#uses=1]
+@u = weak global %struct.p zeroinitializer ; <%struct.p*> [#uses=1]
+
+define i32 @main() {
+entry:
+ %tmp3 = load i32* getelementptr (%struct.p* @t, i32 0, i32 1), align 1 ; <i32> [#uses=2]
+ store i32 %tmp3, i32* getelementptr (%struct.p* @u, i32 0, i32 1), align 1
+ ret i32 %tmp3
+}