Skip to content

Commit 81edba6

Browse files
author
git apple-llvm automerger
committed
Merge commit 'ccbec21b9f6d' from swift/release/5.3 into swift/master
2 parents 781480b + ccbec21 commit 81edba6

File tree

108 files changed

+11
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+11
-604
lines changed

lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,12 @@ endif
825825
$(DYLIB_FILENAME) : $(DYLIB_OBJECTS)
826826
@echo "### Linking dynamic library $(DYLIB_NAME)"
827827
ifneq "$(EXCLUDE_WRAPPED_SWIFTMODULE)" ""
828-
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -emit-library $(DYLIB_SWIFT_FLAGS) -o $@ \
828+
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -toolchain-stdlib-rpath \
829+
-emit-library $(DYLIB_SWIFT_FLAGS) -o $@ \
829830
$(patsubst %.swiftmodule.o,,$^)
830831
else
831-
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -emit-library $(DYLIB_SWIFT_FLAGS) -o $@ $^
832+
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -toolchain-stdlib-rpath \
833+
-emit-library $(DYLIB_SWIFT_FLAGS) -o $@ $^
832834
endif
833835
ifneq "$(CODESIGN)" ""
834836
$(CODESIGN) -s - "$(DYLIB_FILENAME)"

lldb/test/API/lang/swift/address_of/TestSwiftAddressOf.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,3 @@ def test_any_type(self):
9393
# the inout type appears as direct.
9494
self.check_variable("in_struct", False, 12345)
9595

96-
97-
98-
if __name__ == '__main__':
99-
import atexit
100-
lldb.SBDebugger.Initialize()
101-
atexit.register(lldb.SBDebugger.Terminate)
102-
unittest2.main()

lldb/test/API/lang/swift/any/TestSwiftAnyType.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,3 @@ def test_any_type(self):
4040

4141
self.expect("expression -d run -- q", substrs=['12'])
4242
self.expect("frame variable -d run -- q", substrs=['12'])
43-
44-
if __name__ == '__main__':
45-
import atexit
46-
lldb.SBDebugger.Initialize()
47-
atexit.register(lldb.SBDebugger.Terminate)
48-
unittest2.main()

lldb/test/API/lang/swift/any_object/TestSwiftAnyObjectType.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,3 @@ def test_any_object_type(self):
5555
use_dynamic=False,
5656
value='12',
5757
typename="Swift.Int")
58-
59-
if __name__ == '__main__':
60-
import atexit
61-
lldb.SBDebugger.Initialize()
62-
atexit.register(lldb.SBDebugger.Terminate)
63-
unittest2.main()

lldb/test/API/lang/swift/archetype_resolution/TestSwiftArchetypeResolution.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,3 @@ def test_swift_archetype_resolution(self):
120120
self.assertTrue(var_x.GetValue() == 'A', "GE case fails")
121121
if self.TraceOn():
122122
self.runCmd("frame variable -d run")
123-
124-
if __name__ == '__main__':
125-
import atexit
126-
lldb.SBDebugger.Initialize()
127-
atexit.register(lldb.SBDebugger.Terminate)
128-
unittest2.main()

lldb/test/API/lang/swift/associated_type_resolution/TestSwiftAssociatedTypeResolution.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,3 @@ def test_swift_associated_type_resolution(self):
5151
(i, var.GetError().GetCString()))
5252
value = child.GetValueAsUnsigned()
5353
self.assertEqual(value, i, "Wrong value: %d not %d."%(value, i))
54-
55-
if __name__ == '__main__':
56-
import atexit
57-
lldb.SBDebugger.Initialize()
58-
atexit.register(lldb.SBDebugger.Terminate)
59-
unittest2.main()

lldb/test/API/lang/swift/backwards_compatibility/simple/TestSwiftBackwardsCompatibilitySimple.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,3 @@ def test_simple(self):
4545
# FIXME: This doesn't work.
4646
#self.expect("fr v generic", substrs=['-1'])
4747

48-
if __name__ == '__main__':
49-
import atexit
50-
lldb.SBDebugger.Initialize()
51-
atexit.register(lldb.SBDebugger.Terminate)
52-
unittest2.main()

lldb/test/API/lang/swift/break_by_partial_name/TestSwiftBreakByPartialName.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,3 @@ def break_commands(self):
5555
self.runCmd("continue", RUN_SUCCEEDED)
5656

5757
self.expect("frame select 0", substrs=['Accumulator', 'incr'])
58-
59-
if __name__ == '__main__':
60-
import atexit
61-
lldb.SBDebugger.Initialize()
62-
atexit.register(lldb.SBDebugger.Terminate)
63-
unittest2.main()

lldb/test/API/lang/swift/bt_printing/TestSwiftBacktracePrinting.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,3 @@ def do_test(self):
5858
'arg1=12', 'arg2="Hello world"'])
5959
self.expect("breakpoint set -p other", substrs=['g<U, T>'])
6060

61-
if __name__ == '__main__':
62-
import atexit
63-
lldb.SBDebugger.Initialize()
64-
atexit.register(lldb.SBDebugger.Terminate)
65-
unittest2.main()

lldb/test/API/lang/swift/clangimporter/bridging_header_headermap/TestSwiftBridgingHeaderHeadermap.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,3 @@ def test(self):
5555
substrs=['(dylib.C<a.Wrapper>.Something)', "hello"])
5656
self.assertTrue(os.path.isdir(mod_cache), "module cache exists")
5757

58-
59-
if __name__ == '__main__':
60-
import atexit
61-
lldb.SBDebugger.Initialize()
62-
atexit.register(lldb.SBDebugger.Terminate)
63-
unittest2.main()

lldb/test/API/lang/swift/clangimporter/config_macros/TestSwiftDedupMacros.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,3 @@ def testSwiftDebugMacros(self):
8181
self.assertTrue(space == 1)
8282
self.assertTrue(space_with_space == 0)
8383
self.assertTrue(ndebug == 1)
84-
85-
if __name__ == '__main__':
86-
import atexit
87-
lldb.SBDebugger.Initialize()
88-
atexit.register(lldb.SBDebugger.Terminate)
89-
unittest2.main()

lldb/test/API/lang/swift/clangimporter/headermap_conflict/TestSwiftHeadermapConflict.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,3 @@ def test(self):
6565
self.assertTrue((not value.GetError().Success()) or
6666
not value.GetSummary())
6767
self.runCmd("settings set symbols.use-swift-dwarfimporter true")
68-
69-
70-
if __name__ == '__main__':
71-
import atexit
72-
lldb.SBDebugger.Initialize()
73-
atexit.register(lldb.SBDebugger.Terminate)
74-
unittest2.main()

lldb/test/API/lang/swift/clangimporter/include_conflict/TestSwiftIncludeConflict.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,3 @@ def test(self):
6464
self.assertTrue((not value.GetError().Success()) or
6565
not value.GetSummary())
6666
self.runCmd("settings set symbols.use-swift-dwarfimporter true")
67-
68-
69-
if __name__ == '__main__':
70-
import atexit
71-
lldb.SBDebugger.Initialize()
72-
atexit.register(lldb.SBDebugger.Terminate)
73-
unittest2.main()

lldb/test/API/lang/swift/clangimporter/macro_conflict/TestSwiftMacroConflict.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,3 @@ def test_with_dwarfimporter(self):
9393
self.expect("v foo", substrs=["42"])
9494
self.assertTrue(os.path.isdir(mod_cache), "module cache exists")
9595
lldb.SBDebugger.MemoryPressureDetected()
96-
97-
if __name__ == '__main__':
98-
import atexit
99-
lldb.SBDebugger.Initialize()
100-
atexit.register(lldb.SBDebugger.Terminate)
101-
unittest2.main()

lldb/test/API/lang/swift/clangimporter/objcmain_conflicting_dylibs/TestSwiftObjCMainConflictingDylibs.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,3 @@ def test(self):
7171
self.expect("p baz", "correct baz", substrs=["i_am_from_Foo"])
7272
self.expect("fr var baz", "correct baz", substrs=["i_am_from_Foo"])
7373

74-
75-
if __name__ == '__main__':
76-
import atexit
77-
lldb.SBDebugger.Initialize()
78-
atexit.register(lldb.SBDebugger.Terminate)
79-
unittest2.main()

lldb/test/API/lang/swift/clangimporter/objcmain_conflicting_dylibs_bridging_headers/TestSwiftObjCMainConflictingDylibsBridgingHeader.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,3 @@ def test(self):
6060
self.expect("p foo", "expected result", substrs=["23"])
6161
self.expect("p $R6", "expected result", substrs=["23"])
6262
self.expect("p $R8", "expected result", substrs=["23"])
63-
64-
if __name__ == '__main__':
65-
import atexit
66-
lldb.SBDebugger.Initialize()
67-
atexit.register(lldb.SBDebugger.Terminate)
68-
unittest2.main()

lldb/test/API/lang/swift/clangimporter/objcmain_conflicting_dylibs_failing_import/TestSwiftObjCMainConflictingDylibsFailingImport.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,3 @@ def test(self):
7676
self.expect("p $R6", "expected result", substrs=["23"])
7777
self.expect("p $R8", "expected result", substrs=["23"])
7878

79-
if __name__ == '__main__':
80-
import atexit
81-
lldb.SBDebugger.Initialize()
82-
atexit.register(lldb.SBDebugger.Terminate)
83-
unittest2.main()

lldb/test/API/lang/swift/clangimporter/remoteast_import/TestSwiftRemoteASTImport.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,3 @@ def testSwiftRemoteASTImport(self):
5050
substrs=['(Library.LibraryProtocol) $R0'])
5151
self.expect("expr -d run-target -- input",
5252
substrs=['(a.FromMainModule) $R2'])
53-
54-
if __name__ == '__main__':
55-
import atexit
56-
lldb.SBDebugger.Initialize()
57-
atexit.register(lldb.SBDebugger.Terminate)
58-
unittest2.main()

lldb/test/API/lang/swift/clangimporter/rewrite_clang_paths/TestSwiftRewriteClangPaths.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,3 @@ def dotest(self, remap):
130130
self.assertEqual(found_ovl, 2)
131131
else:
132132
self.assertTrue(errs > 0, "expected module import error")
133-
134-
if __name__ == '__main__':
135-
import atexit
136-
lldb.SBDebugger.Initialize()
137-
atexit.register(lldb.SBDebugger.Terminate)
138-
unittest2.main()

lldb/test/API/lang/swift/clangimporter/static_archive/TestSwiftStaticArchiveTwoSwiftmodules.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import lldbsuite.test.lldbutil as lldbutil
1717
import os
1818
import unittest2
19-
import shutil
2019

2120
class TestSwiftStaticArchiveTwoSwiftmodules(TestBase):
2221

@@ -56,9 +55,3 @@ def test(self):
5655
process.Continue()
5756
self.expect("fr var bar", "expected result", substrs=["42"])
5857
self.expect("p bar", "expected result", substrs=["j", "42"])
59-
60-
if __name__ == '__main__':
61-
import atexit
62-
lldb.SBDebugger.Initialize()
63-
atexit.register(lldb.SBDebugger.Terminate)
64-
unittest2.main()

lldb/test/API/lang/swift/conditional_breakpoints/TestSwiftConditionalBreakpoint.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,3 @@ def break_commands(self):
6363

6464
self.check_x_and_y(threads[0].frames[0], '3', '1')
6565

66-
if __name__ == '__main__':
67-
import atexit
68-
lldb.SBDebugger.Initialize()
69-
atexit.register(lldb.SBDebugger.Terminate)
70-
unittest2.main()

lldb/test/API/lang/swift/cross_module_extension/TestSwiftCrossModuleExtension.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,3 @@ def test_cross_module_extension(self):
6060
lldbutil.check_variable(self, var, False, typename="moda.S.A")
6161
lldbutil.check_variable(self, child_v, False, value="3")
6262

63-
if __name__ == '__main__':
64-
import atexit
65-
lldb.SBDebugger.Initialize()
66-
atexit.register(lldb.SBDebugger.Terminate)
67-
unittest2.main()

lldb/test/API/lang/swift/different_clang_flags/TestSwiftDifferentClangFlags.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,3 @@ def test_swift_different_clang_flags(self):
8383
var = self.frame().EvaluateExpression("fA()")
8484
lldbutil.check_variable(self, var, False, value="2")
8585

86-
if __name__ == '__main__':
87-
import atexit
88-
lldb.SBDebugger.Initialize()
89-
atexit.register(lldb.SBDebugger.Terminate)
90-
unittest2.main()

lldb/test/API/lang/swift/dwarfimporter/BridgingPCH/TestSwiftDWARFImporterBridgingPCH.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,3 @@ def test_dwarf_importer(self):
6363
process.Clear()
6464
target.Clear()
6565
lldb.SBDebugger.MemoryPressureDetected()
66-
67-
if __name__ == '__main__':
68-
import atexit
69-
lldb.SBDebugger.Initialize()
70-
atexit.register(lldb.SBDebugger.Terminate)
71-
unittest2.main()

lldb/test/API/lang/swift/dynamic_value/TestSwiftDynamicValue.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,3 @@ def dynamic_val_commands(self):
7979
".Base = {",
8080
"v = 449493530",
8181
"q = 3735928559"])
82-
83-
if __name__ == '__main__':
84-
import atexit
85-
lldb.SBDebugger.Initialize()
86-
atexit.register(lldb.SBDebugger.Terminate)
87-
unittest2.main()

lldb/test/API/lang/swift/expression/access_control/TestExpressionAccessControl.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,3 @@ def test_swift_expression_access_control(self):
4949
self, 'Set breakpoint here', lldb.SBFileSpec('main.swift'))
5050
self.check_expression("foo.m_a", "3", use_summary=False)
5151

52-
if __name__ == '__main__':
53-
import atexit
54-
lldb.SBDebugger.Initialize()
55-
atexit.register(lldb.SBDebugger.Terminate)
56-
unittest2.main()

lldb/test/API/lang/swift/expression/classes/fromobjc/TestSwiftExpressionsInMethodsFromObjc.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,3 @@ def test_swift_expressions_from_objc(self):
5454
self.check_expression("m_ivar", "10", use_summary=False)
5555
self.check_expression("self.m_ivar == 11", "false")
5656

57-
if __name__ == '__main__':
58-
import atexit
59-
lldb.SBDebugger.Initialize()
60-
atexit.register(lldb.SBDebugger.Terminate)
61-
unittest2.main()

lldb/test/API/lang/swift/expression/classes/pureswift/TestSwiftExpressionsInMethodsPureSwift.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,3 @@ def test_expressions_in_methods(self):
5050
self.check_expression("m_ivar", "10", use_summary=False)
5151
self.check_expression("self.m_ivar == 11", "false")
5252

53-
if __name__ == '__main__':
54-
import atexit
55-
lldb.SBDebugger.Initialize()
56-
atexit.register(lldb.SBDebugger.Terminate)
57-
unittest2.main()

lldb/test/API/lang/swift/expression/equality_operators/TestEqualityOperators.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,3 @@ def do_test(self, bkpt_name, compare_value, counter_value):
126126
value.GetSummary() == "false",
127127
"1 == 2 didn't return false.")
128128

129-
if __name__ == '__main__':
130-
import atexit
131-
lldb.SBDebugger.Initialize()
132-
atexit.register(lldb.SBDebugger.Terminate)
133-
unittest2.main()

lldb/test/API/lang/swift/expression/errors/TestExpressionErrors.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,3 @@ def do_test(self):
130130
"Expected 'Over 100', got %s" %
131131
(message.GetSummary()))
132132

133-
if __name__ == '__main__':
134-
import atexit
135-
lldb.SBDebugger.Initialize()
136-
atexit.register(lldb.SBDebugger.Terminate)
137-
unittest2.main()

lldb/test/API/lang/swift/expression/exclusivity_suppression/TestExclusivitySuppression.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,3 @@ def check_expression(self, frame, expression, expected_result, use_summary=True)
100100
self.assertTrue(answer == expected_result, report_str)
101101

102102

103-
if __name__ == '__main__':
104-
import atexit
105-
lldb.SBDebugger.Initialize()
106-
atexit.register(lldb.SBDebugger.Terminate)
107-
unittest2.main()

lldb/test/API/lang/swift/expression/generic/TestSwiftGenericExpressions.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,3 @@ def do_ivar_test(self):
133133

134134
self.runCmd("continue")
135135

136-
if __name__ == '__main__':
137-
import atexit
138-
lldb.SBDebugger.Initialize()
139-
atexit.register(lldb.SBDebugger.Terminate)
140-
unittest2.main()

lldb/test/API/lang/swift/expression/no_calculator/TestSwiftNoProcess.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,3 @@ def test_swift_no_process(self):
6060
"Swift expressions with no process should fail.")
6161

6262

63-
if __name__ == '__main__':
64-
import atexit
65-
lldb.SBDebugger.Initialize()
66-
atexit.register(lldb.SBDebugger.Terminate)
67-
unittest2.main()

lldb/test/API/lang/swift/expression/objc_context/Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
SWIFT_OBJC_INTEROP := 1
1+
OBJC_SOURCES := main.m
2+
CFLAGS_EXTRAS = $(MANDATORY_MODULE_BUILD_CFLAGS) -I$(BUILDDIR)
3+
LD_EXTRAS = -lFoo -L$(BUILDDIR)
24

35
# This test builds an Objective-C main program that imports two Swift
46
# .dylibs with conflicting ClangImporter search paths.
57

6-
include Makefile.rules
8+
all: libFoo.dylib $(EXE)
79

8-
a.out: main.m libFoo.dylib
9-
$(CC) $(CFLAGS) $(MANDATORY_MODULE_BUILD_CFLAGS) -I$(shell pwd) -lFoo -L$(shell pwd) -o $@ $<
10-
ifneq "$(CODESIGN)" ""
11-
$(CODESIGN) -s - "$@"
12-
endif
10+
include Makefile.rules
1311

1412
lib%.dylib: %.swift
1513
$(MAKE) MAKE_DSYM=YES CC=$(CC) SWIFTC=$(SWIFTC) \

lldb/test/API/lang/swift/expression/objc_context/TestSwiftExpressionObjCContext.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import lldbsuite.test.lldbutil as lldbutil
1717
import os
1818
import unittest2
19-
import shutil
2019

2120
class TestSwiftExpressionObjCContext(TestBase):
2221

@@ -29,20 +28,12 @@ def setUp(self):
2928
@swiftTest
3029
def test(self):
3130
self.build()
32-
exe_name = "a.out"
33-
exe = self.getBuildArtifact(exe_name)
34-
35-
# Create the target
36-
target = self.dbg.CreateTarget(exe)
37-
self.assertTrue(target, VALID_TARGET)
3831

3932
# Register shlib so it can run on-device.
33+
target, _, _, _ = lldbutil.run_to_source_breakpoint(
34+
self, "break here", lldb.SBFileSpec('main.m'))
4035
self.registerSharedLibrariesWithTarget(target, ['Foo'])
4136

42-
# Set the breakpoints
43-
foo_breakpoint = target.BreakpointCreateBySourceRegex(
44-
'break here', lldb.SBFileSpec('main.m'))
45-
process = target.LaunchSimple(None, None, os.getcwd())
4637
# This is expected to fail because we can't yet import ObjC
4738
# modules into a Swift context.
4839
self.expect("expr -lang Swift -- Bar()", "failure",
@@ -51,10 +42,4 @@ def test(self):
5142
self.expect("expr -lang Swift -- [1, 2, 3]",
5243
"context-less swift expression works",
5344
substrs=["([Int])"])
54-
5545

56-
if __name__ == '__main__':
57-
import atexit
58-
lldb.SBDebugger.Initialize()
59-
atexit.register(lldb.SBDebugger.Terminate)
60-
unittest2.main()

0 commit comments

Comments
 (0)