[libc-commits] [libc] [libc] implement getloadavg (PR #221049)

Alexey Samsonov via libc-commits libc-commits at lists.llvm.org
Thu Sep 3 14:57:28 PDT 2026


================
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Unittests for getloadavg.
+///
+//===----------------------------------------------------------------------===//
+
+#include "src/stdlib/getloadavg.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
+#include "test/UnitTest/Test.h"
+
+using LlvmLibcGetloadavgTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
+
+TEST_F(LlvmLibcGetloadavgTest, ZeroElements) {
+  double samples[3] = {-1.0, -1.0, -1.0};
+  int ret = LIBC_NAMESPACE::getloadavg(samples, 0);
----------------
vonosmas wrote:

EXPECT_THAT(LIBC_NAMESPACE::getloadavg(), Succeeds(0)); - same below

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


More information about the libc-commits mailing list