Added x86_64 tests for integer comparison

This commit is contained in:
Dmitry Stogov 2022-04-08 00:59:45 +03:00
parent 14f4fdf29d
commit 67b23a95b5
10 changed files with 170 additions and 0 deletions

17
tests/x86_64/eq_001.irt Normal file
View File

@ -0,0 +1,17 @@
--TEST--
001: eq function
--ARGS--
-S
--CODE--
{
l_1 = START(l_4);
int32_t x = PARAM(l_1, "x", 1);
int32_t y = PARAM(l_1, "y", 2);
bool ret = EQ(x, y);
l_4 = RETURN(l_1, ret);
}
--EXPECT--
test:
cmpl %edi, %esi
sete %al
retq

17
tests/x86_64/ge_001.irt Normal file
View File

@ -0,0 +1,17 @@
--TEST--
001: ge function
--ARGS--
-S
--CODE--
{
l_1 = START(l_4);
int32_t x = PARAM(l_1, "x", 1);
int32_t y = PARAM(l_1, "y", 2);
bool ret = GE(x, y);
l_4 = RETURN(l_1, ret);
}
--EXPECT--
test:
cmpl %edi, %esi
setle %al
retq

17
tests/x86_64/gt_001.irt Normal file
View File

@ -0,0 +1,17 @@
--TEST--
001: gt function
--ARGS--
-S
--CODE--
{
l_1 = START(l_4);
int32_t x = PARAM(l_1, "x", 1);
int32_t y = PARAM(l_1, "y", 2);
bool ret = GT(x, y);
l_4 = RETURN(l_1, ret);
}
--EXPECT--
test:
cmpl %edi, %esi
setl %al
retq

17
tests/x86_64/le_001.irt Normal file
View File

@ -0,0 +1,17 @@
--TEST--
001: le function
--ARGS--
-S
--CODE--
{
l_1 = START(l_4);
int32_t x = PARAM(l_1, "x", 1);
int32_t y = PARAM(l_1, "y", 2);
bool ret = LE(x, y);
l_4 = RETURN(l_1, ret);
}
--EXPECT--
test:
cmpl %edi, %esi
setge %al
retq

17
tests/x86_64/lt_001.irt Normal file
View File

@ -0,0 +1,17 @@
--TEST--
001: lt function
--ARGS--
-S
--CODE--
{
l_1 = START(l_4);
int32_t x = PARAM(l_1, "x", 1);
int32_t y = PARAM(l_1, "y", 2);
bool ret = LT(x, y);
l_4 = RETURN(l_1, ret);
}
--EXPECT--
test:
cmpl %edi, %esi
setg %al
retq

17
tests/x86_64/ne_001.irt Normal file
View File

@ -0,0 +1,17 @@
--TEST--
001: ne function
--ARGS--
-S
--CODE--
{
l_1 = START(l_4);
int32_t x = PARAM(l_1, "x", 1);
int32_t y = PARAM(l_1, "y", 2);
bool ret = NE(x, y);
l_4 = RETURN(l_1, ret);
}
--EXPECT--
test:
cmpl %edi, %esi
setne %al
retq

17
tests/x86_64/uge_001.irt Normal file
View File

@ -0,0 +1,17 @@
--TEST--
001: uge function
--ARGS--
-S
--CODE--
{
l_1 = START(l_4);
uint32_t x = PARAM(l_1, "x", 1);
uint32_t y = PARAM(l_1, "y", 2);
bool ret = UGE(x, y);
l_4 = RETURN(l_1, ret);
}
--EXPECT--
test:
cmpl %edi, %esi
setbe %al
retq

17
tests/x86_64/ugt_001.irt Normal file
View File

@ -0,0 +1,17 @@
--TEST--
001: ugt function
--ARGS--
-S
--CODE--
{
l_1 = START(l_4);
uint32_t x = PARAM(l_1, "x", 1);
uint32_t y = PARAM(l_1, "y", 2);
bool ret = UGT(x, y);
l_4 = RETURN(l_1, ret);
}
--EXPECT--
test:
cmpl %edi, %esi
setb %al
retq

17
tests/x86_64/ule_001.irt Normal file
View File

@ -0,0 +1,17 @@
--TEST--
001: ule function
--ARGS--
-S
--CODE--
{
l_1 = START(l_4);
uint32_t x = PARAM(l_1, "x", 1);
uint32_t y = PARAM(l_1, "y", 2);
bool ret = ULE(x, y);
l_4 = RETURN(l_1, ret);
}
--EXPECT--
test:
cmpl %edi, %esi
setae %al
retq

17
tests/x86_64/ult_001.irt Normal file
View File

@ -0,0 +1,17 @@
--TEST--
001: ult function
--ARGS--
-S
--CODE--
{
l_1 = START(l_4);
uint32_t x = PARAM(l_1, "x", 1);
uint32_t y = PARAM(l_1, "y", 2);
bool ret = ULT(x, y);
l_4 = RETURN(l_1, ret);
}
--EXPECT--
test:
cmpl %edi, %esi
seta %al
retq