Skip to content
Open
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
3 changes: 3 additions & 0 deletions lldb/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ llvm_canonicalize_cmake_booleans(
llvm_canonicalize_cmake_booleans(
LLDB_ENABLE_SWIFT_SUPPORT
)

set(LLDB_SWIFT_DRIVER_EXTRA_FLAGS "" CACHE STRING

Choose a reason for hiding this comment

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

Since this is meant to affect how tests are built, the more idiomatic way would be to use LLDB_TEST_USER_ARGS. The https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-matrix bot uses that creatively to run the LLDB testsuite against different compilers and debug info options.

Copy link
Author

Choose a reason for hiding this comment

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

I was very excited about this, but unfortunately it seems like this only applies to API tests and the issue applies to shell tests.

"Additional swift driver arguments for LLDB shell tests")
# END SWIFT

# Configure the individual test suites.
Expand Down
3 changes: 3 additions & 0 deletions lldb/test/Shell/helper/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ def use_support_substitutions(config):
swift_driver_args = []
if platform.system() in ["Darwin"]:
swift_args += ["-sdk", sdk_path]
swift_driver_extra_args = getattr(config, "swift_driver_extra_args", [])
if swift_driver_extra_args:
swift_args += swift_driver_extra_args
tools = [
ToolSubst(
"%target-swiftc",
Expand Down
4 changes: 4 additions & 0 deletions lldb/test/Shell/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ config.python_executable = "@Python3_EXECUTABLE@"
config.python_root_dir = "@Python3_ROOT_DIR@"
config.swiftc = "@LLDB_SWIFTC@"
config.swift_libs_dir = '@LLDB_SWIFT_LIBS@'
# BEGIN SWIFT
_swift_driver_flags = lit_config.substitute("@LLDB_SWIFT_DRIVER_EXTRA_FLAGS@")

Choose a reason for hiding this comment

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

Please mark all Swift-specific additions in generic code with

# BEGIN SWIFT
...
# END SWIFT

This makes resolving merge conflicts much easier.

Choose a reason for hiding this comment

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

(I realize this file isn't doing that, but let's add it now)

Copy link
Author

Choose a reason for hiding this comment

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

Done

config.swift_driver_extra_args = [flag.strip() for flag in _swift_driver_flags.split(";") if flag.strip()]
# END SWIFT
config.lldb_enable_swift = @LLDB_ENABLE_SWIFT_SUPPORT@
config.have_zlib = @LLVM_ENABLE_ZLIB@
config.objc_gnustep_dir = "@LLDB_TEST_OBJC_GNUSTEP_DIR@"
Expand Down