forked from swiftlang/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid adding any framework paths in /System/Library in process_one_mo…
…dule. The merit of process_one_module can be debated, but these are definitely wrong, system modules must be imported from the SDK instead. <rdar://problem/56280346>
- Loading branch information
1 parent
c951307
commit e9e842b
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
lldb/packages/Python/lldbsuite/test/lang/swift/system_framework/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
LEVEL = ../../../make | ||
|
||
SWIFT_SOURCES := main.swift | ||
|
||
SWIFT_FLAGS_EXTRAS := -framwork CoreGraphics | ||
|
||
include $(LEVEL)/Makefile.rules |
34 changes: 34 additions & 0 deletions
34
lldb/packages/Python/lldbsuite/test/lang/swift/system_framework/TestSwiftSystemFramework.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import lldb | ||
from lldbsuite.test.decorators import * | ||
import lldbsuite.test.lldbtest as lldbtest | ||
import lldbsuite.test.lldbutil as lldbutil | ||
import os | ||
import unittest2 | ||
|
||
|
||
class TestSwiftAnyType(lldbtest.TestBase): | ||
|
||
mydir = lldbtest.TestBase.compute_mydir(__file__) | ||
|
||
@swiftTest | ||
def test_system_framework(self): | ||
"""Make sure no framework paths into /System/Library are added""" | ||
self.build() | ||
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint( | ||
self, 'break here', lldb.SBFileSpec('main.swift')) | ||
|
||
log = self.getBuildArtifact("types.log") | ||
self.runCmd('log enable lldb types -f "%s"' % log) | ||
self.expect("settings set target.use-all-compiler-flags true") | ||
self.expect("expression -- 0") | ||
pos = 0 | ||
neg = 0 | ||
with open(log, "r") as logfile: | ||
for line in logfile: | ||
if "process_one_module rejecting framework path" in line: | ||
pos += 1 | ||
elif "/System/Library/Frameworks" in line: | ||
neg += 1 | ||
|
||
self.assertGreater(pos, 0, "sanity check failed") | ||
self.assertEqual(neg, 0, "found /System/Library/Frameworks in log") |
6 changes: 6 additions & 0 deletions
6
lldb/packages/Python/lldbsuite/test/lang/swift/system_framework/main.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import ApplicationServices | ||
|
||
func stop() {} | ||
|
||
let a = ATSFSSpec() | ||
stop() // break here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters