Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def test_async_closure(self):

@skipEmbeddedSwift
@swiftTest
# Async variable inspection on Linux/Windows are still problematic.
@skipIf(oslist=["windows", "linux"])
# Async variable inspection on Linux are still problematic.
@skipIfLinux
def test_task_inside_non_async_func(self):
self.build()
(target, process, thread) = self.get_to_bkpt(
Expand Down
35 changes: 24 additions & 11 deletions lldb/test/API/lang/swift/parseable_interfaces/static/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
EXE := main
SWIFT_SOURCES := main.swift

ifeq "$(OS)" "Windows_NT"
LD_EXTRAS = -Xlinker /LIBPATH:$(BUILDDIR) AA.lib BB.lib CC.lib
BB_SWIFTFLAGS_EXTRAS = -I$(BUILDDIR) -enable-library-evolution -static
BB_LD_EXTRAS = -Xlinker /LIBPATH:$(BUILDDIR)
else
LD_EXTRAS = -L$(BUILDDIR) -lAA -lBB -lCC
BB_SWIFTFLAGS_EXTRAS = -I$(BUILDDIR)
BB_LD_EXTRAS = -L$(BUILDDIR)
endif

SWIFTFLAGS_EXTRAS = -I$(BUILDDIR)
SWIFT_MODULE_CACHE_FLAGS = -module-cache-path MCP

Expand All @@ -9,41 +19,44 @@ all: setup staticA staticB staticC clear_modules

include Makefile.rules

# Copy the source files into the build directory because we delete them, to be
# really sure we only have/use the .dylibs and .swiftinterfaces.
setup:
# copy the source files into the build directory because we delete them
# to be really sure we only have/use the .dylibs and .swiftinterfaces
$(call MKDIR_P,libs)
$(call CP,$(SRCDIR)/libs/A.swift,libs/AA.swift)
$(call CP,$(SRCDIR)/libs/B.swift,libs/BB.swift)
$(call CP,$(SRCDIR)/libs/C.swift,libs/CC.swift)

# Because we override VPATH to point to the build directory, we need to pass
# down SWIFTC too (its default value is relative to VPATH).
staticA:
# Because we override VPATH to point to the build directory, we need to pass
# down SWIFTC too (it's default value is relative to VPATH)
"$(MAKE)" MAKE_DSYM=$(MAKE_DSYM) CC=$(CC) SWIFTC=$(SWIFTC) \
ARCH=$(ARCH) DSYMUTIL=$(DSYMUTIL) VPATH=$(BUILDDIR) \
SWIFTSDKROOT=$(SWIFTSDKROOT) \
SWIFTSDKROOT="$(SWIFTSDKROOT)" \
SWIFT_MODULE_CACHE_FLAGS="$(SWIFT_MODULE_CACHE_FLAGS)" \
BASENAME=AA -f $(SRCDIR)/libs/Makefile static_only

# BB imports AA, so it needs the build dir on its search path. A command-line
# assignment overrides the sub-Makefile's own SWIFTFLAGS_EXTRAS outright, so
# pass its flags through here too rather than losing them.
staticB:
"$(MAKE)" MAKE_DSYM=$(MAKE_DSYM) CC=$(CC) SWIFTC=$(SWIFTC) \
ARCH=$(ARCH) DSYMUTIL=$(DSYMUTIL) VPATH=$(BUILDDIR) \
SWIFTSDKROOT=$(SWIFTSDKROOT) \
SWIFTSDKROOT="$(SWIFTSDKROOT)" \
SWIFT_MODULE_CACHE_FLAGS="$(SWIFT_MODULE_CACHE_FLAGS)" \
BASENAME=BB SWIFTFLAGS_EXTRAS="-I$(BUILDDIR)" \
LD_EXTRAS="-L$(BUILDDIR)" -f $(SRCDIR)/libs/Makefile static_only
BASENAME=BB SWIFTFLAGS_EXTRAS="$(BB_SWIFTFLAGS_EXTRAS)" \
LD_EXTRAS="$(BB_LD_EXTRAS)" -f $(SRCDIR)/libs/Makefile static_only

staticC:
"$(MAKE)" MAKE_DSYM=$(MAKE_DSYM) CC=$(CC) SWIFTC=$(SWIFTC) \
ARCH=$(ARCH) DSYMUTIL=$(DSYMUTIL) VPATH=$(BUILDDIR) \
SWIFTSDKROOT=$(SWIFTSDKROOT) \
SWIFTSDKROOT="$(SWIFTSDKROOT)" \
SWIFT_MODULE_CACHE_FLAGS="$(SWIFT_MODULE_CACHE_FLAGS)" \
BASENAME=CC -f $(SRCDIR)/libs/Makefile static_only

# Make sure we only have .swiftinterface files for the generated modules:
# remove the copied sources and the swiftmodules from the build directory.
clear_modules:
# make sure we only have .swiftinterface files for the generated modules:
# remove the copied sources and the swiftmodules from the build directory
$(call RM_F,*.swiftmodule)
$(call RM_RF,libs)
$(call RM_RF,MCP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def do_test(self):

@skipEmbeddedSwift
@swiftTest
@skipIfWindows
def test_swift_interface(self):
"""Test that we load and handle modules that only have textual .swiftinterface files"""
self.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def do_test(self):

@skipEmbeddedSwift
@swiftTest
@skipIfWindows
def test_swift_interface_fallback(self):
"""Test that we fall back to load from the .swiftinterface file if the .swiftmodule is invalid"""
self.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ DYLIB_SWIFT_SOURCES := libs/$(BASENAME).swift
# Don't use -g for the libraries in this test.
DEBUG_INFO_FLAG :=
SWIFTFLAGS_EXTRAS := -enable-library-evolution
ifeq "$(OS)" "Windows_NT"
SWIFTFLAGS_EXTRAS += -static
endif

# Don't include the wrapped .swiftmodule on Linux to make sure we use
# the .swiftinterface. The issue here is that if the .swiftmodule is wrapped
Expand All @@ -16,7 +19,11 @@ DYLIB_HIDE_SWIFTMODULE=1
include Makefile.rules

# These are *not* Makefile.rules config variables.
ARCHIVE_NAME := lib$(BASENAME).a
ifeq "$(OS)" "Windows_NT"
ARCHIVE_NAME := $(BASENAME).lib
else
ARCHIVE_NAME := lib$(BASENAME).a
endif
ARCHIVE_OBJECTS := $(strip $(DYLIB_SWIFT_SOURCES:.swift=.swift.o))
$(ARCHIVE_NAME): $(ARCHIVE_OBJECTS) $(BASENAME).swiftmodule
$(AR) $(ARFLAGS) $@ $<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import lldb
import platform
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
import lldbsuite.test.lldbutil as lldbutil


@skipIf(oslist=["windows", "linux"])
@skipIfLinux
@skipIfAsan
class TestSwiftSteppingThroughWitness(TestBase):

def setUp(self):
TestBase.setUp(self)
lib_name = self.platformContext.getFullLibName("swift_Concurrency")
self.runCmd(
"settings set target.process.thread.step-avoid-libraries libswift_Concurrency.dylib"
f"settings set target.process.thread.step-avoid-libraries {lib_name}"
)

@skipEmbeddedSwift
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TestSwiftRuntimeLibraryPath(lldbtest.TestBase):
NO_DEBUG_INFO_TESTCASE = True

@swiftTest
@skipUnlessDarwin
@skipEmbeddedSwift
def test(self):
"""Test that the default runtime library path can be recovered even if
paths weren't serialized."""
Expand All @@ -26,4 +26,4 @@ def test(self):

self.expect("expression 1")
self.filecheck_log(log, __file__)
# CHECK: SwiftASTContextForExpressions(module: "a", cu: "main.swift")::LogConfiguration(){{.*}}Runtime library paths{{.*}}2 items
# CHECK: SwiftASTContextForExpressions(module: "a", cu: "main.swift")::LogConfiguration(){{.*}}Runtime library paths{{.*}}{{[1-9][0-9]*}} items
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import lldbsuite.test.lldbutil as lldbutil


@skipIfWindows # rdar://177523573
class TestSwiftTypeAliasOtherModule(TestBase):
NO_DEBUG_INFO_TESTCASE = True

Expand All @@ -21,6 +20,7 @@ def test_frame_variable(self):

@skipEmbeddedSwift
@swiftTest
@skipIfWindows # rdar://177523573
def test_expression(self):
"""Test that type aliases can be imported into expressions from reflection metadata"""
self.build()
Expand Down