[libc-commits] [libc] [libc][math] Implement issignaling macro. (PR #109615)

via libc-commits libc-commits at lists.llvm.org
Tue Sep 24 09:33:16 PDT 2024


================
@@ -9,24 +9,24 @@
 
 #include <assert.h>
 
-// TODO: enable the test unconditionally when issignaling macro is fixed for
-//       older compiler
-#if (defined(__clang__) && __clang_major__ >= 18) ||                           \
-    (defined(__GNUC__) && __GNUC__ >= 13)
-
 // check if macro is defined
 #ifndef issignaling
-#error "issignaling macro is not defined"
+// TODO: enable the error when issignaling macro is fixed for older compiler
+// #error "issignaling macro is not defined"
 #else
 int main(void) {
+// TODO: enable the test unconditionally when issignaling macro is fixed for
+//       older compiler
+#if (defined(__clang__) && __clang_major__ >= 18) ||                           \
+    (defined(__GNUC__) && __GNUC__ >= 13)
   assert(issignaling(__builtin_nans("")) == 1);
   assert(issignaling(__builtin_nansf("")) == 1);
   assert(issignaling(__builtin_nansl("")) == 1);
   assert(issignaling(1.819f) == 0);
   assert(issignaling(-1.726) == 0);
   assert(issignaling(1.426L) == 0);
+#endif
   return 0;
 }
-#endif
 
 #endif
----------------
lntue wrote:

To make the test not broken / error out for now, the test should be:
```
// TODO: ...
int main(void) {
#ifdef issignaling
  assert ....
#endif
  return 0;
}
```

https://github.com/llvm/llvm-project/pull/109615


More information about the libc-commits mailing list