Bug 568486 - Additional lirasm tests (r+nnethercote) [Cedric Vinent]

--HG--
extra : convert_revision : 2c3056daeba3fd8b9fa6a655fa8d91f71df5e5ba
This commit is contained in:
Rick Reitmaier 2010-08-31 11:14:48 -07:00
parent 3ff418bccb
commit 7963fcaad6
8 changed files with 80 additions and 0 deletions

View File

@ -368,11 +368,17 @@ double sinFn(double d) {
}
#define sin sinFn
double calld1(double x, double i, double y, double l, double x1, double i1, double y1, double l1) {
return x + i * y - l + x1 / i1 - y1 * l1;
}
Function functions[] = {
FN(puts, CallInfo::typeSig1(ARGTYPE_I, ARGTYPE_P)),
FN(sin, CallInfo::typeSig1(ARGTYPE_D, ARGTYPE_D)),
FN(malloc, CallInfo::typeSig1(ARGTYPE_P, ARGTYPE_P)),
FN(free, CallInfo::typeSig1(ARGTYPE_V, ARGTYPE_P)),
FN(calld1, CallInfo::typeSig8(ARGTYPE_D, ARGTYPE_D, ARGTYPE_D, ARGTYPE_D,
ARGTYPE_D, ARGTYPE_D, ARGTYPE_D, ARGTYPE_D, ARGTYPE_D)),
};
template<typename out, typename in> out

View File

@ -56,6 +56,15 @@ then
done
fi
# 32-bit platforms
if [[ $($LIRASM --word-size) == 32 ]]
then
for infile in "$TESTS_DIR"/32-bit/*.in
do
runtest $infile
done
fi
# ARM
if [[ $(uname -m) == arm* ]]
then

View File

@ -0,0 +1,31 @@
.begin many_params
pa = parami 0 0
pb = parami 1 0
pc = parami 2 0
pd = parami 3 0
pe = parami 4 0
pf = parami 5 0
pg = parami 6 0
ph = parami 7 0
res1 = addi pa pb
res2 = addi res1 pc
res3 = addi res2 pd
res4 = addi res3 pe
res5 = addi res4 pf
res6 = addi res5 pg
res7 = addi res6 ph
reti res7
.end
.begin main
a = immi 1
b = immi 2
c = immi 3
d = immi 4
e = immi 5
f = immi 6
g = immi 7
h = immi 8
res = calli many_params fastcall a b c d e f g h
reti res
.end

View File

@ -0,0 +1 @@
Output is: 36

View File

@ -0,0 +1,11 @@
a = immd 1.1;
b = immd 2.2
c = immd 3.3;
d = immd 4.4;
e = immd 5.5;
f = immd 6.6;
g = immd 7.7;
h = immd 8.8;
res = calld calld1 cdecl a b c d e f g h
retd res

View File

@ -0,0 +1 @@
Output is: -62.9667

View File

@ -0,0 +1,20 @@
doubleA = immd 1.25 ; single precision
doubleB = immd 4.5 ; single precision
doubleC = immd 1.2 ; not single precision
ptr = allocp 12
std2f doubleA ptr 0
std2f doubleB ptr 4
std2f doubleC ptr 8
doubleD = ldf2d ptr 0
doubleE = ldf2d ptr 4
doubleF = ldf2d ptr 8
resA = eqd doubleA doubleD ; true
resB = eqd doubleB doubleE ; true
resC = eqd doubleB doubleF ; false
resD = addi resA resB
resE = addi resC resD
reti resE

View File

@ -0,0 +1 @@
Output is: 2