[clang] [clang-tools-extra] [libc] [libc][c11] implement ctime (PR #107285)

Зишан Мирза via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 9 11:32:40 PDT 2024


================
@@ -0,0 +1,64 @@
+//===-- Unittests for ctime_r ---------------------------------------------===//
+//
+// 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/time/ctime_r.h"
+#include "src/time/time_utils.h"
+#include "test/UnitTest/Test.h"
+#include "test/src/time/TmHelper.h"
+
+using LIBC_NAMESPACE::time_utils::TimeConstants;
+
+// make libc.test.src.time.ctime_r_test
+static inline char *call_ctime_r(time_t *t, char *buffer) {
----------------
zimirza wrote:

I have now removed the helper functions in both tests.

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


More information about the cfe-commits mailing list