ir/tests/c/abs_002.irt

20 lines
253 B
Plaintext
Raw Normal View History

--TEST--
002: abs function
--ARGS--
--emit-c
--CODE--
{
l_1 = START(l_4);
double x = PARAM(l_1, "x", 1);
double ret = ABS(x);
l_4 = RETURN(l_1, ret);
}
--EXPECT--
double test(double x)
{
double d_1 = x;
double d_2;
d_2 = fabs(d_1)
return d_2;
}