[v1,16/24] tests/tcg/i386: fix test-i386-fprem

Message ID 20180410193919.28026-17-alex.bennee@linaro.org
State New
Headers show
Series
  • fix building of tests/tcg
Related show

Commit Message

Alex Bennée April 10, 2018, 7:39 p.m.
Remove dependencies on QEMU's source tree and build directly.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 tests/tcg/i386/test-i386-fprem.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

-- 
2.16.2

Comments

Philippe Mathieu-Daudé April 11, 2018, 3:14 p.m. | #1
On 04/10/2018 04:39 PM, Alex Bennée wrote:
> Remove dependencies on QEMU's source tree and build directly.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>


Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


> ---

>  tests/tcg/i386/test-i386-fprem.c | 9 ++++++---

>  1 file changed, 6 insertions(+), 3 deletions(-)

> 

> diff --git a/tests/tcg/i386/test-i386-fprem.c b/tests/tcg/i386/test-i386-fprem.c

> index 1a71623204..771dc07433 100644

> --- a/tests/tcg/i386/test-i386-fprem.c

> +++ b/tests/tcg/i386/test-i386-fprem.c

> @@ -23,7 +23,10 @@

>   *  along with this program; if not, see <http://www.gnu.org/licenses/>.

>   */

>  

> -#include "qemu/osdep.h"

> +#include <stdio.h>

> +#include <stdint.h>

> +

> +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

>  

>  /*

>   * Inspired by <ieee754.h>'s union ieee854_long_double, but with single

> @@ -39,7 +42,7 @@ union float80u {

>          unsigned int exponent:15;

>          unsigned int negative:1;

>          unsigned int empty:16;

> -    } QEMU_PACKED ieee;

> +    } __attribute__((packed)) ieee;

>  

>      /* This is for NaNs in the IEEE 854 double-extended-precision format.  */

>      struct {

> @@ -49,7 +52,7 @@ union float80u {

>          unsigned int exponent:15;

>          unsigned int negative:1;

>          unsigned int empty:16;

> -    } QEMU_PACKED ieee_nan;

> +    } __attribute__((packed)) ieee_nan;

>  };

>  

>  #define IEEE854_LONG_DOUBLE_BIAS 0x3fff

>

Patch

diff --git a/tests/tcg/i386/test-i386-fprem.c b/tests/tcg/i386/test-i386-fprem.c
index 1a71623204..771dc07433 100644
--- a/tests/tcg/i386/test-i386-fprem.c
+++ b/tests/tcg/i386/test-i386-fprem.c
@@ -23,7 +23,10 @@ 
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "qemu/osdep.h"
+#include <stdio.h>
+#include <stdint.h>
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
 /*
  * Inspired by <ieee754.h>'s union ieee854_long_double, but with single
@@ -39,7 +42,7 @@  union float80u {
         unsigned int exponent:15;
         unsigned int negative:1;
         unsigned int empty:16;
-    } QEMU_PACKED ieee;
+    } __attribute__((packed)) ieee;
 
     /* This is for NaNs in the IEEE 854 double-extended-precision format.  */
     struct {
@@ -49,7 +52,7 @@  union float80u {
         unsigned int exponent:15;
         unsigned int negative:1;
         unsigned int empty:16;
-    } QEMU_PACKED ieee_nan;
+    } __attribute__((packed)) ieee_nan;
 };
 
 #define IEEE854_LONG_DOUBLE_BIAS 0x3fff