diff --git a/lldb/test/API/lang/swift/closures_var_not_captured/TestSwiftClosureVarNotCaptured.py b/lldb/test/API/lang/swift/closures_var_not_captured/TestSwiftClosureVarNotCaptured.py index ef96c219bd734..edf1b0589f0df 100644 --- a/lldb/test/API/lang/swift/closures_var_not_captured/TestSwiftClosureVarNotCaptured.py +++ b/lldb/test/API/lang/swift/closures_var_not_captured/TestSwiftClosureVarNotCaptured.py @@ -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( diff --git a/lldb/test/API/lang/swift/parseable_interfaces/static/Makefile b/lldb/test/API/lang/swift/parseable_interfaces/static/Makefile index d91efe1212ddf..f6e71b66736b0 100644 --- a/lldb/test/API/lang/swift/parseable_interfaces/static/Makefile +++ b/lldb/test/API/lang/swift/parseable_interfaces/static/Makefile @@ -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 @@ -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) diff --git a/lldb/test/API/lang/swift/parseable_interfaces/static/TestSwiftInterfaceStaticNoDebugInfo_part01.py b/lldb/test/API/lang/swift/parseable_interfaces/static/TestSwiftInterfaceStaticNoDebugInfo_part01.py index 7f3d99ff2d42b..b4da50c65e8c6 100644 --- a/lldb/test/API/lang/swift/parseable_interfaces/static/TestSwiftInterfaceStaticNoDebugInfo_part01.py +++ b/lldb/test/API/lang/swift/parseable_interfaces/static/TestSwiftInterfaceStaticNoDebugInfo_part01.py @@ -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() diff --git a/lldb/test/API/lang/swift/parseable_interfaces/static/TestSwiftInterfaceStaticNoDebugInfo_part02.py b/lldb/test/API/lang/swift/parseable_interfaces/static/TestSwiftInterfaceStaticNoDebugInfo_part02.py index 371fcb87607cd..922606ff0cbf0 100644 --- a/lldb/test/API/lang/swift/parseable_interfaces/static/TestSwiftInterfaceStaticNoDebugInfo_part02.py +++ b/lldb/test/API/lang/swift/parseable_interfaces/static/TestSwiftInterfaceStaticNoDebugInfo_part02.py @@ -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() diff --git a/lldb/test/API/lang/swift/parseable_interfaces/static/libs/Makefile b/lldb/test/API/lang/swift/parseable_interfaces/static/libs/Makefile index 992201aa9a230..0e81a9a596759 100644 --- a/lldb/test/API/lang/swift/parseable_interfaces/static/libs/Makefile +++ b/lldb/test/API/lang/swift/parseable_interfaces/static/libs/Makefile @@ -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 @@ -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) $@ $< diff --git a/lldb/test/API/lang/swift/protocols/stepping_through_witness/TestSwiftSteppingThroughWitness.py b/lldb/test/API/lang/swift/protocols/stepping_through_witness/TestSwiftSteppingThroughWitness.py index 010728786a197..d88baf709d0f5 100644 --- a/lldb/test/API/lang/swift/protocols/stepping_through_witness/TestSwiftSteppingThroughWitness.py +++ b/lldb/test/API/lang/swift/protocols/stepping_through_witness/TestSwiftSteppingThroughWitness.py @@ -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 diff --git a/lldb/test/API/lang/swift/runtime_library_path/TestSwiftRuntimeLibraryPath.py b/lldb/test/API/lang/swift/runtime_library_path/TestSwiftRuntimeLibraryPath.py index bcd3faa7e6955..03f5cb99fc3d6 100644 --- a/lldb/test/API/lang/swift/runtime_library_path/TestSwiftRuntimeLibraryPath.py +++ b/lldb/test/API/lang/swift/runtime_library_path/TestSwiftRuntimeLibraryPath.py @@ -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.""" @@ -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 diff --git a/lldb/test/API/lang/swift/typealias_othermodule/TestSwiftTypeAliasOthermodule.py b/lldb/test/API/lang/swift/typealias_othermodule/TestSwiftTypeAliasOthermodule.py index aac84a98a8542..ebe78cdc729e3 100644 --- a/lldb/test/API/lang/swift/typealias_othermodule/TestSwiftTypeAliasOthermodule.py +++ b/lldb/test/API/lang/swift/typealias_othermodule/TestSwiftTypeAliasOthermodule.py @@ -3,7 +3,6 @@ import lldbsuite.test.lldbutil as lldbutil -@skipIfWindows # rdar://177523573 class TestSwiftTypeAliasOtherModule(TestBase): NO_DEBUG_INFO_TESTCASE = True @@ -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()