JDevlieghere created this revision.
JDevlieghere added reviewers: davide, jasonmolenda.
Herald added subscribers: pengfei, kristof.beyls.
Herald added a project: All.
JDevlieghere requested review of this revision.

Starting with Xcode 14, ld64 is using authenticated fixups for x86_64 as well 
as arm64 (where that has always been the case). This results in 4 test failures 
when switching to an Xcode 14 toolchain:

  Failed Tests (4):
    lldb-api :: commands/target/basic/TestTargetCommand.py
    lldb-api :: functionalities/return-value/TestReturnValue.py
    lldb-api :: lang/c/global_variables/TestGlobalVariables.py
    lldb-api :: lang/cpp/char8_t/TestCxxChar8_t.py

This tests marks them as XFAIL based on the ld64 version.


https://reviews.llvm.org/D131741

Files:
  lldb/packages/Python/lldbsuite/test/decorators.py
  lldb/test/API/commands/target/basic/TestTargetCommand.py
  lldb/test/API/lang/c/global_variables/TestGlobalVariables.py
  lldb/test/API/lang/cpp/char8_t/TestCxxChar8_t.py

Index: lldb/test/API/lang/cpp/char8_t/TestCxxChar8_t.py
===================================================================
--- lldb/test/API/lang/cpp/char8_t/TestCxxChar8_t.py
+++ lldb/test/API/lang/cpp/char8_t/TestCxxChar8_t.py
@@ -14,6 +14,7 @@
 
     @skipIf(compiler="clang", compiler_version=['<', '7.0'])
     @expectedFailureDarwin(archs=["arm64", "arm64e"]) # <rdar://problem/37773624>
+    @expectedFailureDarwin(archs=['x86_64'], ld64_version=['>=', '800'])
     def test_without_process(self):
         """Test that C++ supports char8_t without a running process."""
         self.build()
Index: lldb/test/API/lang/c/global_variables/TestGlobalVariables.py
===================================================================
--- lldb/test/API/lang/c/global_variables/TestGlobalVariables.py
+++ lldb/test/API/lang/c/global_variables/TestGlobalVariables.py
@@ -20,6 +20,7 @@
 
     @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
     @expectedFailureDarwin(archs=["arm64", "arm64e"]) # <rdar://problem/37773624>
+    @expectedFailureDarwin(archs=['x86_64'], ld64_version=['>=', '800'])
     def test_without_process(self):
         """Test that static initialized variables can be inspected without
         process."""
Index: lldb/test/API/commands/target/basic/TestTargetCommand.py
===================================================================
--- lldb/test/API/commands/target/basic/TestTargetCommand.py
+++ lldb/test/API/commands/target/basic/TestTargetCommand.py
@@ -43,6 +43,7 @@
         self.do_target_command()
 
     @expectedFailureDarwin(archs=["arm64", "arm64e"]) # <rdar://problem/37773624>
+    @expectedFailureDarwin(archs=['x86_64'], ld64_version=['>=', '800'])
     def test_target_variable_command(self):
         """Test 'target variable' command before and after starting the inferior."""
         d = {'C_SOURCES': 'globals.c', 'EXE': self.getBuildArtifact('globals')}
Index: lldb/packages/Python/lldbsuite/test/decorators.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -108,6 +108,14 @@
     return True
 
 
+def getLd64Version():
+    output = subprocess.check_output(['xcrun', 'ld', '-v'], stderr=subprocess.STDOUT).decode("utf-8")
+    m = re.search('PROJECT:ld64-([\d.]+)', output)
+    if m:
+        return m.group(1)
+    return None
+
+
 def expectedFailure(func):
     return unittest2.expectedFailure(func)
 
@@ -167,7 +175,6 @@
     else:
         return skipTestIfFn_impl
 
-
 def _decorateTest(mode,
                   bugnumber=None, oslist=None, hostoslist=None,
                   compiler=None, compiler_version=None,
@@ -175,6 +182,7 @@
                   debug_info=None,
                   swig_version=None, py_version=None,
                   macos_version=None,
+                  ld64_version=None,
                   remote=None, dwarf_version=None,
                   setting=None):
     def fn(self):
@@ -211,6 +219,11 @@
                 macos_version[0],
                 macos_version[1],
                 platform.mac_ver()[0])))
+        skip_for_ld64_version = (ld64_version is None) or (
+            (_check_expected_version(
+                ld64_version[0],
+                ld64_version[1],
+                getLd64Version())))
         skip_for_dwarf_version = (dwarf_version is None) or (
             _check_expected_version(dwarf_version[0], dwarf_version[1],
                                     self.getDwarfVersion()))
@@ -229,6 +242,7 @@
                       (swig_version, skip_for_swig_version, "swig version"),
                       (py_version, skip_for_py_version, "python version"),
                       (macos_version, skip_for_macos_version, "macOS version"),
+                      (ld64_version, skip_for_ld64_version, "ld64 version"),
                       (remote, skip_for_remote, "platform locality (remote/local)"),
                       (dwarf_version, skip_for_dwarf_version, "dwarf version"),
                       (setting, skip_for_setting, "setting")]
@@ -275,6 +289,7 @@
                        debug_info=None,
                        swig_version=None, py_version=None,
                        macos_version=None,
+                       ld64_version=None,
                        remote=None, dwarf_version=None,
                        setting=None):
     return _decorateTest(DecorateMode.Xfail,
@@ -285,6 +300,7 @@
                          debug_info=debug_info,
                          swig_version=swig_version, py_version=py_version,
                          macos_version=macos_version,
+                         ld64_version=ld64_version,
                          remote=remote,dwarf_version=dwarf_version,
                          setting=setting)
 
@@ -302,6 +318,7 @@
            debug_info=None,
            swig_version=None, py_version=None,
            macos_version=None,
+           ld64_version=None,
            remote=None, dwarf_version=None,
            setting=None):
     return _decorateTest(DecorateMode.Skip,
@@ -312,6 +329,7 @@
                          debug_info=debug_info,
                          swig_version=swig_version, py_version=py_version,
                          macos_version=macos_version,
+                         ld64_version=ld64_version,
                          remote=remote, dwarf_version=dwarf_version,
                          setting=setting)
 
@@ -408,16 +426,18 @@
         bugnumber=None,
         compilers=None,
         debug_info=None,
+        ld64_version=None,
         archs=None):
     return expectedFailureAll(
         oslist=oslist,
         bugnumber=bugnumber,
         compiler=compilers,
         archs=archs,
-        debug_info=debug_info)
+        debug_info=debug_info,
+        ld64_version=ld64_version)
 
 
-def expectedFailureDarwin(bugnumber=None, compilers=None, debug_info=None, archs=None):
+def expectedFailureDarwin(bugnumber=None, compilers=None, debug_info=None, archs=None, ld64_version=None):
     # For legacy reasons, we support both "darwin" and "macosx" as OS X
     # triples.
     return expectedFailureOS(
@@ -425,6 +445,7 @@
         bugnumber,
         compilers,
         debug_info=debug_info,
+        ld64_version=ld64_version,
         archs=archs)
 
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to