Skip to content

[lldb] Disable tests affected by ld_new bug #8610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# System modules
import itertools
import json
import re
import subprocess
import sys
Expand All @@ -18,6 +19,7 @@
from . import lldbtest_config
import lldbsuite.test.lldbplatform as lldbplatform
from lldbsuite.test.builders import get_builder
from lldbsuite.test.lldbutil import is_exe


def check_first_register_readable(test_case):
Expand Down Expand Up @@ -332,4 +334,26 @@ def expectedCompiler(compilers):
if compiler in getCompiler():
return True

# This is a helper function to determine if a specific version of Xcode's linker
# contains a TLS bug. We want to skip TLS tests if they contain this bug, but
# adding a linker/linker_version conditions to a decorator is challenging due to
# the number of ways linkers can enter the build process.
def xcode15LinkerBug(_self=None):
"""Returns true iff a test is running on a darwin platform and the host linker is between versions 1000 and 1109."""
darwin_platforms = lldbplatform.translate(lldbplatform.darwin_all)
if getPlatform() not in darwin_platforms:
return False

try:
raw_version_details = subprocess.check_output(
("xcrun", "ld", "-version_details")
)
version_details = json.loads(raw_version_details)
version = version_details.get("version", "0")
version_tuple = tuple(int(x) for x in version.split("."))
if (1000,) <= version_tuple <= (1109,):
return True
except:
pass

return False
2 changes: 1 addition & 1 deletion lldb/test/API/lang/c/tls_globals/TestTlsGlobals.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def setUp(self):
bugnumber="llvm.org/pr28392",
oslist=no_match(lldbplatformutil.getDarwinOSTriples()),
)
@expectedFailureDarwin("rdar://120676969")
@expectedFailureIfFn(lldbplatformutil.xcode15LinkerBug)
def test(self):
"""Test thread-local storage."""
self.build()
Expand Down
4 changes: 1 addition & 3 deletions lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Test handing of dwarf expressions specifying the location of registers, if
# those expressions refer to the frame's CFA value.

# UNSUPPORTED: system-windows
# UNSUPPORTED: system-windows, ld_new-bug
# REQUIRES: target-x86_64, native
# XFAIL: system-darwin
# See: rdar://120797300

# RUN: %clang_host %p/Inputs/call-asm.c %p/Inputs/eh-frame-dwarf-unwind.s -o %t
# RUN: %lldb %t -s %s -o exit | FileCheck %s
Expand Down
4 changes: 1 addition & 3 deletions lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
# points to non-executable memory.

# REQUIRES: target-x86_64
# UNSUPPORTED: system-windows
# XFAIL: system-darwin
# See: rdar://120797300
# UNSUPPORTED: system-windows, ld_new-bug

# RUN: %clang_host %p/Inputs/call-asm.c -x assembler-with-cpp %p/Inputs/thread-step-out-ret-addr-check.s -o %t
# RUN: not %lldb %t -s %s -b 2>&1 | FileCheck %s
Expand Down
16 changes: 16 additions & 0 deletions lldb/test/Shell/lit.cfg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- Python -*-

import json
import os
import platform
import re
Expand Down Expand Up @@ -194,3 +195,18 @@ def calculate_arch_features(arch_string):

if "LD_PRELOAD" in os.environ:
config.available_features.add("ld_preload-present")

# Determine if a specific version of Xcode's linker contains a bug. We want to
# skip affected tests if they contain this bug.
if platform.system() == "Darwin":
try:
raw_version_details = subprocess.check_output(
("xcrun", "ld", "-version_details")
)
version_details = json.loads(raw_version_details)
version = version_details.get("version", "0")
version_tuple = tuple(int(x) for x in version.split("."))
if (1000,) <= version_tuple <= (1109,):
config.available_features.add("ld_new-bug")
except:
pass