diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2015-10-16 20:03:17 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2015-10-16 13:03:17 -0700 |
commit | 104cbaf5306c735ccc9f193f2b6a4e93df8a3165 (patch) | |
tree | e8d89e522e4e29b4a4f0a47d72c673594ba39862 | |
parent | e11c44072864533510db7d39eeab9ac7831654b5 (diff) | |
download | gcc-104cbaf5306c735ccc9f193f2b6a4e93df8a3165.zip gcc-104cbaf5306c735ccc9f193f2b6a4e93df8a3165.tar.gz gcc-104cbaf5306c735ccc9f193f2b6a4e93df8a3165.tar.bz2 |
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
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/iamcu/test_basic_returning.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f56798c..90a2c66 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 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): Replace printf with __builtin_printf. 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) { |