[libc-commits] [libc] [libc][POSIX][poll.h] implement poll (PR #125118)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Thu Jan 30 13:34:58 PST 2025
================
@@ -0,0 +1,18 @@
+//===-- Unittests for poll ------------------------------------------------===//
+//
+// 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 "src/errno/libc_errno.h"
+#include "src/poll/poll.h"
+#include "test/UnitTest/Test.h"
+
+TEST(LlvmLibcPollTest, SmokeTest) {
+ LIBC_NAMESPACE::libc_errno = 0;
+ int ret = LIBC_NAMESPACE::poll(nullptr, 0, 0);
----------------
michaelrj-google wrote:
ideally there'd also be a test that fails, to make sure both branches are exercised.
https://github.com/llvm/llvm-project/pull/125118
More information about the libc-commits
mailing list