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" 4 5 define void @am1(i16* %a, i16 %b) nounwind { 6 store i16 %b, i16* %a 7 ret void 8 } 9 ; CHECK: am1: 10 ; CHECK: mov.w r14, 0(r15) 11 12 @foo = external global i16 13 14 define void @am2(i16 %a) nounwind { 15 store i16 %a, i16* @foo 16 ret void 17 } 18 ; CHECK: am2: 19 ; CHECK: mov.w r15, &foo 20 21 @bar = external global [2 x i8] 22 23 define void @am3(i16 %i, i8 %a) nounwind { 24 %1 = getelementptr [2 x i8]* @bar, i16 0, i16 %i 25 store i8 %a, i8* %1 26 ret void 27 } 28 ; CHECK: am3: 29 ; CHECK: mov.b r14, bar(r15) 30 31 define void @am4(i16 %a) nounwind { 32 volatile store i16 %a, i16* inttoptr(i16 32 to i16*) 33 ret void 34 } 35 ; CHECK: am4: 36 ; CHECK: mov.w r15, &32 37 38 define void @am5(i16* nocapture %p, i16 %a) nounwind readonly { 39 %1 = getelementptr inbounds i16* %p, i16 2 40 store i16 %a, i16* %1 41 ret void 42 } 43 ; CHECK: am5: 44 ; CHECK: mov.w r14, 4(r15) 45 46 %S = type { i16, i16 } 47 @baz = common global %S zeroinitializer, align 1 48 49 define void @am6(i16 %a) nounwind { 50 store i16 %a, i16* getelementptr (%S* @baz, i32 0, i32 1) 51 ret void 52 } 53 ; CHECK: am6: 54 ; CHECK: mov.w r15, &baz+2 55 56 %T = type { i16, [2 x i8] } 57 @duh = external global %T 58 59 define void @am7(i16 %n, i8 %a) nounwind { 60 %1 = getelementptr %T* @duh, i32 0, i32 1 61 %2 = getelementptr [2 x i8]* %1, i16 0, i16 %n 62 store i8 %a, i8* %2 63 ret void 64 } 65 ; CHECK: am7: 66 ; CHECK: mov.b r14, duh+2(r15) 67 68