summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-11-30 16:33:23 +0000
committerEric Engestrom <eric.engestrom@intel.com>2018-12-04 17:42:47 +0000
commitacc32faa137f7df13d1f1b74c28a562414587e70 (patch)
tree08308216eba65eb9987a2060b9c29c3f792ecb2c
parent794340021e2edcc6f3cddb2ed95b48a82f19816b (diff)
tests: only run rounding tests if FE_UPWARD is present
On ARM, musl does not define FE_* when the architecture does not have VFP (which is the right interpretation). As these tests depend on calling fesetround(), skip the test if FE_UPWARD isn't available. Signed-off-by: Ross Burton <ross.burton@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
-rw-r--r--tests/general/roundmode-getintegerv.c12
-rw-r--r--tests/general/roundmode-pixelstore.c12
2 files changed, 16 insertions, 8 deletions
diff --git a/tests/general/roundmode-getintegerv.c b/tests/general/roundmode-getintegerv.c
index 28ecfaf55..aa99044a1 100644
--- a/tests/general/roundmode-getintegerv.c
+++ b/tests/general/roundmode-getintegerv.c
@@ -79,13 +79,17 @@ test(float val, int expect)
void
piglit_init(int argc, char **argv)
{
- int ret;
bool pass = true;
- ret = fesetround(FE_UPWARD);
- if (ret != 0) {
- printf("Couldn't set rounding mode\n");
+
+#ifdef FE_UPWARD
+ if (fesetround(FE_UPWARD) != 0) {
+ printf("Setting rounding mode failed\n");
piglit_report_result(PIGLIT_SKIP);
}
+#else
+ printf("Cannot set rounding mode\n");
+ piglit_report_result(PIGLIT_SKIP);
+#endif
pass = test(2.2, 2) && pass;
pass = test(2.8, 3) && pass;
diff --git a/tests/general/roundmode-pixelstore.c b/tests/general/roundmode-pixelstore.c
index 8a029b257..57ec11c09 100644
--- a/tests/general/roundmode-pixelstore.c
+++ b/tests/general/roundmode-pixelstore.c
@@ -79,13 +79,17 @@ test(float val, int expect)
void
piglit_init(int argc, char **argv)
{
- int ret;
bool pass = true;
- ret = fesetround(FE_UPWARD);
- if (ret != 0) {
- printf("Couldn't set rounding mode\n");
+
+#ifdef FE_UPWARD
+ if (fesetround(FE_UPWARD) != 0) {
+ printf("Setting rounding mode failed\n");
piglit_report_result(PIGLIT_SKIP);
}
+#else
+ printf("Cannot set rounding mode\n");
+ piglit_report_result(PIGLIT_SKIP);
+#endif
pass = test(2.2, 2) && pass;
pass = test(2.8, 3) && pass;