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.w r14, 0(r15)
14 @foo = external global i16
16 define void @am2(i16 %x) nounwind {
19 store i16 %2, i16* @foo
23 ; CHECK: bis.w r15, &foo
25 @bar = external global [2 x i8]
27 define void @am3(i16 %i, i8 %x) nounwind {
28 %1 = getelementptr [2 x i8]* @bar, i16 0, i16 %i
35 ; CHECK: bis.b r14, bar(r15)
37 define void @am4(i16 %x) nounwind {
38 %1 = volatile load i16* inttoptr(i16 32 to i16*)
40 volatile store i16 %2, i16* inttoptr(i16 32 to i16*)
44 ; CHECK: bis.w r15, &32
46 define void @am5(i16* %a, i16 %x) readonly {
47 %1 = getelementptr inbounds i16* %a, i16 2
54 ; CHECK: bis.w r14, 4(r15)
56 %S = type { i16, i16 }
57 @baz = common global %S zeroinitializer
59 define void @am6(i16 %x) nounwind {
60 %1 = load i16* getelementptr (%S* @baz, i32 0, i32 1)
62 store i16 %2, i16* getelementptr (%S* @baz, i32 0, i32 1)
66 ; CHECK: bis.w r15, &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* @duh, i32 0, i32 1
73 %2 = getelementptr [2 x i8]* %1, i16 0, i16 %n
80 ; CHECK: bis.b r14, duh+2(r15)