[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 19/57] tests/tcg/i386: add runner for test-i386-fp
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PULL v2 19/57] tests/tcg/i386: add runner for test-i386-fprem |
Date: |
Thu, 21 Jun 2018 07:25:27 +0100 |
The runner needs to compare against a reference run. We also only run
this test when SPEED=slow as it takes a while.
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target
index 8b46cc021e..64d241cfdf 100644
--- a/tests/tcg/i386/Makefile.target
+++ b/tests/tcg/i386/Makefile.target
@@ -33,5 +33,21 @@ test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S
test-i386.h test-i386
run-runcom: runcom pi_10.com
$(call quiet-command, $(QEMU) ./runcom $(I386_SRC)/pi_10.com >
runcom.out, "TEST", "$< on $(TARGET_NAME)")
+ifeq ($(SPEED), slow)
+
+test-i386-fprem.ref: test-i386-fprem
+ $(call quiet-command, ./$< > $@,"GENREF","generating $@")
+
+run-test-i386-fprem: TIMEOUT=60
+run-test-i386-fprem: test-i386-fprem
+ $(call quiet-command, \
+ $(QEMU) $< > $<.out && \
+ diff -u $(I386_SRC)/$<.ref $<.out, \
+ "TEST", "$< (default) on $(TARGET_NAME)")
+else
+run-test-i386-fprem: test-i386-fprem
+ $(call quiet-command, /bin/true, "SLOW TEST", "$< SKIPPED on
$(TARGET_NAME)")
+endif
+
# On i386 and x86_64 Linux only supports 4k pages (large pages are a different
hack)
EXTRA_RUNS+=run-test-mmap-4096
diff --git a/tests/tcg/i386/test-i386-fprem.c b/tests/tcg/i386/test-i386-fprem.c
index 1a71623204..66f5a9657d 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
@@ -229,6 +232,7 @@ static void test_fprem_cases(void)
do_fprem_stack_underflow();
printf("= invalid operation =\n");
+ do_fprem(q_nan.d, 1.0);
do_fprem(s_nan.d, 1.0);
do_fprem(1.0, 0.0);
do_fprem(pos_inf.d, 1.0);
@@ -238,6 +242,8 @@ static void test_fprem_cases(void)
do_fprem(pos_denorm.d, 1.0);
do_fprem(1.0, pos_denorm.d);
+ do_fprem(smallest_positive_norm.d, smallest_positive_norm.d);
+
/* printf("= underflow =\n"); */
/* TODO: Is there a case where FPREM raises underflow? */
}
--
2.17.1
- [Qemu-devel] [PULL v2 51/57] docker: docker.py use "version" to probe usage, (continued)
- [Qemu-devel] [PULL v2 51/57] docker: docker.py use "version" to probe usage, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 25/57] tests/tcg/arm: fix up test-arm-iwmmxt test, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 39/57] tests/tcg: enable building for sparc64, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 49/57] tests/tcg/i386: extend timeout for runcom test, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 56/57] tests/docker/Makefile.include: only force SID to NOCACHE if old, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 44/57] tests/tcg/Makefile: update to be called from Makefile.target, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 47/57] tests/tcg: add run, diff, and skip helper macros, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 15/57] tests/tcg: move i386 specific tests into subdir, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 33/57] tests/tcg: enable building for ppc64, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 45/57] Makefile.target: add (clean-/build-)guest-tests targets, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 19/57] tests/tcg/i386: add runner for test-i386-fprem,
Alex Bennée <=
- [Qemu-devel] [PULL v2 46/57] tests/Makefile.include: add [build|clean|check]-tcg targets, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 27/57] tests/tcg/arm: add fcvt test cases for AArch32/64, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 22/57] tests/tcg/i386/test-i386: fix printf format, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 40/57] tests/tcg: enable building for mips64, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 11/57] tests/tcg/multiarch: Build fix for linux-test, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 30/57] tests/docker/Makefile.include: fix mipsel-cross dependancy, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 34/57] tests/tcg: enable building for Alpha, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 35/57] tests/tcg/alpha: add Alpha specific tests, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 23/57] tests/tcg: move ARM specific tests into subdir, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 37/57] tests/tcg: enable building for m68k, Alex Bennée, 2018/06/21