aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/MSP430
diff options
context:
space:
mode:
authorJohn Thompson <John.Thompson.JTSoftware@gmail.com>2010-11-02 23:01:44 +0000
committerJohn Thompson <John.Thompson.JTSoftware@gmail.com>2010-11-02 23:01:44 +0000
commit45c21ff044ce72a25d7d654f8bbceffe41d6f70b (patch)
tree0dd76039b8320cffedb47c6657fc7a21292d394c /test/CodeGen/MSP430
parent6f6021ecfe16238edc75f1b7df89245499f1a077 (diff)
downloadexternal_llvm-45c21ff044ce72a25d7d654f8bbceffe41d6f70b.zip
external_llvm-45c21ff044ce72a25d7d654f8bbceffe41d6f70b.tar.gz
external_llvm-45c21ff044ce72a25d7d654f8bbceffe41d6f70b.tar.bz2
Inline asm mult-alt constraint tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/MSP430')
-rw-r--r--test/CodeGen/MSP430/mult-alt-generic-msp430.ll323
1 files changed, 323 insertions, 0 deletions
diff --git a/test/CodeGen/MSP430/mult-alt-generic-msp430.ll b/test/CodeGen/MSP430/mult-alt-generic-msp430.ll
new file mode 100644
index 0000000..342afed
--- /dev/null
+++ b/test/CodeGen/MSP430/mult-alt-generic-msp430.ll
@@ -0,0 +1,323 @@
+; RUN: llc < %s -march=msp430
+; ModuleID = 'mult-alt-generic.c'
+target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16"
+target triple = "msp430"
+
+@mout0 = common global i16 0, align 2
+@min1 = common global i16 0, align 2
+@marray = common global [2 x i16] zeroinitializer, align 2
+
+define void @single_m() nounwind {
+entry:
+ call void asm "foo $1,$0", "=*m,*m"(i16* @mout0, i16* @min1) nounwind
+ ret void
+}
+
+define void @single_o() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %index = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %index, align 2
+ ret void
+}
+
+define void @single_V() nounwind {
+entry:
+ ret void
+}
+
+define void @single_lt() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %in1 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %in1, align 2
+ %tmp = load i16* %in1, align 2
+ %0 = call i16 asm "foo $1,$0", "=r,<r"(i16 %tmp) nounwind
+ store i16 %0, i16* %out0, align 2
+ %tmp1 = load i16* %in1, align 2
+ %1 = call i16 asm "foo $1,$0", "=r,r<"(i16 %tmp1) nounwind
+ store i16 %1, i16* %out0, align 2
+ ret void
+}
+
+define void @single_gt() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %in1 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %in1, align 2
+ %tmp = load i16* %in1, align 2
+ %0 = call i16 asm "foo $1,$0", "=r,>r"(i16 %tmp) nounwind
+ store i16 %0, i16* %out0, align 2
+ %tmp1 = load i16* %in1, align 2
+ %1 = call i16 asm "foo $1,$0", "=r,r>"(i16 %tmp1) nounwind
+ store i16 %1, i16* %out0, align 2
+ ret void
+}
+
+define void @single_r() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %in1 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %in1, align 2
+ %tmp = load i16* %in1, align 2
+ %0 = call i16 asm "foo $1,$0", "=r,r"(i16 %tmp) nounwind
+ store i16 %0, i16* %out0, align 2
+ ret void
+}
+
+define void @single_i() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ %0 = call i16 asm "foo $1,$0", "=r,i"(i16 1) nounwind
+ store i16 %0, i16* %out0, align 2
+ ret void
+}
+
+define void @single_n() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ %0 = call i16 asm "foo $1,$0", "=r,n"(i16 1) nounwind
+ store i16 %0, i16* %out0, align 2
+ ret void
+}
+
+define void @single_E() nounwind {
+entry:
+ %out0 = alloca double, align 8
+ store double 0.000000e+000, double* %out0, align 8
+; No lowering support.
+; %0 = call double asm "foo $1,$0", "=r,E"(double 1.000000e+001) nounwind
+; store double %0, double* %out0, align 8
+ ret void
+}
+
+define void @single_F() nounwind {
+entry:
+ %out0 = alloca double, align 8
+ store double 0.000000e+000, double* %out0, align 8
+; No lowering support.
+; %0 = call double asm "foo $1,$0", "=r,F"(double 1.000000e+000) nounwind
+; store double %0, double* %out0, align 8
+ ret void
+}
+
+define void @single_s() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ ret void
+}
+
+define void @single_g() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %in1 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %in1, align 2
+ %tmp = load i16* %in1, align 2
+ %0 = call i16 asm "foo $1,$0", "=r,imr"(i16 %tmp) nounwind
+ store i16 %0, i16* %out0, align 2
+ %tmp1 = load i16* @min1, align 2
+ %1 = call i16 asm "foo $1,$0", "=r,imr"(i16 %tmp1) nounwind
+ store i16 %1, i16* %out0, align 2
+ %2 = call i16 asm "foo $1,$0", "=r,imr"(i16 1) nounwind
+ store i16 %2, i16* %out0, align 2
+ ret void
+}
+
+define void @single_X() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %in1 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %in1, align 2
+ %tmp = load i16* %in1, align 2
+ %0 = call i16 asm "foo $1,$0", "=r,X"(i16 %tmp) nounwind
+ store i16 %0, i16* %out0, align 2
+ %tmp1 = load i16* @min1, align 2
+ %1 = call i16 asm "foo $1,$0", "=r,X"(i16 %tmp1) nounwind
+ store i16 %1, i16* %out0, align 2
+ %2 = call i16 asm "foo $1,$0", "=r,X"(i16 1) nounwind
+ store i16 %2, i16* %out0, align 2
+ %3 = call i16 asm "foo $1,$0", "=r,X"(i16* getelementptr inbounds ([2 x i16]* @marray, i32 0, i32 0)) nounwind
+ store i16 %3, i16* %out0, align 2
+; No lowering support.
+; %4 = call i16 asm "foo $1,$0", "=r,X"(double 1.000000e+001) nounwind
+; store i16 %4, i16* %out0, align 2
+; %5 = call i16 asm "foo $1,$0", "=r,X"(double 1.000000e+000) nounwind
+; store i16 %5, i16* %out0, align 2
+ ret void
+}
+
+define void @single_p() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ %0 = call i16 asm "foo $1,$0", "=r,r"(i16* getelementptr inbounds ([2 x i16]* @marray, i32 0, i32 0)) nounwind
+ store i16 %0, i16* %out0, align 2
+ ret void
+}
+
+define void @multi_m() nounwind {
+entry:
+ %tmp = load i16* @min1, align 2
+ call void asm "foo $1,$0", "=*m|r,m|r"(i16* @mout0, i16 %tmp) nounwind
+ ret void
+}
+
+define void @multi_o() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %index = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %index, align 2
+ ret void
+}
+
+define void @multi_V() nounwind {
+entry:
+ ret void
+}
+
+define void @multi_lt() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %in1 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %in1, align 2
+ %tmp = load i16* %in1, align 2
+ %0 = call i16 asm "foo $1,$0", "=r|r,r|<r"(i16 %tmp) nounwind
+ store i16 %0, i16* %out0, align 2
+ %tmp1 = load i16* %in1, align 2
+ %1 = call i16 asm "foo $1,$0", "=r|r,r|r<"(i16 %tmp1) nounwind
+ store i16 %1, i16* %out0, align 2
+ ret void
+}
+
+define void @multi_gt() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %in1 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %in1, align 2
+ %tmp = load i16* %in1, align 2
+ %0 = call i16 asm "foo $1,$0", "=r|r,r|>r"(i16 %tmp) nounwind
+ store i16 %0, i16* %out0, align 2
+ %tmp1 = load i16* %in1, align 2
+ %1 = call i16 asm "foo $1,$0", "=r|r,r|r>"(i16 %tmp1) nounwind
+ store i16 %1, i16* %out0, align 2
+ ret void
+}
+
+define void @multi_r() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %in1 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %in1, align 2
+ %tmp = load i16* %in1, align 2
+ %0 = call i16 asm "foo $1,$0", "=r|r,r|m"(i16 %tmp) nounwind
+ store i16 %0, i16* %out0, align 2
+ ret void
+}
+
+define void @multi_i() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ %0 = call i16 asm "foo $1,$0", "=r|r,r|i"(i16 1) nounwind
+ store i16 %0, i16* %out0, align 2
+ ret void
+}
+
+define void @multi_n() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ %0 = call i16 asm "foo $1,$0", "=r|r,r|n"(i16 1) nounwind
+ store i16 %0, i16* %out0, align 2
+ ret void
+}
+
+define void @multi_E() nounwind {
+entry:
+ %out0 = alloca double, align 8
+ store double 0.000000e+000, double* %out0, align 8
+; No lowering support.
+; %0 = call double asm "foo $1,$0", "=r|r,r|E"(double 1.000000e+001) nounwind
+; store double %0, double* %out0, align 8
+ ret void
+}
+
+define void @multi_F() nounwind {
+entry:
+ %out0 = alloca double, align 8
+ store double 0.000000e+000, double* %out0, align 8
+; No lowering support.
+; %0 = call double asm "foo $1,$0", "=r|r,r|F"(double 1.000000e+000) nounwind
+; store double %0, double* %out0, align 8
+ ret void
+}
+
+define void @multi_s() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ ret void
+}
+
+define void @multi_g() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %in1 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %in1, align 2
+ %tmp = load i16* %in1, align 2
+ %0 = call i16 asm "foo $1,$0", "=r|r,r|imr"(i16 %tmp) nounwind
+ store i16 %0, i16* %out0, align 2
+ %tmp1 = load i16* @min1, align 2
+ %1 = call i16 asm "foo $1,$0", "=r|r,r|imr"(i16 %tmp1) nounwind
+ store i16 %1, i16* %out0, align 2
+ %2 = call i16 asm "foo $1,$0", "=r|r,r|imr"(i16 1) nounwind
+ store i16 %2, i16* %out0, align 2
+ ret void
+}
+
+define void @multi_X() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ %in1 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ store i16 1, i16* %in1, align 2
+ %tmp = load i16* %in1, align 2
+ %0 = call i16 asm "foo $1,$0", "=r|r,r|X"(i16 %tmp) nounwind
+ store i16 %0, i16* %out0, align 2
+ %tmp1 = load i16* @min1, align 2
+ %1 = call i16 asm "foo $1,$0", "=r|r,r|X"(i16 %tmp1) nounwind
+ store i16 %1, i16* %out0, align 2
+ %2 = call i16 asm "foo $1,$0", "=r|r,r|X"(i16 1) nounwind
+ store i16 %2, i16* %out0, align 2
+ %3 = call i16 asm "foo $1,$0", "=r|r,r|X"(i16* getelementptr inbounds ([2 x i16]* @marray, i32 0, i32 0)) nounwind
+ store i16 %3, i16* %out0, align 2
+; No lowering support.
+; %4 = call i16 asm "foo $1,$0", "=r|r,r|X"(double 1.000000e+001) nounwind
+; store i16 %4, i16* %out0, align 2
+; %5 = call i16 asm "foo $1,$0", "=r|r,r|X"(double 1.000000e+000) nounwind
+; store i16 %5, i16* %out0, align 2
+ ret void
+}
+
+define void @multi_p() nounwind {
+entry:
+ %out0 = alloca i16, align 2
+ store i16 0, i16* %out0, align 2
+ %0 = call i16 asm "foo $1,$0", "=r|r,r|r"(i16* getelementptr inbounds ([2 x i16]* @marray, i32 0, i32 0)) nounwind
+ store i16 %0, i16* %out0, align 2
+ ret void
+}