[libcxx-commits] [libcxx] gcd: Add more tests that require few more divisions (PR #129395)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Mar 1 10:45:34 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: AdityaK (hiraditya)

<details>
<summary>Changes</summary>

@<!-- -->colincross identified gcd does not have a single case whose answer is not 0, 1, or the smaller of the two inputs.

---
Full diff: https://github.com/llvm/llvm-project/pull/129395.diff


1 Files Affected:

- (modified) libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp (+1-1) 


``````````diff
diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
index 975b53a763afa..c5d3c127fc1ec 100644
--- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
@@ -27,7 +27,7 @@ constexpr struct {
   int x;
   int y;
   int expect;
-} Cases[] = {{0, 0, 0}, {1, 0, 1}, {0, 1, 1}, {1, 1, 1}, {2, 3, 1}, {2, 4, 2}, {11, 9, 1}, {36, 17, 1}, {36, 18, 18}};
+} Cases[] = {{0, 0, 0}, {1, 0, 1}, {0, 1, 1}, {1, 1, 1}, {2, 3, 1}, {2, 4, 2}, {11, 9, 1}, {36, 17, 1}, {36, 18, 18}, {25, 30, 5}, {24, 16, 8}, {256, 100, 4}};
 
 template <typename Input1, typename Input2, typename Output>
 constexpr bool test0(int in1, int in2, int out)

``````````

</details>


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


More information about the libcxx-commits mailing list