[libc-commits] [PATCH] D121235: [libc] Add testing macros for errno and floating point exceptions.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Mar 8 11:41:17 PST 2022


lntue added inline comments.


================
Comment at: libc/utils/UnitTest/FPMatcher.h:104
+#define EXPECT_MATH_ERRNO(expected)                                            \
+  do {                                                                         \
+    if (math_errhandling & MATH_ERRNO) {                                       \
----------------
michaelrj wrote:
> why is the do/while(0) necessary?
just to safely wrap the if statement and allow it to be used with `;` at the end like `EXPECT_MATH_ERRNO(value);`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121235/new/

https://reviews.llvm.org/D121235



More information about the libc-commits mailing list