[libc] [llvm] [libc][complex] Testing infra for MPC (PR #121261)

Nick Desaulniers via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 09:53:34 PST 2025


================
@@ -0,0 +1,561 @@
+//===-- Utils used by both MPCWrapper and MPFRWrapper----------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "MPCommon.h"
+
+#include "src/__support/CPP/string_view.h"
+#include "src/__support/FPUtil/cast.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/properties/types.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace testing {
+namespace mpfr {
+
+MPFRNumber::MPFRNumber() : mpfr_precision(256), mpfr_rounding(MPFR_RNDN) {
+  mpfr_init2(value, mpfr_precision);
+}
+
+MPFRNumber::MPFRNumber(const MPFRNumber &other)
----------------
nickdesaulniers wrote:

`explicit`

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


More information about the llvm-commits mailing list