ir/tests/x86_64/add_ov_004.irt

34 lines
518 B
Plaintext
Raw Normal View History

--TEST--
004: add_ov function (jmp probability)
2022-05-25 16:38:22 +02:00
--TARGET--
x86_64
--ARGS--
-S
--CODE--
{
int32_t c_1 = 0;
int32_t c = 2;
l_1 = START(l_8);
int32_t x = PARAM(l_1, "x", 1);
int32_t ret1 = ADD_OV(x, c);
bool ov = OVERFLOW(ret1);
l_2 = IF(l_1, ov);
l_3 = IF_TRUE(l_2, 1);
l_4 = END(l_3);
l_5 = IF_FALSE(l_2);
l_6 = END(l_5);
l_7 = MERGE(l_4, l_6);
int32_t ret = PHI(l_7, c_1, ret1);
l_8 = RETURN(l_7, ret);
}
--EXPECT--
test:
movl %edi, %eax
addl $2, %eax
jo .L2
.L1:
retq
.L2:
xorl %eax, %eax
jmp .L1