1 ; RUN: llc < %s -march=msp430 | FileCheck %s
2 target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:16"
3 target triple = "msp430-generic-generic"
5 define void @am1(i16* %a, i16 %x) nounwind {
12 ; CHECK: bis r13, 0(r12)
14 @foo = external global i16
16 define void @am2(i16 %x) nounwind {
17 %1 = load i16, i16* @foo
19 store i16 %2, i16* @foo
23 ; CHECK: bis r12, &foo
25 @bar = external global [2 x i8]
27 define void @am3(i16 %i, i8 %x) nounwind {
28 %1 = getelementptr [2 x i8], [2 x i8]* @bar, i16 0, i16 %i
35 ; CHECK: bis.b r13, bar(r12)
37 define void @am4(i16 %x) nounwind {
38 %1 = load volatile i16, i16* inttoptr(i16 32 to i16*)
40 store volatile i16 %2, i16* inttoptr(i16 32 to i16*)
46 define void @am5(i16* %a, i16 %x) readonly {
47 %1 = getelementptr inbounds i16, i16* %a, i16 2
48 %2 = load i16, i16* %1
54 ; CHECK: bis r13, 4(r12)
56 %S = type { i16, i16 }
57 @baz = common global %S zeroinitializer
59 define void @am6(i16 %x) nounwind {
60 %1 = load i16, i16* getelementptr (%S, %S* @baz, i32 0, i32 1)
62 store i16 %2, i16* getelementptr (%S, %S* @baz, i32 0, i32 1)
66 ; CHECK: bis r12, &baz+2
68 %T = type { i16, [2 x i8] }
69 @duh = external global %T
71 define void @am7(i16 %n, i8 %x) nounwind {
72 %1 = getelementptr %T, %T* @duh, i32 0, i32 1
73 %2 = getelementptr [2 x i8], [2 x i8]* %1, i16 0, i16 %n
80 ; CHECK: bis.b r13, duh+2(r12)