Skip to content

Commit ae4d09b

Browse files
committed
Fix test on Apple Silicon
1 parent 6572b9d commit ae4d09b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lldb/test/API/lang/swift/deployment_target/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
all: libNewerTarget.dylib a.out dlopen_module
22

33
SWIFT_SOURCES=main.swift
4-
SWIFTFLAGS_EXTRAS=-target x86_64-apple-macosx10.10 -Xfrontend -disable-target-os-checking -I$(BUILDDIR)
4+
SWIFTFLAGS_EXTRAS=-target $(ARCH)-apple-macosx11.0 -Xfrontend -disable-target-os-checking -I$(BUILDDIR)
55
LD_EXTRAS=-lNewerTarget -L$(BUILDDIR)
66

77
include Makefile.rules
88

9-
# This test only works on macOS 10.11+.
9+
# This test only works on macOS 11.1+.
1010

1111
a.out: main.swift libNewerTarget.dylib
1212

@@ -23,7 +23,7 @@ lib%.dylib: %.swift
2323
DYLIB_ONLY=YES \
2424
DYLIB_NAME=$(patsubst lib%.dylib,%,$@) \
2525
DYLIB_SWIFT_SOURCES=$(patsubst lib%.dylib,%.swift,$@) \
26-
SWIFTFLAGS_EXTRAS="-target x86_64-apple-macosx10.11"
26+
SWIFTFLAGS_EXTRAS="-target $(ARCH)-apple-macosx11.1"
2727

2828
clean::
2929
rm -rf *.swiftmodule *.swiftdoc *.dSYM *~ lib*.dylib a.out dlopen_module *.o

lldb/test/API/lang/swift/deployment_target/TestSwiftDeploymentTarget.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class TestSwiftDeploymentTarget(TestBase):
2929
setting=('symbols.use-swift-clangimporter', 'false'))
3030
@skipUnlessDarwin
3131
@skipIfDarwinEmbedded # This test uses macOS triples explicitly.
32-
@skipIf(macos_version=["<", "10.11"])
32+
@skipIf(macos_version=["<", "11.1"])
3333
@swiftTest
3434
def test_swift_deployment_target(self):
3535
self.build()
@@ -42,7 +42,7 @@ def test_swift_deployment_target(self):
4242
setting=('symbols.use-swift-clangimporter', 'false'))
4343
@skipUnlessDarwin
4444
@skipIfDarwinEmbedded # This test uses macOS triples explicitly.
45-
@skipIf(macos_version=["<", "10.11"])
45+
@skipIf(macos_version=["<", "11.1"])
4646
@swiftTest
4747
def test_swift_deployment_target_dlopen(self):
4848
self.build()
@@ -55,7 +55,7 @@ def test_swift_deployment_target_dlopen(self):
5555

5656
@skipUnlessDarwin
5757
@skipIfDarwinEmbedded # This test uses macOS triples explicitly.
58-
@skipIf(macos_version=["<", "10.11"])
58+
@skipIf(macos_version=["<", "11.1"])
5959
@swiftTest
6060
def test_swift_deployment_target_from_macho(self):
6161
self.build(dictionary={"MAKE_DSYM": "NO"})
@@ -70,10 +70,11 @@ def test_swift_deployment_target_from_macho(self):
7070
found_no_ast = False
7171
found_triple = False
7272
logfile = open(log, "r")
73+
print (log)
7374
for line in logfile:
7475
if 'SwiftASTContextForModule("a.out")::DeserializeAllCompilerFlags() -- Found 0 AST file data entries.' in line:
7576
found_no_ast = True
76-
if 'SwiftASTContextForModule("a.out")::SetTriple("x86_64-apple-macosx10.10.0")' in line:
77+
if 'SwiftASTContextForModule("a.out")::SetTriple(' in line and 'apple-macosx11.0' in line:
7778
found_triple = True
7879
self.assertTrue(found_no_ast)
7980
self.assertTrue(found_triple)

0 commit comments

Comments
 (0)