]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - math/test-fenvinline.c
Merge branch 'master' of git://sourceware.org/git/glibc
[thirdparty/glibc.git] / math / test-fenvinline.c
index 87c9df44b3dae7b2ea19f0b614ca3e77b325d221..64baf13aae92d6ff3716265af310262b4d044c1d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for fenv inline implementations.
-   Copyright (C) 2015 Free Software Foundation, Inc.
+   Copyright (C) 2015-2018 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -200,11 +200,11 @@ test_fesetround (void)
 #endif
 }
 
+#if FE_ALL_EXCEPT
 /* Tests for feenableexcept/fedisableexcept.  */
 static void
 feenable_test (const char *flag_name, fexcept_t fe_exc)
 {
-#if FE_ALL_EXCEPT
   int fe_exci = fe_exc;
   double fe_excd = fe_exc;
   int excepts;
@@ -249,7 +249,7 @@ feenable_test (const char *flag_name, fexcept_t fe_exc)
   if (excepts != fe_exc)
     {
       printf ("Test: fedisableexcept (%s) failed, return should be 0x%x, is 0x%x\n",
-              flag_name, fe_exc, excepts);
+              flag_name, (unsigned int)fe_exc, excepts);
       ++count_errors;
     }
 
@@ -284,11 +284,11 @@ feenable_test (const char *flag_name, fexcept_t fe_exc)
   if (excepts != fe_exc)
     {
       printf ("Test: fedisableexcept (%s) failed, return should be 0x%x, is 0x%x\n",
-              flag_name, fe_exc, excepts);
+              flag_name, (unsigned int)fe_exc, excepts);
       ++count_errors;
     }
-#endif
 }
+#endif
 
 static void
 test_feenabledisable (void)
@@ -326,8 +326,9 @@ do_test (void)
 
   /* raise all exceptions and test if all are raised  */
   feraiseexcept (FE_ALL_EXCEPT);
-  test_exceptions ("feraiseexcept (FE_ALL_EXCEPT) raises all exceptions",
-                   ALL_EXC);
+  if (EXCEPTION_TESTS (float))
+    test_exceptions ("feraiseexcept (FE_ALL_EXCEPT) raises all exceptions",
+                    ALL_EXC);
 
   /* Same test, but using double as argument  */
   feclearexcept ((double)FE_ALL_EXCEPT);
@@ -335,10 +336,12 @@ do_test (void)
                    NO_EXC);
 
   feraiseexcept ((double)FE_ALL_EXCEPT);
-  test_exceptions ("feraiseexcept ((double)FE_ALL_EXCEPT) raises all exceptions",
-                   ALL_EXC);
+  if (EXCEPTION_TESTS (float))
+    test_exceptions ("feraiseexcept ((double)FE_ALL_EXCEPT) raises all exceptions",
+                    ALL_EXC);
 
-  test_exceptionflag ();
+  if (EXCEPTION_TESTS (float))
+    test_exceptionflag ();
 
   test_fesetround ();