diff mbox

Fix def_test_returning_type in iamcu/test_basic_returning.c

Message ID 20151016172709.GA23774@intel.com
State New
Headers show

Commit Message

H.J. Lu Oct. 16, 2015, 5:27 p.m. UTC
Use union to check float return bits to avoid converting from integer
to float when comparing float return value.  I will check it in after
regression test.


H.J.
---
	* gcc.target/i386/iamcu/test_basic_returning.c
	(def_test_returning_type): Use union to check float return bits.
---
 gcc/testsuite/gcc.target/i386/iamcu/test_basic_returning.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.target/i386/iamcu/test_basic_returning.c b/gcc/testsuite/gcc.target/i386/iamcu/test_basic_returning.c
index 23efa6e..e617d8d 100644
--- a/gcc/testsuite/gcc.target/i386/iamcu/test_basic_returning.c
+++ b/gcc/testsuite/gcc.target/i386/iamcu/test_basic_returning.c
@@ -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)
 {