diff --git a/test/CodeGen/MSP430/Inst16mi.ll b/test/CodeGen/MSP430/Inst16mi.ll new file mode 100644 index 00000000000..ef16eac2c02 --- /dev/null +++ b/test/CodeGen/MSP430/Inst16mi.ll @@ -0,0 +1,48 @@ +; RUN: llvm-as < %s | llc -march=msp430 | FileCheck %s + +target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8" +target triple = "msp430-generic-generic" +@foo = common global i16 0, align 2 + +define void @mov() nounwind { +; CHECK: mov: +; CHECK: mov.w #2, &foo + store i16 2, i16 * @foo + ret void +} + +define void @add() nounwind { +; CHECK: add: +; CHECK: add.w #2, &foo + %1 = load i16* @foo + %2 = add i16 %1, 2 + store i16 %2, i16 * @foo + ret void +} + +define void @and() nounwind { +; CHECK: and: +; CHECK: and.w #2, &foo + %1 = load i16* @foo + %2 = and i16 %1, 2 + store i16 %2, i16 * @foo + ret void +} + +define void @bis() nounwind { +; CHECK: bis: +; CHECK: bis.w #2, &foo + %1 = load i16* @foo + %2 = or i16 %1, 2 + store i16 %2, i16 * @foo + ret void +} + +define void @xor() nounwind { +; CHECK: xor: +; CHECK: xor.w #2, &foo + %1 = load i16* @foo + %2 = xor i16 %1, 2 + store i16 %2, i16 * @foo + ret void +} diff --git a/test/CodeGen/MSP430/Inst16mr.ll b/test/CodeGen/MSP430/Inst16mr.ll new file mode 100644 index 00000000000..cb2184f8d9e --- /dev/null +++ b/test/CodeGen/MSP430/Inst16mr.ll @@ -0,0 +1,48 @@ +; RUN: llvm-as < %s | llc -march=msp430 | FileCheck %s +target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8" +target triple = "msp430-generic-generic" +@foo = common global i16 0, align 2 + +define void @mov(i16 %a) nounwind { +; CHECK: mov: +; CHECK: mov.w r15, &foo + store i16 %a, i16* @foo + ret void +} + +define void @add(i16 %a) nounwind { +; CHECK: add: +; CHECK: add.w r15, &foo + %1 = load i16* @foo + %2 = add i16 %a, %1 + store i16 %2, i16* @foo + ret void +} + +define void @and(i16 %a) nounwind { +; CHECK: and: +; CHECK: and.w r15, &foo + %1 = load i16* @foo + %2 = and i16 %a, %1 + store i16 %2, i16* @foo + ret void +} + +define void @bis(i16 %a) nounwind { +; CHECK: bis: +; CHECK: bis.w r15, &foo + %1 = load i16* @foo + %2 = or i16 %a, %1 + store i16 %2, i16* @foo + ret void +} + +define void @xor(i16 %a) nounwind { +; CHECK: xor: +; CHECK: xor.w r15, &foo + %1 = load i16* @foo + %2 = xor i16 %a, %1 + store i16 %2, i16* @foo + ret void +} + diff --git a/test/CodeGen/MSP430/Inst16rm.ll b/test/CodeGen/MSP430/Inst16rm.ll new file mode 100644 index 00000000000..57c60b68376 --- /dev/null +++ b/test/CodeGen/MSP430/Inst16rm.ll @@ -0,0 +1,38 @@ +; RUN: llvm-as < %s | llc -march=msp430 | FileCheck %s +target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8" +target triple = "msp430-generic-generic" +@foo = common global i16 0, align 2 + +define i16 @add(i16 %a) nounwind { +; CHECK: add: +; CHECK: add.w &foo, r15 + %1 = load i16* @foo + %2 = add i16 %a, %1 + ret i16 %2 +} + +define i16 @and(i16 %a) nounwind { +; CHECK: and: +; CHECK: and.w &foo, r15 + %1 = load i16* @foo + %2 = and i16 %a, %1 + ret i16 %2 +} + + +define i16 @bis(i16 %a) nounwind { +; CHECK: bis: +; CHECK: bis.w &foo, r15 + %1 = load i16* @foo + %2 = or i16 %a, %1 + ret i16 %2 +} + +define i16 @xor(i16 %a) nounwind { +; CHECK: xor: +; CHECK: xor.w &foo, r15 + %1 = load i16* @foo + %2 = xor i16 %a, %1 + ret i16 %2 +} + diff --git a/test/CodeGen/MSP430/Inst16rr.ll b/test/CodeGen/MSP430/Inst16rr.ll new file mode 100644 index 00000000000..e26615e21b1 --- /dev/null +++ b/test/CodeGen/MSP430/Inst16rr.ll @@ -0,0 +1,37 @@ +; RUN: llvm-as < %s | llc -march=msp430 | FileCheck %s +target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8" +target triple = "msp430-generic-generic" + +define i16 @mov(i16 %a, i16 %b) nounwind { +; CHECK: mov: +; CHECK: mov.w r14, r15 + ret i16 %b +} + +define i16 @add(i16 %a, i16 %b) nounwind { +; CHECK: add: +; CHECK: add.w r14, r15 + %1 = add i16 %a, %b + ret i16 %1 +} + +define i16 @and(i16 %a, i16 %b) nounwind { +; CHECK: and: +; CHECK: and.w r14, r15 + %1 = and i16 %a, %b + ret i16 %1 +} + +define i16 @bis(i16 %a, i16 %b) nounwind { +; CHECK: bis: +; CHECK: bis.w r14, r15 + %1 = or i16 %a, %b + ret i16 %1 +} + +define i16 @xor(i16 %a, i16 %b) nounwind { +; CHECK: xor: +; CHECK: xor.w r14, r15 + %1 = xor i16 %a, %b + ret i16 %1 +} diff --git a/test/CodeGen/MSP430/Inst8mi.ll b/test/CodeGen/MSP430/Inst8mi.ll new file mode 100644 index 00000000000..56a9b129481 --- /dev/null +++ b/test/CodeGen/MSP430/Inst8mi.ll @@ -0,0 +1,48 @@ +; RUN: llvm-as < %s | llc -march=msp430 | FileCheck %s +target datalayout = "e-p:16:8:8-i8:8:8-i8:8:8-i32:8:8" +target triple = "msp430-generic-generic" +@foo = common global i8 0, align 1 + +define void @mov() nounwind { +; CHECK: mov: +; CHECK: mov.b #2, &foo + store i8 2, i8 * @foo + ret void +} + +define void @add() nounwind { +; CHECK: add: +; CHECK: add.b #2, &foo + %1 = load i8* @foo + %2 = add i8 %1, 2 + store i8 %2, i8 * @foo + ret void +} + +define void @and() nounwind { +; CHECK: and: +; CHECK: and.b #2, &foo + %1 = load i8* @foo + %2 = and i8 %1, 2 + store i8 %2, i8 * @foo + ret void +} + +define void @bis() nounwind { +; CHECK: bis: +; CHECK: bis.b #2, &foo + %1 = load i8* @foo + %2 = or i8 %1, 2 + store i8 %2, i8 * @foo + ret void +} + +define void @xor() nounwind { +; CHECK: xor: +; CHECK: xor.b #2, &foo + %1 = load i8* @foo + %2 = xor i8 %1, 2 + store i8 %2, i8 * @foo + ret void +} + diff --git a/test/CodeGen/MSP430/Inst8mr.ll b/test/CodeGen/MSP430/Inst8mr.ll new file mode 100644 index 00000000000..95096074032 --- /dev/null +++ b/test/CodeGen/MSP430/Inst8mr.ll @@ -0,0 +1,48 @@ +; RUN: llvm-as < %s | llc -march=msp430 | FileCheck %s +target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8" +target triple = "msp430-generic-generic" +@foo = common global i8 0, align 1 + +define void @mov(i8 %a) nounwind { +; CHECK: mov: +; CHECK: mov.b r15, &foo + store i8 %a, i8* @foo + ret void +} + +define void @and(i8 %a) nounwind { +; CHECK: and: +; CHECK: and.b r15, &foo + %1 = load i8* @foo + %2 = and i8 %a, %1 + store i8 %2, i8* @foo + ret void +} + +define void @add(i8 %a) nounwind { +; CHECK: add: +; CHECK: add.b r15, &foo + %1 = load i8* @foo + %2 = add i8 %a, %1 + store i8 %2, i8* @foo + ret void +} + +define void @bis(i8 %a) nounwind { +; CHECK: bis: +; CHECK: bis.b r15, &foo + %1 = load i8* @foo + %2 = or i8 %a, %1 + store i8 %2, i8* @foo + ret void +} + +define void @xor(i8 %a) nounwind { +; CHECK: xor: +; CHECK: xor.b r15, &foo + %1 = load i8* @foo + %2 = xor i8 %a, %1 + store i8 %2, i8* @foo + ret void +} + diff --git a/test/CodeGen/MSP430/Inst8rm.ll b/test/CodeGen/MSP430/Inst8rm.ll new file mode 100644 index 00000000000..b264ebdb896 --- /dev/null +++ b/test/CodeGen/MSP430/Inst8rm.ll @@ -0,0 +1,38 @@ +; RUN: llvm-as < %s | llc -march=msp430 | FileCheck %s +target datalayout = "e-p:16:8:8-i8:8:8-i8:8:8-i32:8:8" +target triple = "msp430-generic-generic" +@foo = common global i8 0, align 1 + +define i8 @add(i8 %a) nounwind { +; CHECK: add: +; CHECK: add.b &foo, r15 + %1 = load i8* @foo + %2 = add i8 %a, %1 + ret i8 %2 +} + +define i8 @and(i8 %a) nounwind { +; CHECK: and: +; CHECK: and.b &foo, r15 + %1 = load i8* @foo + %2 = and i8 %a, %1 + ret i8 %2 +} + + +define i8 @bis(i8 %a) nounwind { +; CHECK: bis: +; CHECK: bis.b &foo, r15 + %1 = load i8* @foo + %2 = or i8 %a, %1 + ret i8 %2 +} + +define i8 @xor(i8 %a) nounwind { +; CHECK: xor: +; CHECK: xor.b &foo, r15 + %1 = load i8* @foo + %2 = xor i8 %a, %1 + ret i8 %2 +} + diff --git a/test/CodeGen/MSP430/Inst8rr.ll b/test/CodeGen/MSP430/Inst8rr.ll new file mode 100644 index 00000000000..9090c36134e --- /dev/null +++ b/test/CodeGen/MSP430/Inst8rr.ll @@ -0,0 +1,38 @@ +; RUN: llvm-as < %s | llc -march=msp430 | FileCheck %s +target datalayout = "e-p:16:8:8-i8:8:8-i8:8:8-i32:8:8" +target triple = "msp430-generic-generic" + +define i8 @mov(i8 %a, i8 %b) nounwind { +; CHECK: mov: +; CHECK: mov.b r14, r15 + ret i8 %b +} + +define i8 @add(i8 %a, i8 %b) nounwind { +; CHECK: add: +; CHECK: add.b r14, r15 + %1 = add i8 %a, %b + ret i8 %1 +} + +define i8 @and(i8 %a, i8 %b) nounwind { +; CHECK: and: +; CHECK: and.w r14, r15 + %1 = and i8 %a, %b + ret i8 %1 +} + +define i8 @bis(i8 %a, i8 %b) nounwind { +; CHECK: bis: +; CHECK: bis.w r14, r15 + %1 = or i8 %a, %b + ret i8 %1 +} + +define i8 @xor(i8 %a, i8 %b) nounwind { +; CHECK: xor: +; CHECK: xor.w r14, r15 + %1 = xor i8 %a, %b + ret i8 %1 +} +