[libcxx-commits] [libcxx] dafeb97 - [libc++] Refactor the std/depr C headers tests
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Mar 1 11:55:19 PST 2023
Author: Louis Dionne
Date: 2023-03-01T14:55:05-05:00
New Revision: dafeb97a28467ce90f4eb72f9f00f0cfa1b404b0
URL: https://github.com/llvm/llvm-project/commit/dafeb97a28467ce90f4eb72f9f00f0cfa1b404b0
DIFF: https://github.com/llvm/llvm-project/commit/dafeb97a28467ce90f4eb72f9f00f0cfa1b404b0.diff
LOG: [libc++] Refactor the std/depr C headers tests
Move multiple tests to .compile.pass.cpp when they were not running
anything and reindent a bit more consistently.
Added:
libcxx/test/std/depr/depr.c.headers/ciso646.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/complex_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/errno_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/float_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/iso646_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/limits_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/locale_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/stdarg_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/stdbool_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/time_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/wchar_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/wctype_h.compile.pass.cpp
Modified:
libcxx/test/std/depr/depr.c.headers/assert_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/ctype_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/stddef_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/tgmath_h.pass.cpp
Removed:
libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp
libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
libcxx/test/std/depr/depr.c.headers/errno_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/fenv_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/iso646_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/limits_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/setjmp_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/stdbool_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp
################################################################################
diff --git a/libcxx/test/std/depr/depr.c.headers/assert_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/assert_h.pass.cpp
index 364e931dc8924..8d1b8834c1769 100644
--- a/libcxx/test/std/depr/depr.c.headers/assert_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/assert_h.pass.cpp
@@ -10,14 +10,12 @@
#include <assert.h>
-#include "test_macros.h"
-
#ifndef assert
#error assert not defined
#endif
-int main(int, char**)
-{
+int main(int, char**) {
+ assert(true);
return 0;
}
diff --git a/libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp b/libcxx/test/std/depr/depr.c.headers/ciso646.compile.pass.cpp
similarity index 85%
rename from libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/ciso646.compile.pass.cpp
index b619499a5dee7..4dff57f84f202 100644
--- a/libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/ciso646.compile.pass.cpp
@@ -9,11 +9,3 @@
// <ciso646>
#include <ciso646>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/complex_h.compile.pass.cpp
similarity index 79%
rename from libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/complex_h.compile.pass.cpp
index 92dc58c2df0cf..00118a6fb6898 100644
--- a/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/complex_h.compile.pass.cpp
@@ -10,12 +10,4 @@
#include <complex.h>
-#include "test_macros.h"
-
-int main(int, char**)
-{
- std::complex<double> d;
- (void)d;
-
- return 0;
-}
+std::complex<double> d;
diff --git a/libcxx/test/std/depr/depr.c.headers/ctype_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/ctype_h.pass.cpp
index b5deeee7ae215..94bff2e1d8ef0 100644
--- a/libcxx/test/std/depr/depr.c.headers/ctype_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/ctype_h.pass.cpp
@@ -12,8 +12,6 @@
#include <type_traits>
#include <cassert>
-#include "test_macros.h"
-
#ifdef isalnum
#error isalnum defined
#endif
@@ -70,37 +68,36 @@
#error toupper defined
#endif
-int main(int, char**)
-{
- static_assert((std::is_same<decltype(isalnum(0)), int>::value), "");
- static_assert((std::is_same<decltype(isalpha(0)), int>::value), "");
- static_assert((std::is_same<decltype(isblank(0)), int>::value), "");
- static_assert((std::is_same<decltype(iscntrl(0)), int>::value), "");
- static_assert((std::is_same<decltype(isdigit(0)), int>::value), "");
- static_assert((std::is_same<decltype(isgraph(0)), int>::value), "");
- static_assert((std::is_same<decltype(islower(0)), int>::value), "");
- static_assert((std::is_same<decltype(isprint(0)), int>::value), "");
- static_assert((std::is_same<decltype(ispunct(0)), int>::value), "");
- static_assert((std::is_same<decltype(isspace(0)), int>::value), "");
- static_assert((std::is_same<decltype(isupper(0)), int>::value), "");
- static_assert((std::is_same<decltype(isxdigit(0)), int>::value), "");
- static_assert((std::is_same<decltype(tolower(0)), int>::value), "");
- static_assert((std::is_same<decltype(toupper(0)), int>::value), "");
-
- assert(isalnum('a'));
- assert(isalpha('a'));
- assert(isblank(' '));
- assert(!iscntrl(' '));
- assert(!isdigit('a'));
- assert(isgraph('a'));
- assert(islower('a'));
- assert(isprint('a'));
- assert(!ispunct('a'));
- assert(!isspace('a'));
- assert(!isupper('a'));
- assert(isxdigit('a'));
- assert(tolower('A') == 'a');
- assert(toupper('a') == 'A');
+int main(int, char**) {
+ static_assert(std::is_same<decltype(isalnum(0)), int>::value, "");
+ static_assert(std::is_same<decltype(isalpha(0)), int>::value, "");
+ static_assert(std::is_same<decltype(isblank(0)), int>::value, "");
+ static_assert(std::is_same<decltype(iscntrl(0)), int>::value, "");
+ static_assert(std::is_same<decltype(isdigit(0)), int>::value, "");
+ static_assert(std::is_same<decltype(isgraph(0)), int>::value, "");
+ static_assert(std::is_same<decltype(islower(0)), int>::value, "");
+ static_assert(std::is_same<decltype(isprint(0)), int>::value, "");
+ static_assert(std::is_same<decltype(ispunct(0)), int>::value, "");
+ static_assert(std::is_same<decltype(isspace(0)), int>::value, "");
+ static_assert(std::is_same<decltype(isupper(0)), int>::value, "");
+ static_assert(std::is_same<decltype(isxdigit(0)), int>::value, "");
+ static_assert(std::is_same<decltype(tolower(0)), int>::value, "");
+ static_assert(std::is_same<decltype(toupper(0)), int>::value, "");
+
+ assert(isalnum('a'));
+ assert(isalpha('a'));
+ assert(isblank(' '));
+ assert(!iscntrl(' '));
+ assert(!isdigit('a'));
+ assert(isgraph('a'));
+ assert(islower('a'));
+ assert(isprint('a'));
+ assert(!ispunct('a'));
+ assert(!isspace('a'));
+ assert(!isupper('a'));
+ assert(isxdigit('a'));
+ assert(tolower('A') == 'a');
+ assert(toupper('a') == 'A');
return 0;
}
diff --git a/libcxx/test/std/depr/depr.c.headers/errno_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/errno_h.compile.pass.cpp
similarity index 90%
rename from libcxx/test/std/depr/depr.c.headers/errno_h.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/errno_h.compile.pass.cpp
index faa2c82ab7584..c2cc69ecd90b5 100644
--- a/libcxx/test/std/depr/depr.c.headers/errno_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/errno_h.compile.pass.cpp
@@ -10,8 +10,6 @@
#include <errno.h>
-#include "test_macros.h"
-
#ifndef EDOM
#error EDOM not defined
#endif
@@ -27,9 +25,3 @@
#ifndef errno
#error errno not defined
#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/libcxx/test/std/depr/depr.c.headers/fenv_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp
similarity index 51%
rename from libcxx/test/std/depr/depr.c.headers/fenv_h.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp
index 28985391dbea3..da030e1283500 100644
--- a/libcxx/test/std/depr/depr.c.headers/fenv_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp
@@ -11,8 +11,6 @@
#include <fenv.h>
#include <type_traits>
-#include "test_macros.h"
-
#ifndef FE_DIVBYZERO
#error FE_DIVBYZERO not defined
#endif
@@ -57,21 +55,16 @@
#error FE_DFL_ENV not defined
#endif
-int main(int, char**)
-{
- fenv_t fenv = {};
- fexcept_t fex = 0;
- static_assert((std::is_same<decltype(::feclearexcept(0)), int>::value), "");
- static_assert((std::is_same<decltype(::fegetexceptflag(&fex, 0)), int>::value), "");
- static_assert((std::is_same<decltype(::feraiseexcept(0)), int>::value), "");
- static_assert((std::is_same<decltype(::fesetexceptflag(&fex, 0)), int>::value), "");
- static_assert((std::is_same<decltype(::fetestexcept(0)), int>::value), "");
- static_assert((std::is_same<decltype(::fegetround()), int>::value), "");
- static_assert((std::is_same<decltype(::fesetround(0)), int>::value), "");
- static_assert((std::is_same<decltype(::fegetenv(&fenv)), int>::value), "");
- static_assert((std::is_same<decltype(::feholdexcept(&fenv)), int>::value), "");
- static_assert((std::is_same<decltype(::fesetenv(&fenv)), int>::value), "");
- static_assert((std::is_same<decltype(::feupdateenv(&fenv)), int>::value), "");
-
- return 0;
-}
+fenv_t fenv = {};
+fexcept_t fex = 0;
+static_assert(std::is_same<decltype(::feclearexcept(0)), int>::value, "");
+static_assert(std::is_same<decltype(::fegetexceptflag(&fex, 0)), int>::value, "");
+static_assert(std::is_same<decltype(::feraiseexcept(0)), int>::value, "");
+static_assert(std::is_same<decltype(::fesetexceptflag(&fex, 0)), int>::value, "");
+static_assert(std::is_same<decltype(::fetestexcept(0)), int>::value, "");
+static_assert(std::is_same<decltype(::fegetround()), int>::value, "");
+static_assert(std::is_same<decltype(::fesetround(0)), int>::value, "");
+static_assert(std::is_same<decltype(::fegetenv(&fenv)), int>::value, "");
+static_assert(std::is_same<decltype(::feholdexcept(&fenv)), int>::value, "");
+static_assert(std::is_same<decltype(::fesetenv(&fenv)), int>::value, "");
+static_assert(std::is_same<decltype(::feupdateenv(&fenv)), int>::value, "");
diff --git a/libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/float_h.compile.pass.cpp
similarity index 98%
rename from libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/float_h.compile.pass.cpp
index b3f42303e8814..8a02934350f45 100644
--- a/libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/float_h.compile.pass.cpp
@@ -177,9 +177,3 @@
#error LDBL_TRUE_MIN not defined
#endif
#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
index b9f9a585ed8d3..dc47114b620da 100644
--- a/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
@@ -873,14 +873,13 @@
#error SCNxPTR not defined
#endif
-template <class T> void test()
-{
+template <class T>
+void test() {
T t = 0;
((void)t); // Prevent unused warning
}
-int main(int, char**)
-{
+int main(int, char**) {
test<int8_t >();
test<int16_t>();
test<int32_t>();
@@ -917,8 +916,8 @@ int main(int, char**)
test<uintmax_t>();
{
- imaxdiv_t i1 = {};
- ((void)i1); // Prevent unused warning
+ imaxdiv_t i1 = {};
+ ((void)i1); // Prevent unused warning
}
intmax_t i = 0;
@@ -932,5 +931,5 @@ int main(int, char**)
static_assert((std::is_same<decltype(wcstoumax(L"", (wchar_t**)0, 0)), uintmax_t>::value), "");
#endif
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/depr/depr.c.headers/iso646_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/iso646_h.compile.pass.cpp
similarity index 81%
rename from libcxx/test/std/depr/depr.c.headers/iso646_h.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/iso646_h.compile.pass.cpp
index 61510feb3c066..4531ce36e2544 100644
--- a/libcxx/test/std/depr/depr.c.headers/iso646_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/iso646_h.compile.pass.cpp
@@ -9,12 +9,3 @@
// <iso646.h>
#include <iso646.h>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- // Nothing to test
-
- return 0;
-}
diff --git a/libcxx/test/std/depr/depr.c.headers/limits_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/limits_h.compile.pass.cpp
similarity index 95%
rename from libcxx/test/std/depr/depr.c.headers/limits_h.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/limits_h.compile.pass.cpp
index bd0c7b9e0f535..4738cc4028cf9 100644
--- a/libcxx/test/std/depr/depr.c.headers/limits_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/limits_h.compile.pass.cpp
@@ -10,8 +10,6 @@
#include <limits.h>
-#include "test_macros.h"
-
#ifndef CHAR_BIT
#error CHAR_BIT not defined
#endif
@@ -87,9 +85,3 @@
#ifndef ULLONG_MAX
#error ULLONG_MAX not defined
#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/locale_h.compile.pass.cpp
similarity index 76%
rename from libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/locale_h.compile.pass.cpp
index 9848f07a6d0d8..5b87cf29fcdc5 100644
--- a/libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/locale_h.compile.pass.cpp
@@ -13,8 +13,6 @@
#include <locale.h>
#include <type_traits>
-#include "test_macros.h"
-
#ifndef LC_ALL
#error LC_ALL not defined
#endif
@@ -43,11 +41,6 @@
#error NULL not defined
#endif
-int main(int, char**)
-{
- lconv lc; ((void)lc);
- static_assert((std::is_same<decltype(setlocale(0, "")), char*>::value), "");
- static_assert((std::is_same<decltype(localeconv()), lconv*>::value), "");
-
- return 0;
-}
+lconv lc;
+static_assert((std::is_same<decltype(setlocale(0, "")), char*>::value), "");
+static_assert((std::is_same<decltype(localeconv()), lconv*>::value), "");
diff --git a/libcxx/test/std/depr/depr.c.headers/setjmp_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
similarity index 64%
rename from libcxx/test/std/depr/depr.c.headers/setjmp_h.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
index 3c938012bdf53..c8d50be3b414f 100644
--- a/libcxx/test/std/depr/depr.c.headers/setjmp_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
@@ -11,18 +11,9 @@
#include <setjmp.h>
#include <type_traits>
-#include "test_macros.h"
-
#ifndef setjmp
#error setjmp not defined
#endif
-int main(int, char**)
-{
- jmp_buf jb;
- ((void)jb); // Prevent unused warning
- static_assert((std::is_same<decltype(longjmp(jb, 0)), void>::value),
- "std::is_same<decltype(longjmp(jb, 0)), void>::value");
-
- return 0;
-}
+jmp_buf jb;
+static_assert(std::is_same<decltype(longjmp(jb, 0)), void>::value, "");
diff --git a/libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp
similarity index 75%
rename from libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp
index 07a729eee69d4..9b18e768e8275 100644
--- a/libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp
@@ -11,8 +11,6 @@
#include <signal.h>
#include <type_traits>
-#include "test_macros.h"
-
#ifndef SIG_DFL
#error SIG_DFL not defined
#endif
@@ -49,12 +47,7 @@
#error SIGTERM not defined
#endif
-int main(int, char**)
-{
- sig_atomic_t sig; ((void)sig);
- typedef void (*func)(int);
- static_assert((std::is_same<decltype(signal(0, (func)0)), func>::value), "");
- static_assert((std::is_same<decltype(raise(0)), int>::value), "");
-
- return 0;
-}
+sig_atomic_t sig;
+typedef void (*func)(int);
+static_assert((std::is_same<decltype(signal(0, (func)0)), func>::value), "");
+static_assert((std::is_same<decltype(raise(0)), int>::value), "");
diff --git a/libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdarg_h.compile.pass.cpp
similarity index 90%
rename from libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/stdarg_h.compile.pass.cpp
index feb9c4a460f38..8ded0f9f987d4 100644
--- a/libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stdarg_h.compile.pass.cpp
@@ -30,10 +30,4 @@
#error va_start not defined
#endif
-int main(int, char**)
-{
- va_list va;
- ((void)va);
-
- return 0;
-}
+va_list va;
diff --git a/libcxx/test/std/depr/depr.c.headers/stdbool_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdbool_h.compile.pass.cpp
similarity index 91%
rename from libcxx/test/std/depr/depr.c.headers/stdbool_h.pass.cpp
rename to libcxx/test/std/depr/depr.c.headers/stdbool_h.compile.pass.cpp
index ca580a8db8e99..79d8b51b8f990 100644
--- a/libcxx/test/std/depr/depr.c.headers/stdbool_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stdbool_h.compile.pass.cpp
@@ -10,8 +10,6 @@
#include <stdbool.h>
-#include "test_macros.h"
-
#ifndef __bool_true_false_are_defined
#error __bool_true_false_are_defined not defined
#endif
@@ -27,9 +25,3 @@
#ifdef false
#error false should not be defined
#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/libcxx/test/std/depr/depr.c.headers/stddef_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stddef_h.pass.cpp
index 1fe48b5e0a08d..43db797d2f5ee 100644
--- a/libcxx/test/std/depr/depr.c.headers/stddef_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stddef_h.pass.cpp
@@ -22,8 +22,7 @@
#error offsetof not defined
#endif
-int main(int, char**)
-{
+int main(int, char**) {
void *p = NULL;
assert(!p);
@@ -68,5 +67,5 @@ int main(int, char**)
"std::alignment_of<void*>::value");
#endif
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp
index 37945eea6c40a..9a5faadbb8fd3 100644
--- a/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp
@@ -22,8 +22,7 @@
# include <cwctype>
#endif
-int main(int, char**)
-{
+int main(int, char**) {
// typedef int8_t
static_assert(sizeof(int8_t)*CHAR_BIT == 8,
"sizeof(int8_t)*CHAR_BIT == 8");
@@ -295,5 +294,5 @@ int main(int, char**)
#error UINTMAX_C not defined
#endif
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
index effb633b596aa..293b0944a9928 100644
--- a/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
@@ -101,8 +101,7 @@
TEST_CLANG_DIAGNOSTIC_IGNORED("-Wformat-zero-length")
TEST_GCC_DIAGNOSTIC_IGNORED("-Wformat-zero-length")
-int main(int, char**)
-{
+int main(int, char**) {
FILE* fp = 0;
fpos_t fpos = fpos_t();
size_t s = 0;
@@ -184,5 +183,5 @@ int main(int, char**)
static_assert((std::is_same<decltype(ferror(fp)), int>::value), "");
static_assert((std::is_same<decltype(perror("")), void>::value), "");
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
index 9d60f941b6412..3fd615d9c7708 100644
--- a/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
@@ -100,8 +100,7 @@ void test_abs() {
assert(abs(-1.) == 1);
}
-int main(int, char**)
-{
+int main(int, char**) {
size_t s = 0; ((void)s);
div_t d; ((void)d);
ldiv_t ld; ((void)ld);
diff --git a/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp
index 5ccccd43af8ba..068aa1915e4fc 100644
--- a/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp
@@ -18,8 +18,7 @@
#error NULL not defined
#endif
-int main(int, char**)
-{
+int main(int, char**) {
// Functions we get directly from the C library (just check the signature)
{
size_t s = 0;
diff --git a/libcxx/test/std/depr/depr.c.headers/tgmath_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/tgmath_h.pass.cpp
index 88e42fb3fefda..e29c1a742e74a 100644
--- a/libcxx/test/std/depr/depr.c.headers/tgmath_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/tgmath_h.pass.cpp
@@ -10,14 +10,11 @@
#include <tgmath.h>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+int main(int, char**) {
std::complex<double> cd;
(void)cd;
double x = sin(1.0);
(void)x; // to placate scan-build
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/depr/depr.c.headers/time_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/time_h.compile.pass.cpp
new file mode 100644
index 0000000000000..724991106770d
--- /dev/null
+++ b/libcxx/test/std/depr/depr.c.headers/time_h.compile.pass.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// test <time.h>
+
+#include <time.h>
+#include <type_traits>
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef CLOCKS_PER_SEC
+#error CLOCKS_PER_SEC not defined
+#endif
+
+clock_t c = 0;
+size_t s = 0;
+time_t t = 0;
+tm tmv = {};
+static_assert((std::is_same<decltype(clock()), clock_t>::value), "");
+static_assert((std::is_same<decltype(
diff time(t,t)), double>::value), "");
+static_assert((std::is_same<decltype(mktime(&tmv)), time_t>::value), "");
+static_assert((std::is_same<decltype(time(&t)), time_t>::value), "");
+static_assert((std::is_same<decltype(asctime(&tmv)), char*>::value), "");
+static_assert((std::is_same<decltype(ctime(&t)), char*>::value), "");
+static_assert((std::is_same<decltype(gmtime(&t)), tm*>::value), "");
+static_assert((std::is_same<decltype(localtime(&t)), tm*>::value), "");
+char* c1 = 0;
+const char* c2 = 0;
+static_assert((std::is_same<decltype(strftime(c1,s,c2,&tmv)), size_t>::value), "");
diff --git a/libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp
deleted file mode 100644
index 31aff19c535f0..0000000000000
--- a/libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// test <time.h>
-
-#include <time.h>
-#include <type_traits>
-
-#include "test_macros.h"
-
-#ifndef NULL
-#error NULL not defined
-#endif
-
-#ifndef CLOCKS_PER_SEC
-#error CLOCKS_PER_SEC not defined
-#endif
-
-int main(int, char**)
-{
- clock_t c = 0; ((void)c);
- size_t s = 0;
- time_t t = 0;
- tm tmv = {};
- static_assert((std::is_same<decltype(clock()), clock_t>::value), "");
- static_assert((std::is_same<decltype(
diff time(t,t)), double>::value), "");
- static_assert((std::is_same<decltype(mktime(&tmv)), time_t>::value), "");
- static_assert((std::is_same<decltype(time(&t)), time_t>::value), "");
- static_assert((std::is_same<decltype(asctime(&tmv)), char*>::value), "");
- static_assert((std::is_same<decltype(ctime(&t)), char*>::value), "");
- static_assert((std::is_same<decltype(gmtime(&t)), tm*>::value), "");
- static_assert((std::is_same<decltype(localtime(&t)), tm*>::value), "");
- char* c1 = 0;
- const char* c2 = 0;
- static_assert((std::is_same<decltype(strftime(c1,s,c2,&tmv)), size_t>::value), "");
-
- return 0;
-}
diff --git a/libcxx/test/std/depr/depr.c.headers/wchar_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/wchar_h.compile.pass.cpp
new file mode 100644
index 0000000000000..ae08ebd6ad821
--- /dev/null
+++ b/libcxx/test/std/depr/depr.c.headers/wchar_h.compile.pass.cpp
@@ -0,0 +1,114 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL: no-wide-characters
+
+// <wchar.h>
+
+#include <wchar.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <type_traits>
+
+#include "test_macros.h"
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef WCHAR_MAX
+#error WCHAR_MAX not defined
+#endif
+
+#ifndef WCHAR_MIN
+#error WCHAR_MIN not defined
+#endif
+
+#ifndef WEOF
+#error WEOF not defined
+#endif
+
+// mbstate_t comes from the underlying C library; it is defined (in C99) as:
+// a complete object type other than an array type that can hold the conversion
+// state information necessary to convert between sequences of multibyte
+// characters and wide characters
+mbstate_t mb = {};
+size_t s = 0;
+tm *tm = 0;
+wint_t w = 0;
+::FILE* fp = 0;
+::va_list va;
+char* ns = 0;
+wchar_t* ws = 0;
+const wchar_t* cws = 0;
+wchar_t** wsp = 0;
+
+ASSERT_SAME_TYPE(int, decltype(fwprintf(fp, L"")));
+ASSERT_SAME_TYPE(int, decltype(fwscanf(fp, L"")));
+ASSERT_SAME_TYPE(int, decltype(swprintf(ws, s, L"")));
+ASSERT_SAME_TYPE(int, decltype(swscanf(L"", L"")));
+ASSERT_SAME_TYPE(int, decltype(vfwprintf(fp, L"", va)));
+ASSERT_SAME_TYPE(int, decltype(vfwscanf(fp, L"", va)));
+ASSERT_SAME_TYPE(int, decltype(vswprintf(ws, s, L"", va)));
+ASSERT_SAME_TYPE(int, decltype(vswscanf(L"", L"", va)));
+ASSERT_SAME_TYPE(wint_t, decltype(fgetwc(fp)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(fgetws(ws, 0, fp)));
+ASSERT_SAME_TYPE(wint_t, decltype(fputwc(L' ', fp)));
+ASSERT_SAME_TYPE(int, decltype(fputws(L"", fp)));
+ASSERT_SAME_TYPE(int, decltype(fwide(fp, 0)));
+ASSERT_SAME_TYPE(wint_t, decltype(getwc(fp)));
+ASSERT_SAME_TYPE(wint_t, decltype(putwc(L' ', fp)));
+ASSERT_SAME_TYPE(wint_t, decltype(ungetwc(L' ', fp)));
+ASSERT_SAME_TYPE(double, decltype(wcstod(L"", wsp)));
+ASSERT_SAME_TYPE(float, decltype(wcstof(L"", wsp)));
+ASSERT_SAME_TYPE(long double, decltype(wcstold(L"", wsp)));
+ASSERT_SAME_TYPE(long, decltype(wcstol(L"", wsp, 0)));
+ASSERT_SAME_TYPE(long long, decltype(wcstoll(L"", wsp, 0)));
+ASSERT_SAME_TYPE(unsigned long, decltype(wcstoul(L"", wsp, 0)));
+ASSERT_SAME_TYPE(unsigned long long, decltype(wcstoull(L"", wsp, 0)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcscpy(ws, L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcsncpy(ws, L"", s)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcscat(ws, L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcsncat(ws, L"", s)));
+ASSERT_SAME_TYPE(int, decltype(wcscmp(L"", L"")));
+ASSERT_SAME_TYPE(int, decltype(wcscoll(L"", L"")));
+ASSERT_SAME_TYPE(int, decltype(wcsncmp(L"", L"", s)));
+ASSERT_SAME_TYPE(size_t, decltype(wcsxfrm(ws, L"", s)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcschr(ws, L' ')));
+ASSERT_SAME_TYPE(const wchar_t*, decltype(wcschr(cws, L' ')));
+ASSERT_SAME_TYPE(size_t, decltype(wcscspn(L"", L"")));
+ASSERT_SAME_TYPE(size_t, decltype(wcslen(L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcspbrk(ws, L"")));
+ASSERT_SAME_TYPE(const wchar_t*, decltype(wcspbrk(cws, L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcsrchr(ws, L' ')));
+ASSERT_SAME_TYPE(const wchar_t*, decltype(wcsrchr(cws, L' ')));
+ASSERT_SAME_TYPE(size_t, decltype(wcsspn(L"", L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcsstr(ws, L"")));
+ASSERT_SAME_TYPE(const wchar_t*, decltype(wcsstr(cws, L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcstok(ws, L"", wsp)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wmemchr(ws, L' ', s)));
+ASSERT_SAME_TYPE(const wchar_t*, decltype(wmemchr(cws, L' ', s)));
+ASSERT_SAME_TYPE(int, decltype(wmemcmp(L"", L"", s)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wmemcpy(ws, L"", s)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wmemmove(ws, L"", s)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wmemset(ws, L' ', s)));
+ASSERT_SAME_TYPE(size_t, decltype(wcsftime(ws, s, L"", tm)));
+ASSERT_SAME_TYPE(wint_t, decltype(btowc(0)));
+ASSERT_SAME_TYPE(int, decltype(wctob(w)));
+ASSERT_SAME_TYPE(int, decltype(mbsinit(&mb)));
+ASSERT_SAME_TYPE(size_t, decltype(mbrlen("", s, &mb)));
+ASSERT_SAME_TYPE(size_t, decltype(mbrtowc(ws, "", s, &mb)));
+ASSERT_SAME_TYPE(size_t, decltype(wcrtomb(ns, L' ', &mb)));
+ASSERT_SAME_TYPE(size_t, decltype(mbsrtowcs(ws, (const char**)0, s, &mb)));
+ASSERT_SAME_TYPE(size_t, decltype(wcsrtombs(ns, (const wchar_t**)0, s, &mb)));
+ASSERT_SAME_TYPE(wint_t, decltype(getwchar()));
+ASSERT_SAME_TYPE(int, decltype(vwscanf(L"", va)));
+ASSERT_SAME_TYPE(int, decltype(wscanf(L"")));
+ASSERT_SAME_TYPE(wint_t, decltype(putwchar(L' ')));
+ASSERT_SAME_TYPE(int, decltype(vwprintf(L"", va)));
+ASSERT_SAME_TYPE(int, decltype(wprintf(L"")));
diff --git a/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
deleted file mode 100644
index 78716da2cbd67..0000000000000
--- a/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// XFAIL: no-wide-characters
-
-// <wchar.h>
-
-#include <wchar.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <type_traits>
-
-#include "test_macros.h"
-
-#ifndef NULL
-#error NULL not defined
-#endif
-
-#ifndef WCHAR_MAX
-#error WCHAR_MAX not defined
-#endif
-
-#ifndef WCHAR_MIN
-#error WCHAR_MIN not defined
-#endif
-
-#ifndef WEOF
-#error WEOF not defined
-#endif
-
-int main(int, char**)
-{
-// mbstate_t comes from the underlying C library; it is defined (in C99) as:
-// a complete object type other than an array type that can hold the conversion
-// state information necessary to convert between sequences of multibyte
-// characters and wide characters
- mbstate_t mb = {};
- size_t s = 0;
- tm *tm = 0;
- wint_t w = 0;
- ::FILE* fp = 0;
- ::va_list va;
- char* ns = 0;
- wchar_t* ws = 0;
- const wchar_t* cws = 0;
- wchar_t** wsp = 0;
- ((void)mb); // Prevent unused warning
- ((void)s); // Prevent unused warning
- ((void)tm); // Prevent unused warning
- ((void)w); // Prevent unused warning
- ((void)fp); // Prevent unused warning
- ((void)va); // Prevent unused warning
- ((void)ns); // Prevent unused warning
- ((void)ws); // Prevent unused warning
- ((void)cws); // Prevent unused warning
- ((void)wsp); // Prevent unused warning
- ASSERT_SAME_TYPE(int, decltype(fwprintf(fp, L"")));
- ASSERT_SAME_TYPE(int, decltype(fwscanf(fp, L"")));
- ASSERT_SAME_TYPE(int, decltype(swprintf(ws, s, L"")));
- ASSERT_SAME_TYPE(int, decltype(swscanf(L"", L"")));
- ASSERT_SAME_TYPE(int, decltype(vfwprintf(fp, L"", va)));
- ASSERT_SAME_TYPE(int, decltype(vfwscanf(fp, L"", va)));
- ASSERT_SAME_TYPE(int, decltype(vswprintf(ws, s, L"", va)));
- ASSERT_SAME_TYPE(int, decltype(vswscanf(L"", L"", va)));
- ASSERT_SAME_TYPE(wint_t, decltype(fgetwc(fp)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(fgetws(ws, 0, fp)));
- ASSERT_SAME_TYPE(wint_t, decltype(fputwc(L' ', fp)));
- ASSERT_SAME_TYPE(int, decltype(fputws(L"", fp)));
- ASSERT_SAME_TYPE(int, decltype(fwide(fp, 0)));
- ASSERT_SAME_TYPE(wint_t, decltype(getwc(fp)));
- ASSERT_SAME_TYPE(wint_t, decltype(putwc(L' ', fp)));
- ASSERT_SAME_TYPE(wint_t, decltype(ungetwc(L' ', fp)));
- ASSERT_SAME_TYPE(double, decltype(wcstod(L"", wsp)));
- ASSERT_SAME_TYPE(float, decltype(wcstof(L"", wsp)));
- ASSERT_SAME_TYPE(long double, decltype(wcstold(L"", wsp)));
- ASSERT_SAME_TYPE(long, decltype(wcstol(L"", wsp, 0)));
- ASSERT_SAME_TYPE(long long, decltype(wcstoll(L"", wsp, 0)));
- ASSERT_SAME_TYPE(unsigned long, decltype(wcstoul(L"", wsp, 0)));
- ASSERT_SAME_TYPE(unsigned long long, decltype(wcstoull(L"", wsp, 0)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcscpy(ws, L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcsncpy(ws, L"", s)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcscat(ws, L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcsncat(ws, L"", s)));
- ASSERT_SAME_TYPE(int, decltype(wcscmp(L"", L"")));
- ASSERT_SAME_TYPE(int, decltype(wcscoll(L"", L"")));
- ASSERT_SAME_TYPE(int, decltype(wcsncmp(L"", L"", s)));
- ASSERT_SAME_TYPE(size_t, decltype(wcsxfrm(ws, L"", s)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcschr(ws, L' ')));
- ASSERT_SAME_TYPE(const wchar_t*, decltype(wcschr(cws, L' ')));
- ASSERT_SAME_TYPE(size_t, decltype(wcscspn(L"", L"")));
- ASSERT_SAME_TYPE(size_t, decltype(wcslen(L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcspbrk(ws, L"")));
- ASSERT_SAME_TYPE(const wchar_t*, decltype(wcspbrk(cws, L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcsrchr(ws, L' ')));
- ASSERT_SAME_TYPE(const wchar_t*, decltype(wcsrchr(cws, L' ')));
- ASSERT_SAME_TYPE(size_t, decltype(wcsspn(L"", L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcsstr(ws, L"")));
- ASSERT_SAME_TYPE(const wchar_t*, decltype(wcsstr(cws, L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcstok(ws, L"", wsp)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wmemchr(ws, L' ', s)));
- ASSERT_SAME_TYPE(const wchar_t*, decltype(wmemchr(cws, L' ', s)));
- ASSERT_SAME_TYPE(int, decltype(wmemcmp(L"", L"", s)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wmemcpy(ws, L"", s)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wmemmove(ws, L"", s)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wmemset(ws, L' ', s)));
- ASSERT_SAME_TYPE(size_t, decltype(wcsftime(ws, s, L"", tm)));
- ASSERT_SAME_TYPE(wint_t, decltype(btowc(0)));
- ASSERT_SAME_TYPE(int, decltype(wctob(w)));
- ASSERT_SAME_TYPE(int, decltype(mbsinit(&mb)));
- ASSERT_SAME_TYPE(size_t, decltype(mbrlen("", s, &mb)));
- ASSERT_SAME_TYPE(size_t, decltype(mbrtowc(ws, "", s, &mb)));
- ASSERT_SAME_TYPE(size_t, decltype(wcrtomb(ns, L' ', &mb)));
- ASSERT_SAME_TYPE(size_t, decltype(mbsrtowcs(ws, (const char**)0, s, &mb)));
- ASSERT_SAME_TYPE(size_t, decltype(wcsrtombs(ns, (const wchar_t**)0, s, &mb)));
- ASSERT_SAME_TYPE(wint_t, decltype(getwchar()));
- ASSERT_SAME_TYPE(int, decltype(vwscanf(L"", va)));
- ASSERT_SAME_TYPE(int, decltype(wscanf(L"")));
- ASSERT_SAME_TYPE(wint_t, decltype(putwchar(L' ')));
- ASSERT_SAME_TYPE(int, decltype(vwprintf(L"", va)));
- ASSERT_SAME_TYPE(int, decltype(wprintf(L"")));
-
- return 0;
-}
diff --git a/libcxx/test/std/depr/depr.c.headers/wctype_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/wctype_h.compile.pass.cpp
new file mode 100644
index 0000000000000..d9a175cc26281
--- /dev/null
+++ b/libcxx/test/std/depr/depr.c.headers/wctype_h.compile.pass.cpp
@@ -0,0 +1,114 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL: no-wide-characters
+
+// <wctype.h>
+
+#include <wctype.h>
+#include <type_traits>
+
+#include "test_macros.h"
+
+#ifndef WEOF
+#error WEOF not defined
+#endif
+
+#ifdef iswalnum
+#error iswalnum defined
+#endif
+
+#ifdef iswalpha
+#error iswalpha defined
+#endif
+
+#ifdef iswblank
+#error iswblank defined
+#endif
+
+#ifdef iswcntrl
+#error iswcntrl defined
+#endif
+
+#ifdef iswdigit
+#error iswdigit defined
+#endif
+
+#ifdef iswgraph
+#error iswgraph defined
+#endif
+
+#ifdef iswlower
+#error iswlower defined
+#endif
+
+#ifdef iswprint
+#error iswprint defined
+#endif
+
+#ifdef iswpunct
+#error iswpunct defined
+#endif
+
+#ifdef iswspace
+#error iswspace defined
+#endif
+
+#ifdef iswupper
+#error iswupper defined
+#endif
+
+#ifdef iswxdigit
+#error iswxdigit defined
+#endif
+
+#ifdef iswctype
+#error iswctype defined
+#endif
+
+#ifdef wctype
+#error wctype defined
+#endif
+
+#ifdef towlower
+#error towlower defined
+#endif
+
+#ifdef towupper
+#error towupper defined
+#endif
+
+#ifdef towctrans
+#error towctrans defined
+#endif
+
+#ifdef wctrans
+#error wctrans defined
+#endif
+
+wint_t w = 0;
+wctrans_t wctr = 0;
+wctype_t wct = 0;
+static_assert((std::is_same<decltype(iswalnum(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswalpha(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswblank(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswcntrl(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswdigit(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswgraph(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswlower(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswprint(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswpunct(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswspace(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswupper(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswxdigit(w)), int>::value), "");
+static_assert((std::is_same<decltype(iswctype(w, wct)), int>::value), "");
+static_assert((std::is_same<decltype(wctype("")), wctype_t>::value), "");
+static_assert((std::is_same<decltype(towlower(w)), wint_t>::value), "");
+static_assert((std::is_same<decltype(towupper(w)), wint_t>::value), "");
+static_assert((std::is_same<decltype(towctrans(w, wctr)), wint_t>::value), "");
+static_assert((std::is_same<decltype(wctrans("")), wctrans_t>::value), "");
diff --git a/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp
deleted file mode 100644
index c40623a9dcacc..0000000000000
--- a/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// XFAIL: no-wide-characters
-
-// <wctype.h>
-
-#include <wctype.h>
-#include <type_traits>
-
-#include "test_macros.h"
-
-#ifndef WEOF
-#error WEOF not defined
-#endif
-
-#ifdef iswalnum
-#error iswalnum defined
-#endif
-
-#ifdef iswalpha
-#error iswalpha defined
-#endif
-
-#ifdef iswblank
-#error iswblank defined
-#endif
-
-#ifdef iswcntrl
-#error iswcntrl defined
-#endif
-
-#ifdef iswdigit
-#error iswdigit defined
-#endif
-
-#ifdef iswgraph
-#error iswgraph defined
-#endif
-
-#ifdef iswlower
-#error iswlower defined
-#endif
-
-#ifdef iswprint
-#error iswprint defined
-#endif
-
-#ifdef iswpunct
-#error iswpunct defined
-#endif
-
-#ifdef iswspace
-#error iswspace defined
-#endif
-
-#ifdef iswupper
-#error iswupper defined
-#endif
-
-#ifdef iswxdigit
-#error iswxdigit defined
-#endif
-
-#ifdef iswctype
-#error iswctype defined
-#endif
-
-#ifdef wctype
-#error wctype defined
-#endif
-
-#ifdef towlower
-#error towlower defined
-#endif
-
-#ifdef towupper
-#error towupper defined
-#endif
-
-#ifdef towctrans
-#error towctrans defined
-#endif
-
-#ifdef wctrans
-#error wctrans defined
-#endif
-
-int main(int, char**)
-{
- wint_t w = 0;
- wctrans_t wctr = 0;
- wctype_t wct = 0;
- static_assert((std::is_same<decltype(iswalnum(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswalpha(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswblank(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswcntrl(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswdigit(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswgraph(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswlower(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswprint(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswpunct(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswspace(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswupper(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswxdigit(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswctype(w, wct)), int>::value), "");
- static_assert((std::is_same<decltype(wctype("")), wctype_t>::value), "");
- static_assert((std::is_same<decltype(towlower(w)), wint_t>::value), "");
- static_assert((std::is_same<decltype(towupper(w)), wint_t>::value), "");
- static_assert((std::is_same<decltype(towctrans(w, wctr)), wint_t>::value), "");
- static_assert((std::is_same<decltype(wctrans("")), wctrans_t>::value), "");
-
- return 0;
-}
More information about the libcxx-commits
mailing list