aboutsummaryrefslogtreecommitdiff
path: root/libc/test
diff options
context:
space:
mode:
Diffstat (limited to 'libc/test')
-rw-r--r--libc/test/include/CMakeLists.txt10
-rw-r--r--libc/test/include/netinet_in_test.cpp19
-rw-r--r--libc/test/shared/CMakeLists.txt2
-rw-r--r--libc/test/shared/shared_math_test.cpp2
4 files changed, 33 insertions, 0 deletions
diff --git a/libc/test/include/CMakeLists.txt b/libc/test/include/CMakeLists.txt
index 11e4c3a..3ac5615 100644
--- a/libc/test/include/CMakeLists.txt
+++ b/libc/test/include/CMakeLists.txt
@@ -208,6 +208,16 @@ add_libc_test(
)
add_libc_test(
+ netinet_in_test
+ SUITE
+ libc_include_tests
+ SRCS
+ netinet_in_test.cpp
+ DEPENDS
+ libc.include.llvm-libc-macros.netinet_in_macros
+)
+
+add_libc_test(
signbit_test
SUITE
libc_include_tests
diff --git a/libc/test/include/netinet_in_test.cpp b/libc/test/include/netinet_in_test.cpp
new file mode 100644
index 0000000..a6c47a7
--- /dev/null
+++ b/libc/test/include/netinet_in_test.cpp
@@ -0,0 +1,19 @@
+//===-- Unittests for netinet/in macro ------------------------------------===//
+//
+// 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 "include/llvm-libc-macros/netinet-in-macros.h"
+#include "test/UnitTest/Test.h"
+
+TEST(LlvmLibcNetinetInTest, IPPROTOMacro) {
+ EXPECT_EQ(IPPROTO_IP, 0);
+ EXPECT_EQ(IPPROTO_ICMP, 1);
+ EXPECT_EQ(IPPROTO_TCP, 6);
+ EXPECT_EQ(IPPROTO_UDP, 17);
+ EXPECT_EQ(IPPROTO_IPV6, 41);
+ EXPECT_EQ(IPPROTO_RAW, 255);
+}
diff --git a/libc/test/shared/CMakeLists.txt b/libc/test/shared/CMakeLists.txt
index ea4634c..dbc3889c 100644
--- a/libc/test/shared/CMakeLists.txt
+++ b/libc/test/shared/CMakeLists.txt
@@ -40,6 +40,8 @@ add_fp_unittest(
libc.src.__support.math.exp10m1f16
libc.src.__support.math.erff
libc.src.__support.math.exp
+ libc.src.__support.math.exp2
+ libc.src.__support.math.exp2f
libc.src.__support.math.exp10
libc.src.__support.math.exp10f
libc.src.__support.math.exp10f16
diff --git a/libc/test/shared/shared_math_test.cpp b/libc/test/shared/shared_math_test.cpp
index 1722193..d118d96 100644
--- a/libc/test/shared/shared_math_test.cpp
+++ b/libc/test/shared/shared_math_test.cpp
@@ -62,6 +62,7 @@ TEST(LlvmLibcSharedMathTest, AllFloat) {
EXPECT_FP_EQ(0x0p+0f, LIBC_NAMESPACE::shared::erff(0.0f));
EXPECT_FP_EQ(0x1p+0f, LIBC_NAMESPACE::shared::exp10f(0.0f));
EXPECT_FP_EQ(0x1p+0f, LIBC_NAMESPACE::shared::expf(0.0f));
+ EXPECT_FP_EQ(0x1p+0f, LIBC_NAMESPACE::shared::exp2f(0.0f));
EXPECT_FP_EQ_ALL_ROUNDING(0.75f,
LIBC_NAMESPACE::shared::frexpf(24.0f, &exponent));
@@ -80,6 +81,7 @@ TEST(LlvmLibcSharedMathTest, AllDouble) {
EXPECT_FP_EQ(0x1p+0, LIBC_NAMESPACE::shared::cos(0.0));
EXPECT_FP_EQ(0x0p+0, LIBC_NAMESPACE::shared::dsqrtl(0.0));
EXPECT_FP_EQ(0x1p+0, LIBC_NAMESPACE::shared::exp(0.0));
+ EXPECT_FP_EQ(0x1p+0, LIBC_NAMESPACE::shared::exp2(0.0));
EXPECT_FP_EQ(0x1p+0, LIBC_NAMESPACE::shared::exp10(0.0));
}