[libc-commits] [libc] [libc] Add smoke tests for carg and cabs (PR #245546)
via libc-commits
libc-commits at lists.llvm.org
Tue Nov 24 00:58:06 PST 2026
https://github.com/jinge90 created https://github.com/llvm/llvm-project/pull/245546
None
>From 6622ec407b6e0968e5a9c5331c02534e151b27f3 Mon Sep 17 00:00:00 2001
From: jinge90 <ge.jin at intel.com>
Date: Tue, 24 Nov 2026 00:56:47 -0800
Subject: [PATCH] Add smoke tests for carg and cabs
Signed-off-by: jinge90 <ge.jin at intel.com>
---
libc/test/src/complex/CMakeLists.txt | 2 +
libc/test/src/complex/smoke/CMakeLists.txt | 49 ++++++++++++++++++++++
libc/test/src/complex/smoke/cabs_test.cpp | 13 ++++++
libc/test/src/complex/smoke/cabsf_test.cpp | 13 ++++++
libc/test/src/complex/smoke/carg_test.cpp | 13 ++++++
libc/test/src/complex/smoke/cargf_test.cpp | 13 ++++++
6 files changed, 103 insertions(+)
create mode 100644 libc/test/src/complex/smoke/CMakeLists.txt
create mode 100644 libc/test/src/complex/smoke/cabs_test.cpp
create mode 100644 libc/test/src/complex/smoke/cabsf_test.cpp
create mode 100644 libc/test/src/complex/smoke/carg_test.cpp
create mode 100644 libc/test/src/complex/smoke/cargf_test.cpp
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..b8169185485167
--- /dev/null
+++ b/libc/test/src/complex/smoke/cabs_test.cpp
@@ -0,0 +1,13 @@
+//===-- Unittests for cabs ------------------------------------------------===//
+//
+// 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 "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..e209f070239d5e
--- /dev/null
+++ b/libc/test/src/complex/smoke/cabsf_test.cpp
@@ -0,0 +1,13 @@
+//===-- Unittests for cabsf -----------------------------------------------===//
+//
+// 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 "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..ae98a1925a770e
--- /dev/null
+++ b/libc/test/src/complex/smoke/carg_test.cpp
@@ -0,0 +1,13 @@
+//===-- Unittests for carg ------------------------------------------------===//
+//
+// 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 "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..ec53991c7e5040
--- /dev/null
+++ b/libc/test/src/complex/smoke/cargf_test.cpp
@@ -0,0 +1,13 @@
+//===-- Unittests for cargf -----------------------------------------------===//
+//
+// 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 "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