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 i16 @am1(ptr %a) nounwind {
10 ; CHECK: mov 0(r12), r12
12 @foo = external global i16
14 define i16 @am2() nounwind {
15 %1 = load i16, ptr @foo
19 ; CHECK: mov &foo, r12
21 @bar = internal constant [2 x i8] [ i8 32, i8 64 ]
23 define i8 @am3(i16 %n) nounwind {
24 %1 = getelementptr [2 x i8], ptr @bar, i16 0, i16 %n
29 ; CHECK: mov.b bar(r12), r12
31 define i16 @am4() nounwind {
32 %1 = load volatile i16, ptr inttoptr(i16 32 to ptr)
38 define i16 @am5(ptr %a) nounwind {
39 %1 = getelementptr i16, ptr %a, i16 2
44 ; CHECK: mov 4(r12), r12
46 %S = type { i16, i16 }
47 @baz = common global %S zeroinitializer, align 1
49 define i16 @am6() nounwind {
50 %1 = load i16, ptr getelementptr (%S, ptr @baz, i32 0, i32 1)
54 ; CHECK: mov &baz+2, r12
56 %T = type { i16, [2 x i8] }
57 @duh = internal constant %T { i16 16, [2 x i8][i8 32, i8 64 ] }
59 define i8 @am7(i16 %n) nounwind {
60 %1 = getelementptr %T, ptr @duh, i32 0, i32 1
61 %2 = getelementptr [2 x i8], ptr %1, i16 0, i16 %n
66 ; CHECK: mov.b duh+2(r12), r12