Fix def_test_returning_type in iamcu/test_basic_returning.c
Use union to check float return bits to avoid converting from integer to float when comparing float return value. * gcc.target/i386/iamcu/test_basic_returning.c (def_test_returning_type): Use union to check float return bits. From-SVN: r228924
This commit is contained in:
parent
e11c440728
commit
104cbaf530
2 changed files with 9 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* gcc.target/i386/iamcu/test_basic_returning.c
|
||||
(def_test_returning_type): Use union to check float return bits.
|
||||
|
||||
2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* gcc.target/i386/iamcu/test_basic_64bit_returning.c (main):
|
||||
|
|
|
@ -39,7 +39,10 @@ fun_test_returning_float (void)
|
|||
|
||||
#define def_test_returning_type(fun, type, ret, reg) \
|
||||
{ type var = WRAP_RET (fun) (); \
|
||||
assert (ret == (type) reg && ret == var); }
|
||||
union { type r; unsigned long reg; } u; \
|
||||
u.reg = reg; \
|
||||
assert (ret == u.r && ret == var); }
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue