mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 568486 - Additional lirasm tests (r+nnethercote) [Cedric Vinent]
--HG-- extra : convert_revision : 2c3056daeba3fd8b9fa6a655fa8d91f71df5e5ba
This commit is contained in:
parent
3ff418bccb
commit
7963fcaad6
@ -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
|
||||
|
@ -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
|
||||
|
31
js/src/lirasm/tests/32-bit/many_params.in
Normal file
31
js/src/lirasm/tests/32-bit/many_params.in
Normal 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
|
1
js/src/lirasm/tests/32-bit/many_params.out
Normal file
1
js/src/lirasm/tests/32-bit/many_params.out
Normal file
@ -0,0 +1 @@
|
||||
Output is: 36
|
11
js/src/lirasm/tests/calld1.in
Normal file
11
js/src/lirasm/tests/calld1.in
Normal 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
|
1
js/src/lirasm/tests/calld1.out
Normal file
1
js/src/lirasm/tests/calld1.out
Normal file
@ -0,0 +1 @@
|
||||
Output is: -62.9667
|
20
js/src/lirasm/tests/float_double.in
Normal file
20
js/src/lirasm/tests/float_double.in
Normal 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
|
1
js/src/lirasm/tests/float_double.out
Normal file
1
js/src/lirasm/tests/float_double.out
Normal file
@ -0,0 +1 @@
|
||||
Output is: 2
|
Loading…
Reference in New Issue
Block a user