Author: Alex Langford
Date: 2026-06-17T15:54:54-07:00
New Revision: d9d54466071219fd4093780ca068193f60d2dc71

URL: 
https://github.com/llvm/llvm-project/commit/d9d54466071219fd4093780ca068193f60d2dc71
DIFF: 
https://github.com/llvm/llvm-project/commit/d9d54466071219fd4093780ca068193f60d2dc71.diff

LOG: [lldb] Only run libc++ tests when the architecture matches (#204267)

It does not make sense to run the libc++ tests when the libc++ dylib has
an architecture that does not match the test binary.

I ran into this when running the test suite with arm64e test binaries
and the locally-built libc++ is built arm64.

---------

Co-authored-by: Dave Lee <[email protected]>

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/dotest.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/dotest.py 
b/lldb/packages/Python/lldbsuite/test/dotest.py
index d2bcc98bde900..b1145f8f96078 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -832,6 +832,22 @@ def canRunLibcxxTests():
     if lldbplatformutil.platformIsDarwin():
         if not configuration.libcxx_include_dir or not 
configuration.libcxx_library_dir:
             return False, "libc++ tests require a locally built libc++"
+
+        # Check that the libc++ architecture matches the test architecture.
+        test_architecture = lldbplatformutil.getArchitecture()
+
+        libcxx_dylib_path = os.path.join(
+            configuration.libcxx_library_dir, "libc++.dylib"
+        )
+        try:
+            libcxx_arch_list = subprocess.check_output(
+                ["lipo", "-archs", libcxx_dylib_path], text=True
+            ).split()
+            if test_architecture not in libcxx_arch_list:
+                return False, f"libc++ dylib missing {test_architecture} slice"
+        except subprocess.CalledProcessError:
+            return False, "libc++ dylib is not present"
+
         return True, "libc++ present"
 
     if platform == "linux":


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to