[libc-commits] [libc] 55e6280 - [libc] Add smoke tests for carg and cabs (#245546)
via libc-commits
libc-commits at lists.llvm.org
Tue Nov 24 21:11:42 PST 2026
Author: jinge90
Date: 2026-11-25T00:11:37-05:00
New Revision: 55e62807992ab107483745f2ebc43779269188be
URL: https://github.com/llvm/llvm-project/commit/55e62807992ab107483745f2ebc43779269188be
DIFF: https://github.com/llvm/llvm-project/commit/55e62807992ab107483745f2ebc43779269188be.diff
LOG: [libc] Add smoke tests for carg and cabs (#245546)
We added MPC tests for carg and cabs previously, this PR adds smoke
tests for them which doesn't depend on MPC.
---------
Signed-off-by: jinge90 <ge.jin at intel.com>
Added:
libc/test/src/complex/smoke/CMakeLists.txt
libc/test/src/complex/smoke/cabs_test.cpp
libc/test/src/complex/smoke/cabsf_test.cpp
libc/test/src/complex/smoke/carg_test.cpp
libc/test/src/complex/smoke/cargf_test.cpp
Modified:
libc/test/src/complex/CMakeLists.txt
Removed:
################################################################################
diff --git a/libc/test/src/complex/CMakeLists.txt b/libc/test/src/complex/CMakeLists.txt
index 3ecc54e2b2a353..5effe5fde13594 100644
--- a/libc/test/src/complex/CMakeLists.txt
+++ b/libc/test/src/complex/CMakeLists.txt
@@ -252,3 +252,5 @@ add_fp_unittest(
DEPENDS
libc.src.complex.cimagf128
)
+
+add_subdirectory(smoke)
diff --git a/libc/test/src/complex/smoke/CMakeLists.txt b/libc/test/src/complex/smoke/CMakeLists.txt
new file mode 100644
index 00000000000000..5d216bc99645cf
--- /dev/null
+++ b/libc/test/src/complex/smoke/CMakeLists.txt
@@ -0,0 +1,49 @@
+add_libc_testsuite(libc-complex-smoke-tests PARENT libc-complex-tests)
+
+add_fp_unittest(
+ cabs_test
+ SUITE
+ libc-complex-smoke-tests
+ SRCS
+ cabs_test.cpp
+ HDRS
+ ../CAbsTest.h
+ DEPENDS
+ libc.src.complex.cabs
+)
+
+add_fp_unittest(
+ cabsf_test
+ SUITE
+ libc-complex-smoke-tests
+ SRCS
+ cabsf_test.cpp
+ HDRS
+ ../CAbsTest.h
+ DEPENDS
+ libc.src.complex.cabsf
+)
+
+add_fp_unittest(
+ carg_test
+ SUITE
+ libc-complex-smoke-tests
+ SRCS
+ carg_test.cpp
+ HDRS
+ ../CArgTest.h
+ DEPENDS
+ libc.src.complex.carg
+)
+
+add_fp_unittest(
+ cargf_test
+ SUITE
+ libc-complex-smoke-tests
+ SRCS
+ cargf_test.cpp
+ HDRS
+ ../CArgTest.h
+ DEPENDS
+ libc.src.complex.cargf
+)
diff --git a/libc/test/src/complex/smoke/cabs_test.cpp b/libc/test/src/complex/smoke/cabs_test.cpp
new file mode 100644
index 00000000000000..f5774bff319b7e
--- /dev/null
+++ b/libc/test/src/complex/smoke/cabs_test.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+/// This file contains unit tests for cabs.
+///
+//===----------------------------------------------------------------------===//
+
+#include "test/src/complex/CAbsTest.h"
+
+#include "src/complex/cabs.h"
+
+LIST_CABS_TESTS(_Complex double, double, LIBC_NAMESPACE::cabs)
diff --git a/libc/test/src/complex/smoke/cabsf_test.cpp b/libc/test/src/complex/smoke/cabsf_test.cpp
new file mode 100644
index 00000000000000..2d743ea770cb98
--- /dev/null
+++ b/libc/test/src/complex/smoke/cabsf_test.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+/// This file contains unit tests for cabsf.
+///
+//===----------------------------------------------------------------------===//
+
+#include "test/src/complex/CAbsTest.h"
+
+#include "src/complex/cabsf.h"
+
+LIST_CABS_TESTS(_Complex float, float, LIBC_NAMESPACE::cabsf)
diff --git a/libc/test/src/complex/smoke/carg_test.cpp b/libc/test/src/complex/smoke/carg_test.cpp
new file mode 100644
index 00000000000000..f55405014ff6d3
--- /dev/null
+++ b/libc/test/src/complex/smoke/carg_test.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+/// This file contains unit tests for carg.
+///
+//===----------------------------------------------------------------------===//
+
+#include "test/src/complex/CArgTest.h"
+
+#include "src/complex/carg.h"
+
+LIST_CARG_TESTS(_Complex double, double, LIBC_NAMESPACE::carg)
diff --git a/libc/test/src/complex/smoke/cargf_test.cpp b/libc/test/src/complex/smoke/cargf_test.cpp
new file mode 100644
index 00000000000000..b1b37ac6d0bf60
--- /dev/null
+++ b/libc/test/src/complex/smoke/cargf_test.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+/// This file contains unit tests for cargf.
+///
+//===----------------------------------------------------------------------===//
+
+#include "test/src/complex/CArgTest.h"
+
+#include "src/complex/cargf.h"
+
+LIST_CARG_TESTS(_Complex float, float, LIBC_NAMESPACE::cargf)
More information about the libc-commits
mailing list