[libc-commits] [libc] [llvm] [libc] Improve qsort (PR #120450)

Lukas Bergdoll via libc-commits libc-commits at lists.llvm.org
Thu Dec 19 08:36:32 PST 2024


================
@@ -28,16 +27,19 @@ class SortingTest : public LIBC_NAMESPACE::testing::Test {
       return -1;
   }
 
-  void test_sorted_array(SortingRoutine sort_func) {
+  static void int_sort(SortFn sort_fn, int *array, size_t array_len) {
+    sort_fn(reinterpret_cast<void *>(array), array_len, sizeof(int),
+            int_compare);
+  }
----------------
Voultapher wrote:

Good idea, I've added a new test that covers a range of element sizes, `uint128` wouldn't help because it also uses the Lomuto partition.

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


More information about the libc-commits mailing list