[libc-commits] [libc] [libc] Implement entrypoint and test of iswupper function (PR #185215)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Mon Mar 9 10:25:07 PDT 2026
================
@@ -0,0 +1,54 @@
+//===-- Unittests for iswupper --------------------------------------------===//
+//
+// 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/__support/CPP/span.h"
+#include "src/wctype/iswupper.h"
+
+#include "test/UnitTest/Test.h"
+
+TEST(LlvmLibciswupper, SimpleTest) {
+ EXPECT_NE(LIBC_NAMESPACE::iswupper('B'), 0);
+
+ EXPECT_EQ(LIBC_NAMESPACE::iswupper('a'), 0);
+ EXPECT_EQ(LIBC_NAMESPACE::iswupper('3'), 0);
+ EXPECT_EQ(LIBC_NAMESPACE::iswupper(' '), 0);
+ EXPECT_EQ(LIBC_NAMESPACE::iswupper('?'), 0);
+ EXPECT_EQ(LIBC_NAMESPACE::iswupper('\0'), 0);
+ EXPECT_EQ(LIBC_NAMESPACE::iswupper(-1), 0);
+}
+
+// TODO: once iswupper supports more than just ascii-range characters add a
----------------
michaelrj-google wrote:
iswupper does support more than the ascii range. Currently the tests for the extended range are in https://github.com/llvm/llvm-project/blob/main/libc/test/src/__support/wctype_utils_test.cpp. I'd recommend changing this comment to point to there.
https://github.com/llvm/llvm-project/pull/185215
More information about the libc-commits
mailing list