[libc-commits] [libc] [libc][stdfix] Implement fxdivi functions (rdivi) (PR #154914)
via libc-commits
libc-commits at lists.llvm.org
Mon Aug 25 09:40:02 PDT 2025
================
@@ -0,0 +1,49 @@
+//===-- Utility class to test fxdivi functions ------------------*- C++ -*-===//
+//
+// 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 "test/UnitTest/Test.h"
+
+#include "src/__support/fixed_point/fx_rep.h"
+#include "src/__support/macros/sanitizer.h"
+
+#include "hdr/signal_macros.h"
+
+template <typename XType>
+class DivITest : public LIBC_NAMESPACE::testing::Test {
+ using FXRep = LIBC_NAMESPACE::fixed_point::FXRep<int>;
+
+public:
+ typedef XType (*DivIFunc)(int, int);
+
+ void testBasic(DivIFunc func) {
----------------
PiJoules wrote:
Could you also add some test cases for values where the integer operands would result in a precise fixed point value we can compare against?
https://github.com/llvm/llvm-project/pull/154914
More information about the libc-commits
mailing list