Skip to content

Conversation

@philnik777
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Jul 8, 2025

⚠️ Python code formatter, darker found issues in your code. ⚠️

You can test this locally with the following command:
darker --check --diff -r HEAD~1...HEAD libcxx/test/extensions/clang/clang_modules_include.gen.py libcxx/test/extensions/libcxx/libcpp_version.gen.py libcxx/test/extensions/libcxx/no_assert_include.gen.py libcxx/test/std/double_include.gen.py libcxx/test/std/header_inclusions.gen.py
View the diff from darker here.
--- extensions/clang/clang_modules_include.gen.py	2025-07-10 15:08:49.000000 +0000
+++ extensions/clang/clang_modules_include.gen.py	2025-07-10 15:11:54.613040 +0000
@@ -14,10 +14,11 @@
 
 # block Lit from interpreting a RUN/XFAIL/etc inside the generation script
 # END.
 
 import sys
+
 sys.path.append(sys.argv[1])
 from libcxx.header_information import (
     lit_header_restrictions,
     lit_header_undeprecations,
     public_headers,
--- extensions/libcxx/libcpp_version.gen.py	2025-07-10 15:08:49.000000 +0000
+++ extensions/libcxx/libcpp_version.gen.py	2025-07-10 15:11:54.621550 +0000
@@ -9,10 +9,11 @@
 # Test that all public headers define the _LIBCPP_VERSION macro.
 
 # RUN: %{python} %s %{libcxx-dir}/utils
 
 import sys
+
 sys.path.append(sys.argv[1])
 from libcxx.header_information import (
     lit_header_restrictions,
     lit_header_undeprecations,
     public_headers,
--- std/double_include.gen.py	2025-07-10 15:08:49.000000 +0000
+++ std/double_include.gen.py	2025-07-10 15:11:54.637650 +0000
@@ -12,10 +12,11 @@
 
 # Block Lit from interpreting a RUN/XFAIL/etc inside the generation script.
 # END.
 
 import sys
+
 sys.path.append(sys.argv[1])
 from libcxx.header_information import (
     lit_header_restrictions,
     lit_header_undeprecations,
     public_headers,

@github-actions
Copy link

github-actions bot commented Jul 8, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- libcxx/test/extensions/all/cstddef.compile.pass.cpp libcxx/test/extensions/libcxx/include_as_c.sh.cpp
View the diff from clang-format here.
diff --git a/libcxx/test/extensions/all/cstddef.compile.pass.cpp b/libcxx/test/extensions/all/cstddef.compile.pass.cpp
index c6f670d7b..4958f2856 100644
--- a/libcxx/test/extensions/all/cstddef.compile.pass.cpp
+++ b/libcxx/test/extensions/all/cstddef.compile.pass.cpp
@@ -15,7 +15,7 @@
 #include "test_macros.h"
 
 using PtrdiffT = ::ptrdiff_t;
-using SizeT = ::size_t;
+using SizeT    = ::size_t;
 #if TEST_STD_VER >= 11
 using MaxAlignT = ::max_align_t;
 #endif

@philnik777 philnik777 marked this pull request as ready for review July 9, 2025 11:26
@philnik777 philnik777 requested a review from a team as a code owner July 9, 2025 11:26
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jul 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 9, 2025

@llvm/pr-subscribers-libcxx

Author: Nikolas Klauser (philnik777)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/147557.diff

11 Files Affected:

  • (renamed) libcxx/test/extensions/all/cstddef.compile.pass.cpp (+1)
  • (renamed) libcxx/test/extensions/clang/clang_modules_include.gen.py ()
  • (added) libcxx/test/extensions/clang/lit.local.cfg (+4)
  • (renamed) libcxx/test/extensions/libcxx/include_as_c.sh.cpp ()
  • (renamed) libcxx/test/extensions/libcxx/libcpp_version.gen.py (+1-1)
  • (added) libcxx/test/extensions/libcxx/lit.local.cfg (+3)
  • (renamed) libcxx/test/extensions/libcxx/no_assert_include.gen.py ()
  • (removed) libcxx/test/libcxx/lit.local.cfg (-5)
  • (renamed) libcxx/test/std/double_include.gen.py (+3)
  • (renamed) libcxx/test/std/header_inclusions.gen.py (+3)
  • (modified) libcxx/utils/libcxx/test/format.py (+4-1)
diff --git a/libcxx/test/libcxx/language.support/support.types/cstddef.compile.pass.cpp b/libcxx/test/extensions/all/cstddef.compile.pass.cpp
similarity index 99%
rename from libcxx/test/libcxx/language.support/support.types/cstddef.compile.pass.cpp
rename to libcxx/test/extensions/all/cstddef.compile.pass.cpp
index 514353a103029..c6f670d7bfc06 100644
--- a/libcxx/test/libcxx/language.support/support.types/cstddef.compile.pass.cpp
+++ b/libcxx/test/extensions/all/cstddef.compile.pass.cpp
@@ -11,6 +11,7 @@
 // appear to provide that behavior too.
 
 #include <cstddef>
+
 #include "test_macros.h"
 
 using PtrdiffT = ::ptrdiff_t;
diff --git a/libcxx/test/libcxx/clang_modules_include.gen.py b/libcxx/test/extensions/clang/clang_modules_include.gen.py
similarity index 100%
rename from libcxx/test/libcxx/clang_modules_include.gen.py
rename to libcxx/test/extensions/clang/clang_modules_include.gen.py
diff --git a/libcxx/test/extensions/clang/lit.local.cfg b/libcxx/test/extensions/clang/lit.local.cfg
new file mode 100644
index 0000000000000..38e0c9408738e
--- /dev/null
+++ b/libcxx/test/extensions/clang/lit.local.cfg
@@ -0,0 +1,4 @@
+
+# Only libc++ supports clang-specific extensions
+if ("stdlib=libc++" not in config.available_features):
+    config.unsupported = True
diff --git a/libcxx/test/libcxx/include_as_c.sh.cpp b/libcxx/test/extensions/libcxx/include_as_c.sh.cpp
similarity index 100%
rename from libcxx/test/libcxx/include_as_c.sh.cpp
rename to libcxx/test/extensions/libcxx/include_as_c.sh.cpp
diff --git a/libcxx/test/libcxx/libcpp_version.gen.py b/libcxx/test/extensions/libcxx/libcpp_version.gen.py
similarity index 93%
rename from libcxx/test/libcxx/libcpp_version.gen.py
rename to libcxx/test/extensions/libcxx/libcpp_version.gen.py
index b30623fe2c388..ebeab777c934f 100644
--- a/libcxx/test/libcxx/libcpp_version.gen.py
+++ b/libcxx/test/extensions/libcxx/libcpp_version.gen.py
@@ -6,7 +6,7 @@
 #
 # ===----------------------------------------------------------------------===##
 
-# Test that all headers define the _LIBCPP_VERSION macro.
+# Test that all public headers define the _LIBCPP_VERSION macro.
 
 # RUN: %{python} %s %{libcxx-dir}/utils
 
diff --git a/libcxx/test/extensions/libcxx/lit.local.cfg b/libcxx/test/extensions/libcxx/lit.local.cfg
new file mode 100644
index 0000000000000..f46fda197c01b
--- /dev/null
+++ b/libcxx/test/extensions/libcxx/lit.local.cfg
@@ -0,0 +1,3 @@
+
+if ("stdlib=libc++" not in config.available_features):
+    config.unsupported = True
diff --git a/libcxx/test/libcxx/no_assert_include.gen.py b/libcxx/test/extensions/libcxx/no_assert_include.gen.py
similarity index 100%
rename from libcxx/test/libcxx/no_assert_include.gen.py
rename to libcxx/test/extensions/libcxx/no_assert_include.gen.py
diff --git a/libcxx/test/libcxx/lit.local.cfg b/libcxx/test/libcxx/lit.local.cfg
deleted file mode 100644
index 4467d8070cc70..0000000000000
--- a/libcxx/test/libcxx/lit.local.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-# The tests in this directory need to run Python
-import shlex
-import sys
-
-config.substitutions.append(("%{python}", shlex.quote(sys.executable)))
diff --git a/libcxx/test/libcxx/double_include.gen.py b/libcxx/test/std/double_include.gen.py
similarity index 93%
rename from libcxx/test/libcxx/double_include.gen.py
rename to libcxx/test/std/double_include.gen.py
index f58e72f94a353..91b7a3389e295 100644
--- a/libcxx/test/libcxx/double_include.gen.py
+++ b/libcxx/test/std/double_include.gen.py
@@ -8,6 +8,9 @@
 
 # Test that we can include each header in two TU's and link them together.
 
+# We're using compiler-specific flags in this test
+# REQUIRES: (gcc || clang)
+
 # RUN: %{python} %s %{libcxx-dir}/utils
 
 # Block Lit from interpreting a RUN/XFAIL/etc inside the generation script.
diff --git a/libcxx/test/libcxx/header_inclusions.gen.py b/libcxx/test/std/header_inclusions.gen.py
similarity index 91%
rename from libcxx/test/libcxx/header_inclusions.gen.py
rename to libcxx/test/std/header_inclusions.gen.py
index e00cf180d17ad..3f29aa2ca34b5 100644
--- a/libcxx/test/libcxx/header_inclusions.gen.py
+++ b/libcxx/test/std/header_inclusions.gen.py
@@ -9,6 +9,9 @@
 # Test that all headers include all the other headers they're supposed to, as
 # prescribed by the Standard.
 
+# TODO: This is currently a libc++-specific way of testing the includes, but is a requirement for all implementation
+# REQUIRES: stdlib=libc++
+
 # RUN: %{python} %s %{libcxx-dir}/utils
 # END.
 
diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index 59d0fffd37819..c98f799c70989 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -11,7 +11,8 @@
 import lit.formats
 import os
 import re
-
+import shlex
+import sys
 
 def _getTempPaths(test):
     """
@@ -97,6 +98,8 @@ def parseScript(test, preamble):
     )
     substitutions.append(("%{run}", "%{exec} %t.exe"))
 
+    substitutions.append(("%{python}", shlex.quote(sys.executable)))
+
     # Parse the test file, including custom directives
     additionalCompileFlags = []
     fileDependencies = []

Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch looks good to me overall, but let's not add %{python} to the substitutions in format.py.

@philnik777 philnik777 force-pushed the move_tests branch 3 times, most recently from d893668 to 6e356e5 Compare July 9, 2025 13:36
Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I like the reorganization here!

@philnik777 philnik777 merged commit 03f6f48 into llvm:main Jul 10, 2025
119 of 132 checks passed
@philnik777 philnik777 deleted the move_tests branch July 10, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants