diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 94cbcd1b..3a8db9b6 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "21.1.0.rc1" %} +{% set version = "21.1.0.rc2" %} {% set major_version = version.split(".")[0] %} {% set tail_version = version.split(".")[-1] %} {% set build_number = 0 %} @@ -23,7 +23,7 @@ package: source: - url: https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-{{ version.replace(".rc", "-rc") }}.tar.gz - sha256: 43c05ada2449f545d35a2530a44ef64a3de7e9dd54e6c53eaa7ffb419daa4f9e + sha256: f28b419ea38e554c295969c4d7fc3ea3b517d893b9f35e8e7aff50c507549459 patches: - patches/0001-Find-conda-gcc-installation.patch - patches/0002-Fix-sysroot-detection-for-linux.patch @@ -35,8 +35,6 @@ source: - patches/0008-Make-PIE-default-on-macOS-too.patch - patches/0009-Find-ROCm-device-library-in-conda-layout.patch - patches/0010-Add-conda-mingw-paths.patch - # backport https://github.com/llvm/llvm-project/pull/149570 - - patches/0011-Revert-Move-python-binding-tests-to-lit-framework-14.patch # name folder for easier deletion; we do the equivalent of downloading # the subproject sources, so the work folder then has clang in it; # for details see build scripts @@ -474,17 +472,19 @@ outputs: test: requires: - {{ compiler("cxx") }} - # - gxx_impl_{{ target_platform }} # [win64] + - gxx_impl_{{ target_platform }} # [win64] files: - mytest.cxx commands: + # avoid CMake picking up random clang in image when using unactivated compilers + - del /s /q "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin\clang++.exe" # [win] - clang++ --version - clang++-{{ major_version }} --version - clang++ -v -c mytest.cxx - unset CONDA_BUILD_SYSROOT # [unix] - set "CONDA_BUILD_SYSROOT=" # [win] - clang++ -v -c mytest.cxx - # - clang++ -v mytest.cxx --target=x86_64-w64-mingw32 # [win64] + - clang++ -v mytest.cxx --target=x86_64-w64-mingw32 # [win64] - name: clang-format-{{ major_version }} script: install_clang_format.sh # [unix] diff --git a/recipe/patches/0001-Find-conda-gcc-installation.patch b/recipe/patches/0001-Find-conda-gcc-installation.patch index 77988fe9..d4c8d918 100644 --- a/recipe/patches/0001-Find-conda-gcc-installation.patch +++ b/recipe/patches/0001-Find-conda-gcc-installation.patch @@ -1,7 +1,7 @@ From 6247be9d8f71c64889c90573665a0ee6d81ac0e1 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 8 Apr 2019 16:20:03 -0500 -Subject: [PATCH 01/11] Find conda gcc installation +Subject: [PATCH 01/10] Find conda gcc installation --- clang/lib/Driver/ToolChains/Gnu.cpp | 7 ++++--- diff --git a/recipe/patches/0002-Fix-sysroot-detection-for-linux.patch b/recipe/patches/0002-Fix-sysroot-detection-for-linux.patch index aaa1e747..8e7277e0 100644 --- a/recipe/patches/0002-Fix-sysroot-detection-for-linux.patch +++ b/recipe/patches/0002-Fix-sysroot-detection-for-linux.patch @@ -1,7 +1,7 @@ From e72079b410cc152294b7c3a60921c926e5a8b03c Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 8 Apr 2019 16:32:17 -0500 -Subject: [PATCH 02/11] Fix sysroot detection for linux +Subject: [PATCH 02/10] Fix sysroot detection for linux --- clang/lib/Driver/ToolChains/Linux.cpp | 20 ++++++++++++++++---- diff --git a/recipe/patches/0003-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch b/recipe/patches/0003-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch index b2093bea..7f621c0f 100644 --- a/recipe/patches/0003-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch +++ b/recipe/patches/0003-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch @@ -1,7 +1,7 @@ From 95133a77b91df1861378b3b3f7a35f72c375ce92 Mon Sep 17 00:00:00 2001 From: Nehal J Wani Date: Sat, 25 Aug 2018 09:20:04 -0500 -Subject: [PATCH 03/11] clang: add conda specific env var CONDA_BUILD_SYSROOT +Subject: [PATCH 03/10] clang: add conda specific env var CONDA_BUILD_SYSROOT And also improve logic for finding the macos sysroot for conda diff --git a/recipe/patches/0004-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch b/recipe/patches/0004-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch index 96a3e0a1..d0b51dfa 100644 --- a/recipe/patches/0004-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch +++ b/recipe/patches/0004-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch @@ -1,7 +1,7 @@ From d8ef2acfb9202d55a2ac4d5bd935b1e7ffbdcede Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Wed, 30 Aug 2017 20:01:49 +0100 -Subject: [PATCH 04/11] Fix normalizeProgramName()'s handling of dots outside +Subject: [PATCH 04/10] Fix normalizeProgramName()'s handling of dots outside of .exe It used to strip everything after the last dot, turning: diff --git a/recipe/patches/0005-Set-VERSION-in-osx-as-well.patch b/recipe/patches/0005-Set-VERSION-in-osx-as-well.patch index fbe6073d..5764d594 100644 --- a/recipe/patches/0005-Set-VERSION-in-osx-as-well.patch +++ b/recipe/patches/0005-Set-VERSION-in-osx-as-well.patch @@ -1,7 +1,7 @@ From 4ee1ce6090103934f36a7bb58e682ae7a082462b Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 27 Jul 2019 11:55:23 -0500 -Subject: [PATCH 05/11] Set VERSION in osx as well +Subject: [PATCH 05/10] Set VERSION in osx as well --- clang/tools/libclang/CMakeLists.txt | 5 +++++ diff --git a/recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch b/recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch index 03105256..f1d4edc0 100644 --- a/recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch +++ b/recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch @@ -1,7 +1,7 @@ From bf8023147441d47b1823d7564d4f8e76c496acef Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 11 May 2021 15:08:13 +0200 -Subject: [PATCH 06/11] Fix crosscompiling LLVM tools +Subject: [PATCH 06/10] Fix crosscompiling LLVM tools --- clang/CMakeLists.txt | 10 ++++++++++ diff --git a/recipe/patches/0007-set-libclang-SOVERSION-unconditionally.patch b/recipe/patches/0007-set-libclang-SOVERSION-unconditionally.patch index abf34ea9..d7b4923b 100644 --- a/recipe/patches/0007-set-libclang-SOVERSION-unconditionally.patch +++ b/recipe/patches/0007-set-libclang-SOVERSION-unconditionally.patch @@ -1,7 +1,7 @@ From e5d018a29b6347b08b21bad6e5d822b27b8dafc1 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 14 Apr 2022 11:57:00 +1100 -Subject: [PATCH 07/11] set libclang SOVERSION unconditionally +Subject: [PATCH 07/10] set libclang SOVERSION unconditionally and avoid creating libclang with full version suffix --- diff --git a/recipe/patches/0008-Make-PIE-default-on-macOS-too.patch b/recipe/patches/0008-Make-PIE-default-on-macOS-too.patch index 00716c98..0fe1aa6e 100644 --- a/recipe/patches/0008-Make-PIE-default-on-macOS-too.patch +++ b/recipe/patches/0008-Make-PIE-default-on-macOS-too.patch @@ -1,7 +1,7 @@ From abe02e77149a29dd326d063efb6f3aed5833150b Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 28 Dec 2023 19:32:19 +0530 -Subject: [PATCH 08/11] Make PIE default on macOS too. +Subject: [PATCH 08/10] Make PIE default on macOS too. This is the default for Linux from LLVM-15 --- diff --git a/recipe/patches/0009-Find-ROCm-device-library-in-conda-layout.patch b/recipe/patches/0009-Find-ROCm-device-library-in-conda-layout.patch index 879aea9c..545b5feb 100644 --- a/recipe/patches/0009-Find-ROCm-device-library-in-conda-layout.patch +++ b/recipe/patches/0009-Find-ROCm-device-library-in-conda-layout.patch @@ -1,7 +1,7 @@ From 33a528eefd88bca0a65db98d9bc4ec4c46cb8251 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 11 Mar 2024 14:03:12 -0500 -Subject: [PATCH 09/11] Find ROCm device library in conda layout +Subject: [PATCH 09/10] Find ROCm device library in conda layout --- clang/lib/Driver/ToolChains/AMDGPU.cpp | 19 +++++++++++++++++++ diff --git a/recipe/patches/0010-Add-conda-mingw-paths.patch b/recipe/patches/0010-Add-conda-mingw-paths.patch index e72d6aa0..66cb7277 100644 --- a/recipe/patches/0010-Add-conda-mingw-paths.patch +++ b/recipe/patches/0010-Add-conda-mingw-paths.patch @@ -1,7 +1,7 @@ From b676392475ce6fc7a91900377303fd6969dccb6a Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 18 Oct 2024 10:28:09 -0400 -Subject: [PATCH 10/11] Add conda mingw paths +Subject: [PATCH 10/10] Add conda mingw paths --- clang/lib/Driver/ToolChains/MinGW.cpp | 8 ++++++++ diff --git a/recipe/patches/0011-Revert-Move-python-binding-tests-to-lit-framework-14.patch b/recipe/patches/0011-Revert-Move-python-binding-tests-to-lit-framework-14.patch deleted file mode 100644 index d2bc17e4..00000000 --- a/recipe/patches/0011-Revert-Move-python-binding-tests-to-lit-framework-14.patch +++ /dev/null @@ -1,444 +0,0 @@ -From d424d44aaa461f279ec9e2e7543e6385c8af96f2 Mon Sep 17 00:00:00 2001 -From: Jannick Kremer -Date: Wed, 16 Jul 2025 05:32:08 +0100 -Subject: [PATCH 11/11] Revert "Move python binding tests to lit framework" - (#149012) - -This reverts commit f8707f994af2582f6dc58190106946efeb43bf05. - -(cherry picked from commit 7a9bef0166951a61bc7094514a20471ae45f6090) ---- - .github/workflows/libclang-python-tests.yml | 4 +- - clang/CMakeLists.txt | 1 + - clang/bindings/python/tests/CMakeLists.txt | 66 +++++++++++++++++++ - .../bindings/python/tests/__init__.py | 0 - .../bindings/python/tests/cindex/INPUTS/a.inc | 0 - .../bindings/python/tests/cindex/INPUTS/b.inc | 0 - .../tests/cindex/INPUTS/compile_commands.json | 0 - .../python/tests/cindex/INPUTS/header1.h | 0 - .../python/tests/cindex/INPUTS/header2.h | 0 - .../python/tests/cindex/INPUTS/header3.h | 0 - .../python/tests/cindex/INPUTS/hello.cpp | 0 - .../python/tests/cindex/INPUTS/include.cpp | 0 - .../tests/cindex/INPUTS/parse_arguments.c | 0 - .../python/tests/cindex/INPUTS/testfile.c | 0 - .../bindings/python/tests/cindex/__init__.py | 0 - .../tests/cindex/test_access_specifiers.py | 0 - .../bindings/python/tests/cindex/test_cdb.py | 0 - .../tests/cindex/test_code_completion.py | 0 - .../python/tests/cindex/test_comment.py | 0 - .../python/tests/cindex/test_cursor.py | 0 - .../python/tests/cindex/test_cursor_kind.py | 0 - .../python/tests/cindex/test_diagnostics.py | 0 - .../python/tests/cindex/test_enums.py | 0 - .../test_exception_specification_kind.py | 0 - .../bindings/python/tests/cindex/test_file.py | 0 - .../python/tests/cindex/test_index.py | 0 - .../bindings/python/tests/cindex/test_lib.py | 0 - .../python/tests/cindex/test_linkage.py | 0 - .../python/tests/cindex/test_location.py | 0 - .../python/tests/cindex/test_rewrite.py | 0 - .../python/tests/cindex/test_source_range.py | 0 - .../python/tests/cindex/test_tls_kind.py | 0 - .../python/tests/cindex/test_token_kind.py | 0 - .../python/tests/cindex/test_tokens.py | 0 - .../tests/cindex/test_translation_unit.py | 0 - .../bindings/python/tests/cindex/test_type.py | 0 - .../bindings/python/tests/cindex/util.py | 0 - clang/test/CMakeLists.txt | 11 ---- - clang/test/bindings/python/bindings.sh | 38 ----------- - clang/test/bindings/python/lit.local.cfg | 41 ------------ - 40 files changed, 69 insertions(+), 92 deletions(-) - create mode 100644 clang/bindings/python/tests/CMakeLists.txt - rename clang/{test => }/bindings/python/tests/__init__.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/INPUTS/a.inc (100%) - rename clang/{test => }/bindings/python/tests/cindex/INPUTS/b.inc (100%) - rename clang/{test => }/bindings/python/tests/cindex/INPUTS/compile_commands.json (100%) - rename clang/{test => }/bindings/python/tests/cindex/INPUTS/header1.h (100%) - rename clang/{test => }/bindings/python/tests/cindex/INPUTS/header2.h (100%) - rename clang/{test => }/bindings/python/tests/cindex/INPUTS/header3.h (100%) - rename clang/{test => }/bindings/python/tests/cindex/INPUTS/hello.cpp (100%) - rename clang/{test => }/bindings/python/tests/cindex/INPUTS/include.cpp (100%) - rename clang/{test => }/bindings/python/tests/cindex/INPUTS/parse_arguments.c (100%) - rename clang/{test => }/bindings/python/tests/cindex/INPUTS/testfile.c (100%) - rename clang/{test => }/bindings/python/tests/cindex/__init__.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_access_specifiers.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_cdb.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_code_completion.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_comment.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_cursor.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_cursor_kind.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_diagnostics.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_enums.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_exception_specification_kind.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_file.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_index.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_lib.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_linkage.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_location.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_rewrite.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_source_range.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_tls_kind.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_token_kind.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_tokens.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_translation_unit.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/test_type.py (100%) - rename clang/{test => }/bindings/python/tests/cindex/util.py (100%) - delete mode 100755 clang/test/bindings/python/bindings.sh - delete mode 100644 clang/test/bindings/python/lit.local.cfg - -diff --git a/.github/workflows/libclang-python-tests.yml b/.github/workflows/libclang-python-tests.yml -index 43b50cec6171..50ef4acf2feb 100644 ---- a/.github/workflows/libclang-python-tests.yml -+++ b/.github/workflows/libclang-python-tests.yml -@@ -10,15 +10,15 @@ on: - - 'main' - paths: - - 'clang/bindings/python/**' -- - 'clang/test/bindings/python/**' - - 'clang/tools/libclang/**' -+ - 'clang/CMakeList.txt' - - '.github/workflows/libclang-python-tests.yml' - - '.github/workflows/llvm-project-tests.yml' - pull_request: - paths: - - 'clang/bindings/python/**' -- - 'clang/test/bindings/python/**' - - 'clang/tools/libclang/**' -+ - 'clang/CMakeList.txt' - - '.github/workflows/libclang-python-tests.yml' - - '.github/workflows/llvm-project-tests.yml' - -diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt -index 08a6ebf2a3ec..1270a62eee07 100644 ---- a/clang/CMakeLists.txt -+++ b/clang/CMakeLists.txt -@@ -546,6 +546,7 @@ if( CLANG_INCLUDE_TESTS ) - clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg - ) - add_subdirectory(test) -+ add_subdirectory(bindings/python/tests) - - if(CLANG_BUILT_STANDALONE) - umbrella_lit_testsuite_end(check-all) -diff --git a/clang/bindings/python/tests/CMakeLists.txt b/clang/bindings/python/tests/CMakeLists.txt -new file mode 100644 -index 000000000000..a0ddabc21bb4 ---- /dev/null -+++ b/clang/bindings/python/tests/CMakeLists.txt -@@ -0,0 +1,66 @@ -+# Test target to run Python test suite from main build. -+ -+# Avoid configurations including '-include' from interfering with -+# our tests by setting CLANG_NO_DEFAULT_CONFIG. -+add_custom_target(check-clang-python -+ COMMAND ${CMAKE_COMMAND} -E env -+ CLANG_NO_DEFAULT_CONFIG=1 -+ CLANG_LIBRARY_PATH=$ -+ "${Python3_EXECUTABLE}" -m unittest discover -+ DEPENDS libclang -+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..) -+ -+set(RUN_PYTHON_TESTS TRUE) -+set_target_properties(check-clang-python PROPERTIES FOLDER "Clang/Tests") -+ -+# Tests require libclang.so which is only built with LLVM_ENABLE_PIC=ON -+if(NOT LLVM_ENABLE_PIC) -+ set(RUN_PYTHON_TESTS FALSE) -+endif() -+ -+# Do not try to run if libclang was built with sanitizers because -+# the sanitizer library will likely be loaded too late to perform -+# interception and will then fail. -+# We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't -+# portable so its easier just to not run the tests when building -+# with ASan. -+if(NOT LLVM_USE_SANITIZER STREQUAL "") -+ set(RUN_PYTHON_TESTS FALSE) -+endif() -+ -+# Tests fail on Windows, and need someone knowledgeable to fix. -+# It's not clear whether it's a test or a valid binding problem. -+if(WIN32) -+ set(RUN_PYTHON_TESTS FALSE) -+endif() -+ -+# The Python FFI interface is broken on AIX: https://bugs.python.org/issue38628. -+if(${CMAKE_SYSTEM_NAME} MATCHES "AIX") -+ set(RUN_PYTHON_TESTS FALSE) -+endif() -+ -+# AArch64, Hexagon, and Sparc have known test failures that need to be -+# addressed. -+# SystemZ has broken Python/FFI interface: -+# https://reviews.llvm.org/D52840#1265716 -+if(${LLVM_NATIVE_ARCH} MATCHES "^(AArch64|Hexagon|Sparc|SystemZ)$") -+ set(RUN_PYTHON_TESTS FALSE) -+endif() -+ -+# Tests will fail if cross-compiling for a different target, as tests will try -+# to use the host Python3_EXECUTABLE and make FFI calls to functions in target -+# libraries. -+if(CMAKE_CROSSCOMPILING) -+ # FIXME: Consider a solution that allows better control over these tests in -+ # a crosscompiling scenario. e.g. registering them with lit to allow them to -+ # be explicitly skipped via appropriate LIT_ARGS, or adding a mechanism to -+ # allow specifying a python interpreter compiled for the target that could -+ # be executed using qemu-user. -+ message(WARNING "check-clang-python not added to check-all as these tests fail in a cross-build setup") -+ set(RUN_PYTHON_TESTS FALSE) -+endif() -+ -+if(RUN_PYTHON_TESTS) -+ set_property(GLOBAL APPEND PROPERTY -+ LLVM_ALL_ADDITIONAL_TEST_TARGETS check-clang-python) -+endif() -diff --git a/clang/test/bindings/python/tests/__init__.py b/clang/bindings/python/tests/__init__.py -similarity index 100% -rename from clang/test/bindings/python/tests/__init__.py -rename to clang/bindings/python/tests/__init__.py -diff --git a/clang/test/bindings/python/tests/cindex/INPUTS/a.inc b/clang/bindings/python/tests/cindex/INPUTS/a.inc -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/INPUTS/a.inc -rename to clang/bindings/python/tests/cindex/INPUTS/a.inc -diff --git a/clang/test/bindings/python/tests/cindex/INPUTS/b.inc b/clang/bindings/python/tests/cindex/INPUTS/b.inc -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/INPUTS/b.inc -rename to clang/bindings/python/tests/cindex/INPUTS/b.inc -diff --git a/clang/test/bindings/python/tests/cindex/INPUTS/compile_commands.json b/clang/bindings/python/tests/cindex/INPUTS/compile_commands.json -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/INPUTS/compile_commands.json -rename to clang/bindings/python/tests/cindex/INPUTS/compile_commands.json -diff --git a/clang/test/bindings/python/tests/cindex/INPUTS/header1.h b/clang/bindings/python/tests/cindex/INPUTS/header1.h -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/INPUTS/header1.h -rename to clang/bindings/python/tests/cindex/INPUTS/header1.h -diff --git a/clang/test/bindings/python/tests/cindex/INPUTS/header2.h b/clang/bindings/python/tests/cindex/INPUTS/header2.h -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/INPUTS/header2.h -rename to clang/bindings/python/tests/cindex/INPUTS/header2.h -diff --git a/clang/test/bindings/python/tests/cindex/INPUTS/header3.h b/clang/bindings/python/tests/cindex/INPUTS/header3.h -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/INPUTS/header3.h -rename to clang/bindings/python/tests/cindex/INPUTS/header3.h -diff --git a/clang/test/bindings/python/tests/cindex/INPUTS/hello.cpp b/clang/bindings/python/tests/cindex/INPUTS/hello.cpp -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/INPUTS/hello.cpp -rename to clang/bindings/python/tests/cindex/INPUTS/hello.cpp -diff --git a/clang/test/bindings/python/tests/cindex/INPUTS/include.cpp b/clang/bindings/python/tests/cindex/INPUTS/include.cpp -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/INPUTS/include.cpp -rename to clang/bindings/python/tests/cindex/INPUTS/include.cpp -diff --git a/clang/test/bindings/python/tests/cindex/INPUTS/parse_arguments.c b/clang/bindings/python/tests/cindex/INPUTS/parse_arguments.c -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/INPUTS/parse_arguments.c -rename to clang/bindings/python/tests/cindex/INPUTS/parse_arguments.c -diff --git a/clang/test/bindings/python/tests/cindex/INPUTS/testfile.c b/clang/bindings/python/tests/cindex/INPUTS/testfile.c -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/INPUTS/testfile.c -rename to clang/bindings/python/tests/cindex/INPUTS/testfile.c -diff --git a/clang/test/bindings/python/tests/cindex/__init__.py b/clang/bindings/python/tests/cindex/__init__.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/__init__.py -rename to clang/bindings/python/tests/cindex/__init__.py -diff --git a/clang/test/bindings/python/tests/cindex/test_access_specifiers.py b/clang/bindings/python/tests/cindex/test_access_specifiers.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_access_specifiers.py -rename to clang/bindings/python/tests/cindex/test_access_specifiers.py -diff --git a/clang/test/bindings/python/tests/cindex/test_cdb.py b/clang/bindings/python/tests/cindex/test_cdb.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_cdb.py -rename to clang/bindings/python/tests/cindex/test_cdb.py -diff --git a/clang/test/bindings/python/tests/cindex/test_code_completion.py b/clang/bindings/python/tests/cindex/test_code_completion.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_code_completion.py -rename to clang/bindings/python/tests/cindex/test_code_completion.py -diff --git a/clang/test/bindings/python/tests/cindex/test_comment.py b/clang/bindings/python/tests/cindex/test_comment.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_comment.py -rename to clang/bindings/python/tests/cindex/test_comment.py -diff --git a/clang/test/bindings/python/tests/cindex/test_cursor.py b/clang/bindings/python/tests/cindex/test_cursor.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_cursor.py -rename to clang/bindings/python/tests/cindex/test_cursor.py -diff --git a/clang/test/bindings/python/tests/cindex/test_cursor_kind.py b/clang/bindings/python/tests/cindex/test_cursor_kind.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_cursor_kind.py -rename to clang/bindings/python/tests/cindex/test_cursor_kind.py -diff --git a/clang/test/bindings/python/tests/cindex/test_diagnostics.py b/clang/bindings/python/tests/cindex/test_diagnostics.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_diagnostics.py -rename to clang/bindings/python/tests/cindex/test_diagnostics.py -diff --git a/clang/test/bindings/python/tests/cindex/test_enums.py b/clang/bindings/python/tests/cindex/test_enums.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_enums.py -rename to clang/bindings/python/tests/cindex/test_enums.py -diff --git a/clang/test/bindings/python/tests/cindex/test_exception_specification_kind.py b/clang/bindings/python/tests/cindex/test_exception_specification_kind.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_exception_specification_kind.py -rename to clang/bindings/python/tests/cindex/test_exception_specification_kind.py -diff --git a/clang/test/bindings/python/tests/cindex/test_file.py b/clang/bindings/python/tests/cindex/test_file.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_file.py -rename to clang/bindings/python/tests/cindex/test_file.py -diff --git a/clang/test/bindings/python/tests/cindex/test_index.py b/clang/bindings/python/tests/cindex/test_index.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_index.py -rename to clang/bindings/python/tests/cindex/test_index.py -diff --git a/clang/test/bindings/python/tests/cindex/test_lib.py b/clang/bindings/python/tests/cindex/test_lib.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_lib.py -rename to clang/bindings/python/tests/cindex/test_lib.py -diff --git a/clang/test/bindings/python/tests/cindex/test_linkage.py b/clang/bindings/python/tests/cindex/test_linkage.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_linkage.py -rename to clang/bindings/python/tests/cindex/test_linkage.py -diff --git a/clang/test/bindings/python/tests/cindex/test_location.py b/clang/bindings/python/tests/cindex/test_location.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_location.py -rename to clang/bindings/python/tests/cindex/test_location.py -diff --git a/clang/test/bindings/python/tests/cindex/test_rewrite.py b/clang/bindings/python/tests/cindex/test_rewrite.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_rewrite.py -rename to clang/bindings/python/tests/cindex/test_rewrite.py -diff --git a/clang/test/bindings/python/tests/cindex/test_source_range.py b/clang/bindings/python/tests/cindex/test_source_range.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_source_range.py -rename to clang/bindings/python/tests/cindex/test_source_range.py -diff --git a/clang/test/bindings/python/tests/cindex/test_tls_kind.py b/clang/bindings/python/tests/cindex/test_tls_kind.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_tls_kind.py -rename to clang/bindings/python/tests/cindex/test_tls_kind.py -diff --git a/clang/test/bindings/python/tests/cindex/test_token_kind.py b/clang/bindings/python/tests/cindex/test_token_kind.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_token_kind.py -rename to clang/bindings/python/tests/cindex/test_token_kind.py -diff --git a/clang/test/bindings/python/tests/cindex/test_tokens.py b/clang/bindings/python/tests/cindex/test_tokens.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_tokens.py -rename to clang/bindings/python/tests/cindex/test_tokens.py -diff --git a/clang/test/bindings/python/tests/cindex/test_translation_unit.py b/clang/bindings/python/tests/cindex/test_translation_unit.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_translation_unit.py -rename to clang/bindings/python/tests/cindex/test_translation_unit.py -diff --git a/clang/test/bindings/python/tests/cindex/test_type.py b/clang/bindings/python/tests/cindex/test_type.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/test_type.py -rename to clang/bindings/python/tests/cindex/test_type.py -diff --git a/clang/test/bindings/python/tests/cindex/util.py b/clang/bindings/python/tests/cindex/util.py -similarity index 100% -rename from clang/test/bindings/python/tests/cindex/util.py -rename to clang/bindings/python/tests/cindex/util.py -diff --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txt -index 58080014abc5..286c9d40d2da 100644 ---- a/clang/test/CMakeLists.txt -+++ b/clang/test/CMakeLists.txt -@@ -226,17 +226,6 @@ add_custom_target(clang-test) - add_dependencies(clang-test check-clang) - set_target_properties(clang-test PROPERTIES FOLDER "Clang/Tests") - --# Allow running Clang Python binding tests separately from CI. --add_lit_testsuite(check-clang-python "Running the Clang Python tests" -- ${CMAKE_CURRENT_BINARY_DIR} -- #LIT ${LLVM_LIT} -- PARAMS ${CLANG_TEST_PARAMS} -- DEPENDS ${CLANG_TEST_DEPS} -- ARGS ${CLANG_TEST_EXTRA_ARGS} --filter=bindings.sh -- # Avoid running tests twice. -- EXCLUDE_FROM_CHECK_ALL -- ) -- - # FIXME: This logic can be removed once all buildbots have moved - # debuginfo-test from clang/test to llvm/projects or monorepo. - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/debuginfo-tests) -diff --git a/clang/test/bindings/python/bindings.sh b/clang/test/bindings/python/bindings.sh -deleted file mode 100755 -index 3f7a51ef9ca4..000000000000 ---- a/clang/test/bindings/python/bindings.sh -+++ /dev/null -@@ -1,38 +0,0 @@ --#!/bin/sh -- --# UNSUPPORTED: !libclang-loadable -- --# Tests fail on Windows, and need someone knowledgeable to fix. --# It's not clear whether it's a test or a valid binding problem. --# XFAIL: target={{.*windows.*}} -- --# The Python FFI interface is broken on AIX: https://bugs.python.org/issue38628. --# XFAIL: target={{.*-aix.*}} -- --# Hexagon has known test failures that need to be addressed. --# https://reviews.llvm.org/D52840#1265716 --# XFAIL: target={{hexagon-.*}} --# python SEGVs on Linux/sparc64 when loading libclang.so. Seems to be an FFI --# issue, too. --# XFAIL: target={{sparc.*-.*-linux.*}} -- --# Tests will fail if cross-compiling for a different target, as tests will try --# to use the host Python3_EXECUTABLE and make FFI calls to functions in target --# libraries. --# --# FIXME: Consider a solution that allows better control over these tests in --# a crosscompiling scenario. e.g. registering them with lit to allow them to --# be explicitly skipped via appropriate LIT_ARGS, or adding a mechanism to --# allow specifying a python interpreter compiled for the target that could --# be executed using qemu-user. --# REQUIRES: native -- --# SystemZ has broken Python/FFI interface --# according to https://reviews.llvm.org/D52840#1265716 --# This leads to failures only when Clang is built with GCC apparently, see: --# https://github.com/llvm/llvm-project/pull/146844#issuecomment-3048291798 --# REQUIRES: !target={{s390x-.*}} -- --# RUN: env PYTHONPATH=%S/../../../bindings/python \ --# RUN: CLANG_LIBRARY_PATH=%libdir \ --# RUN: %python -m unittest discover -s %S/tests -diff --git a/clang/test/bindings/python/lit.local.cfg b/clang/test/bindings/python/lit.local.cfg -deleted file mode 100644 -index cc3bdf8ba97d..000000000000 ---- a/clang/test/bindings/python/lit.local.cfg -+++ /dev/null -@@ -1,41 +0,0 @@ --def is_libclang_loadable(): -- # Do not try to run if libclang was built with sanitizers because -- # the sanitizer library will likely be loaded too late to perform -- # interception and will then fail. -- # We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't -- # portable so its easier just to not run the tests when building -- # with ASan. -- if config.llvm_use_sanitizer != "": -- return False -- try: -- sys.path.append(os.path.join(config.clang_src_dir, "bindings/python")) -- from clang.cindex import Config -- conf = Config() -- Config.set_library_path(config.clang_lib_dir) -- conf.lib -- return True -- except Exception as e: -- # Expected failure modes are considered benign when nothing can be -- # done about them. -- # -- # Cannot load a 32-bit libclang.so into a 64-bit python. -- if "wrong ELF class: ELFCLASS32" in str(e): -- return False -- # If libclang.so is missing, it must have been disabled intentionally, -- # e.g. by building with LLVM_ENABLE_PIC=OFF. -- elif "No such file or directory" in str(e): -- return False -- # Unexpected failure modes need to be investigated to either fix an -- # underlying bug or accept the failure, so return True. This causes -- # tests to run and FAIL, drawing developer attention. -- else: -- print("warning: unhandled failure in is_libclang_loadable: " -- + str(e), file=sys.stderr) -- return True -- --if is_libclang_loadable(): -- config.available_features.add("libclang-loadable") -- --config.substitutions.append(('%libdir', config.clang_lib_dir)) -- --config.suffixes = ['.sh']