1 ; RUN: llc < %s -march=msp430 | FileCheck %s
2 target datalayout = "e-p:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:16:16"
3 target triple = "msp430-generic-generic"
5 define void @am1(i16* %a, i16 %b) nounwind {
10 ; CHECK: mov r13, 0(r12)
12 @foo = external global i16
14 define void @am2(i16 %a) nounwind {
15 store i16 %a, i16* @foo
19 ; CHECK: mov r12, &foo
21 @bar = external global [2 x i8]
23 define void @am3(i16 %i, i8 %a) nounwind {
24 %1 = getelementptr [2 x i8], [2 x i8]* @bar, i16 0, i16 %i
29 ; CHECK: mov.b r13, bar(r12)
31 define void @am4(i16 %a) nounwind {
32 store volatile i16 %a, i16* inttoptr(i16 32 to i16*)
38 define void @am5(i16* nocapture %p, i16 %a) nounwind readonly {
39 %1 = getelementptr inbounds i16, i16* %p, i16 2
44 ; CHECK: mov r13, 4(r12)
46 %S = type { i16, i16 }
47 @baz = common global %S zeroinitializer, align 1
49 define void @am6(i16 %a) nounwind {
50 store i16 %a, i16* getelementptr (%S, %S* @baz, i32 0, i32 1)
54 ; CHECK: mov r12, &baz+2
56 %T = type { i16, [2 x i8] }
57 @duh = external global %T
59 define void @am7(i16 %n, i8 %a) nounwind {
60 %1 = getelementptr %T, %T* @duh, i32 0, i32 1
61 %2 = getelementptr [2 x i8], [2 x i8]* %1, i16 0, i16 %n
66 ; CHECK: mov.b r13, duh+2(r12)