Two sets of changes. Sorry they are intermingled.
[oota-llvm.git] / test / CodeGen / ARM / unaligned_load_store.ll
index 211d748be34d729c7cd85f2a34cbac771b4ab2b8..354895e099dceb4f1f11fadf30735b214c2e40df 100644 (file)
@@ -1,16 +1,29 @@
-; 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
+; RUN: llc < %s -march=arm | FileCheck %s -check-prefix=GENERIC
+; RUN: llc < %s -mtriple=armv6-apple-darwin | FileCheck %s -check-prefix=DARWIN_V6
+; RUN: llc < %s -mtriple=armv6-apple-darwin -arm-strict-align | FileCheck %s -check-prefix=GENERIC
+; RUN: llc < %s -mtriple=armv6-linux | FileCheck %s -check-prefix=GENERIC
 
+; rdar://7113725
 
-       %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() {
+define void @t(i8* nocapture %a, i8* nocapture %b) nounwind {
 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
+; GENERIC: t:
+; GENERIC: ldrb r2
+; GENERIC: ldrb r3
+; GENERIC: ldrb r12
+; GENERIC: ldrb r1
+; GENERIC: strb r1
+; GENERIC: strb r12
+; GENERIC: strb r3
+; GENERIC: strb r2
+
+; DARWIN_V6: t:
+; DARWIN_V6: ldr r1
+; DARWIN_V6: str r1
+
+  %__src1.i = bitcast i8* %b to i32*              ; <i32*> [#uses=1]
+  %__dest2.i = bitcast i8* %a to i32*             ; <i32*> [#uses=1]
+  %tmp.i = load i32* %__src1.i, align 1           ; <i32> [#uses=1]
+  store i32 %tmp.i, i32* %__dest2.i, align 1
+  ret void
 }