Skip to content

Commit 5d2a185

Browse files
authored
Merge pull request #7197 from rintaro/diagverify-unknown
2 parents 811e7ee + 019daba commit 5d2a185

36 files changed

+259
-35
lines changed

include/swift/Basic/DiagnosticOptions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class DiagnosticOptions {
3030
VerifyAndApplyFixes
3131
} VerifyMode = NoVerify;
3232

33+
/// Indicates whether to allow diagnostics for \c <unknown> locations if
34+
/// \c VerifyMode is not \c NoVerify.
35+
bool VerifyIgnoreUnknown = false;
36+
3337
/// Indicates whether diagnostic passes should be skipped.
3438
bool SkipDiagnosticPasses = false;
3539

include/swift/Frontend/DiagnosticVerifier.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace swift {
3333
///
3434
/// This returns true if there are any mismatches found.
3535
bool verifyDiagnostics(SourceManager &SM, ArrayRef<unsigned> BufferIDs,
36-
bool autoApplyFixes);
36+
bool autoApplyFixes, bool ignoreUnknown);
3737
}
3838

3939
#endif

include/swift/Option/FrontendOptions.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def verify : Flag<["-"], "verify">,
6363
"annotations">;
6464
def verify_apply_fixes : Flag<["-"], "verify-apply-fixes">,
6565
HelpText<"Like -verify, but updates the original source file">;
66+
def verify_ignore_unknown: Flag<["-"], "verify-ignore-unknown">,
67+
HelpText<"Allow diagnostics for '<unknown>' location in verify mode">;
6668

6769
def show_diagnostics_after_fatal : Flag<["-"], "show-diagnostics-after-fatal">,
6870
HelpText<"Keep emitting subsequent diagnostics after a fatal error">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,7 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
10671067
Opts.VerifyMode = DiagnosticOptions::Verify;
10681068
if (Args.hasArg(OPT_verify_apply_fixes))
10691069
Opts.VerifyMode = DiagnosticOptions::VerifyAndApplyFixes;
1070+
Opts.VerifyIgnoreUnknown |= Args.hasArg(OPT_verify_ignore_unknown);
10701071
Opts.SkipDiagnosticPasses |= Args.hasArg(OPT_disable_diagnostic_passes);
10711072
Opts.ShowDiagnosticsAfterFatalError |=
10721073
Args.hasArg(OPT_show_diagnostics_after_fatal);

lib/Frontend/DiagnosticVerifier.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ namespace {
9393
/// unexpected ones.
9494
bool verifyFile(unsigned BufferID, bool autoApplyFixes);
9595

96+
/// diagnostics for '<unknown>:0' should be considered as unexpected.
97+
bool verifyUnknown();
98+
9699
/// If there are any -verify errors (e.g. differences between expectations
97100
/// and actual diagnostics produced), apply fixits to the original source
98101
/// file and drop it back in place.
@@ -623,6 +626,24 @@ bool DiagnosticVerifier::verifyFile(unsigned BufferID,
623626
return !Errors.empty();
624627
}
625628

629+
bool DiagnosticVerifier::verifyUnknown() {
630+
bool HadError = false;
631+
for (unsigned i = 0, e = CapturedDiagnostics.size(); i != e; ++i) {
632+
if (CapturedDiagnostics[i].getFilename() != "<unknown>")
633+
continue;
634+
635+
HadError = true;
636+
std::string Message =
637+
"unexpected "+getDiagKindString(CapturedDiagnostics[i].getKind())+
638+
" produced: "+CapturedDiagnostics[i].getMessage().str();
639+
640+
auto diag = SM.GetMessage({}, llvm::SourceMgr::DK_Error, Message,
641+
{}, {});
642+
SM.getLLVMSourceMgr().PrintMessage(llvm::errs(), diag);
643+
}
644+
return HadError;
645+
}
646+
626647
/// If there are any -verify errors (e.g. differences between expectations
627648
/// and actual diagnostics produced), apply fixits to the original source
628649
/// file and drop it back in place.
@@ -694,14 +715,16 @@ void swift::enableDiagnosticVerifier(SourceManager &SM) {
694715
}
695716

696717
bool swift::verifyDiagnostics(SourceManager &SM, ArrayRef<unsigned> BufferIDs,
697-
bool autoApplyFixes) {
718+
bool autoApplyFixes, bool ignoreUnknown) {
698719
auto *Verifier = (DiagnosticVerifier*)SM.getLLVMSourceMgr().getDiagContext();
699720
SM.getLLVMSourceMgr().setDiagHandler(nullptr, nullptr);
700721

701722
bool HadError = false;
702723

703724
for (auto &BufferID : BufferIDs)
704725
HadError |= Verifier->verifyFile(BufferID, autoApplyFixes);
726+
if (!ignoreUnknown)
727+
HadError |= Verifier->verifyUnknown();
705728

706729
delete Verifier;
707730

lib/FrontendTool/FrontendTool.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,8 @@ int swift::performFrontend(ArrayRef<const char *> Args,
992992
HadError = verifyDiagnostics(
993993
Instance->getSourceMgr(),
994994
Instance->getInputBufferIDs(),
995-
diagOpts.VerifyMode == DiagnosticOptions::VerifyAndApplyFixes);
995+
diagOpts.VerifyMode == DiagnosticOptions::VerifyAndApplyFixes,
996+
diagOpts.VerifyIgnoreUnknown);
996997

997998
DiagnosticEngine &diags = Instance->getDiags();
998999
if (diags.hasFatalErrorOccurred() &&

test/APINotes/basic.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -I %S/Inputs/custom-modules -F %S/Inputs/custom-frameworks
1+
// RUN: %target-typecheck-verify-swift -I %S/Inputs/custom-modules -F %S/Inputs/custom-frameworks -verify-ignore-unknown
22
import APINotesTest
33
import APINotesFrameworkTest
44

@@ -23,3 +23,9 @@ func testSwiftName() {
2323
jumpTo(x: 0, y: 0, z: 0)
2424
jumpTo(0, 0, 0) // expected-error{{missing argument labels 'x:y:z:' in call}}
2525
}
26+
27+
// FIXME: Remove -verify-ignore-unknown.
28+
// <unknown>:0: error: unexpected note produced: 'ANTGlobalValue' was obsoleted in Swift 3
29+
// <unknown>:0: error: unexpected note produced: 'PointStruct' was obsoleted in Swift 3
30+
// <unknown>:0: error: unexpected note produced: 'real_t' was obsoleted in Swift 3
31+
// <unknown>:0: error: unexpected note produced: 'RectStruct' was obsoleted in Swift 3

test/ClangImporter/MixedSource/import-mixed-framework.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -F %t -typecheck %s
77

88
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t/Mixed.framework/Modules/Mixed.swiftmodule/%target-swiftmodule-name %S/Inputs/mixed-framework/Mixed.swift -import-underlying-module -F %t -module-name Mixed -disable-objc-attr-requires-foundation-module
9-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -F %t -typecheck %s -verify
9+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -F %t -typecheck %s -verify -verify-ignore-unknown
1010

1111
// XFAIL: linux
1212

@@ -35,3 +35,6 @@ func testAnyObject(_ obj: AnyObject) {
3535
obj.protoMethod()
3636
_ = obj.protoProperty
3737
}
38+
39+
// FIXME: Remove -verify-ignore-unknown.
40+
// <unknown>:0: error: unexpected note produced: 'SwiftClassWithCustomName' was obsoleted in Swift 3

test/ClangImporter/SceneKit_test.swift

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift
1+
// RUN: %target-typecheck-verify-swift -verify-ignore-unknown
22

33
// REQUIRES: objc_interop
44
// REQUIRES: OS=macosx
@@ -235,3 +235,48 @@ func useRenamedAPIs(actionable: SCNActionable, action: SCNAction, data: Data,
235235
program.handleBinding(ofBufferNamed: "str", frequency: bufferFrequency,
236236
handler: bufferBindingBlock)
237237
}
238+
239+
// FIXME: Remove -verify-ignore-unknown.
240+
// <unknown>:0: error: unexpected note produced: 'SCNGeometrySourceSemantic' was obsoleted in Swift 3
241+
// <unknown>:0: error: unexpected note produced: 'SCNLightType' was obsoleted in Swift 3
242+
// <unknown>:0: error: unexpected note produced: 'SCNLightingModel' was obsoleted in Swift 3
243+
// <unknown>:0: error: unexpected note produced: 'SCNParticleProperty' was obsoleted in Swift 3
244+
// <unknown>:0: error: unexpected note produced: 'SCNPhysicsShapeOption' was obsoleted in Swift 3
245+
// <unknown>:0: error: unexpected note produced: 'SCNPhysicsShapeType' was obsoleted in Swift 3
246+
// <unknown>:0: error: unexpected note produced: 'SCNPhysicsTestOption' was obsoleted in Swift 3
247+
// <unknown>:0: error: unexpected note produced: 'SCNPhysicsTestSearchMode' was obsoleted in Swift 3
248+
// <unknown>:0: error: unexpected note produced: 'SCNSceneAttribute' was obsoleted in Swift 3
249+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceAnimationImportPolicy' was obsoleted in Swift 3
250+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceLoadingOption' was obsoleted in Swift 3
251+
// <unknown>:0: error: unexpected note produced: 'SCNViewOption' was obsoleted in Swift 3
252+
// <unknown>:0: error: unexpected note produced: 'SCNHitTestFirstFoundOnlyKey' was obsoleted in Swift 3
253+
// <unknown>:0: error: unexpected note produced: 'SCNHitTestSortResultsKey' was obsoleted in Swift 3
254+
// <unknown>:0: error: unexpected note produced: 'SCNHitTestClipToZRangeKey' was obsoleted in Swift 3
255+
// <unknown>:0: error: unexpected note produced: 'SCNHitTestBackFaceCullingKey' was obsoleted in Swift 3
256+
// <unknown>:0: error: unexpected note produced: 'SCNHitTestBoundingBoxOnlyKey' was obsoleted in Swift 3
257+
// <unknown>:0: error: unexpected note produced: 'SCNHitTestIgnoreChildNodesKey' was obsoleted in Swift 3
258+
// <unknown>:0: error: unexpected note produced: 'SCNHitTestRootNodeKey' was obsoleted in Swift 3
259+
// <unknown>:0: error: unexpected note produced: 'SCNHitTestIgnoreHiddenNodesKey' was obsoleted in Swift 3
260+
// <unknown>:0: error: unexpected note produced: 'SCNPhysicsShapeTypeKey' was obsoleted in Swift 3
261+
// <unknown>:0: error: unexpected note produced: 'SCNPhysicsShapeKeepAsCompoundKey' was obsoleted in Swift 3
262+
// <unknown>:0: error: unexpected note produced: 'SCNPhysicsShapeScaleKey' was obsoleted in Swift 3
263+
// <unknown>:0: error: unexpected note produced: 'SCNPhysicsTestCollisionBitMaskKey' was obsoleted in Swift 3
264+
// <unknown>:0: error: unexpected note produced: 'SCNPhysicsTestSearchModeKey' was obsoleted in Swift 3
265+
// <unknown>:0: error: unexpected note produced: 'SCNPhysicsTestBackfaceCullingKey' was obsoleted in Swift 3
266+
// <unknown>:0: error: unexpected note produced: 'SCNSceneStartTimeAttributeKey' was obsoleted in Swift 3
267+
// <unknown>:0: error: unexpected note produced: 'SCNSceneEndTimeAttributeKey' was obsoleted in Swift 3
268+
// <unknown>:0: error: unexpected note produced: 'SCNSceneFrameRateAttributeKey' was obsoleted in Swift 3
269+
// <unknown>:0: error: unexpected note produced: 'SCNSceneUpAxisAttributeKey' was obsoleted in Swift 3
270+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceCreateNormalsIfAbsentKey' was obsoleted in Swift 3
271+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceCheckConsistencyKey' was obsoleted in Swift 3
272+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceFlattenSceneKey' was obsoleted in Swift 3
273+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceUseSafeModeKey' was obsoleted in Swift 3
274+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceAssetDirectoryURLsKey' was obsoleted in Swift 3
275+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceOverrideAssetURLsKey' was obsoleted in Swift 3
276+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceStrictConformanceKey' was obsoleted in Swift 3
277+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceConvertUnitsToMetersKey' was obsoleted in Swift 3
278+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceConvertToYUpKey' was obsoleted in Swift 3
279+
// <unknown>:0: error: unexpected note produced: 'SCNSceneSourceAnimationImportPolicyKey' was obsoleted in Swift 3
280+
// <unknown>:0: error: unexpected note produced: 'SCNPreferredRenderingAPIKey' was obsoleted in Swift 3
281+
// <unknown>:0: error: unexpected note produced: 'SCNPreferredDeviceKey' was obsoleted in Swift 3
282+
// <unknown>:0: error: unexpected note produced: 'SCNPreferLowPowerDeviceKey' was obsoleted in Swift 3

test/ClangImporter/attr-swift_name_renaming.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/custom-modules -Xcc -w -typecheck -verify %s
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/custom-modules -Xcc -w -typecheck -verify -verify-ignore-unknown %s
22

33
// XFAIL: linux
44

@@ -51,3 +51,14 @@ func test() {
5151
Foo.accepts() {}
5252
Foo.accepts {}
5353
}
54+
55+
// FIXME: Remove -verify-ignore-unknown.
56+
// <unknown>:0: error: unexpected note produced: 'ColorType' was obsoleted in Swift 3
57+
// <unknown>:0: error: unexpected note produced: did you mean 'Overslept'?
58+
// <unknown>:0: error: unexpected note produced: did you mean 'TooHard'?
59+
// <unknown>:0: error: unexpected note produced: 'my_int_t' was obsoleted in Swift 3
60+
// <unknown>:0: error: unexpected note produced: 'acceptsClosure' was obsoleted in Swift 3
61+
// <unknown>:0: error: unexpected note produced: 'acceptsClosure' was obsoleted in Swift 3
62+
// <unknown>:0: error: unexpected note produced: 'acceptsClosureStatic' was obsoleted in Swift 3
63+
// <unknown>:0: error: unexpected note produced: 'acceptsClosureStatic' was obsoleted in Swift 3
64+
// <unknown>:0: error: unexpected note produced: 'acceptsClosureStatic' was obsoleted in Swift 3

test/ClangImporter/attr-swift_private.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: rm -rf %t && mkdir -p %t
22
// RUN: %build-clang-importer-objc-overlays
33

4-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -I %S/Inputs/custom-modules -typecheck %s -verify
4+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -I %S/Inputs/custom-modules -typecheck %s -verify -verify-ignore-unknown
55
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -Xllvm -new-mangling-for-tests -I %S/Inputs/custom-modules -emit-ir %s -D IRGEN | %FileCheck %s
66

77
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk-nosource -I %t) -I %S/Inputs/custom-modules -print-module -source-filename="%s" -module-to-print SwiftPrivateAttr > %t.txt
@@ -139,3 +139,9 @@ func testRawNames() {
139139
let _ = Foo.__foo // expected-error{{'__foo' is unavailable: use object construction 'Foo(__:)'}}
140140
}
141141
#endif
142+
143+
// FIXME: Remove -verify-ignore-unknown.
144+
// <unknown>:0: error: unexpected note produced: '__PrivCFTypeRef' was obsoleted in Swift 3
145+
// <unknown>:0: error: unexpected note produced: '__PrivCFSubRef' was obsoleted in Swift 3
146+
// <unknown>:0: error: unexpected note produced: '__fooWithOneArg' has been explicitly marked unavailable here
147+
// <unknown>:0: error: unexpected note produced: '__foo' has been explicitly marked unavailable here

test/ClangImporter/availability.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify -I %S/Inputs/custom-modules %s
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify -I %S/Inputs/custom-modules %s -verify-ignore-unknown
22

33
// REQUIRES: objc_interop
44

@@ -115,3 +115,8 @@ func testUnavailableRenamedEnum() {
115115
_ = NSClothingStyle.hipster
116116
_ = NSClothingStyleOfficeCasual // expected-error{{'NSClothingStyleOfficeCasual' has been renamed to 'NSClothingStyle.semiFormal'}} {{7-34=NSClothingStyle.semiFormal}}
117117
}
118+
119+
// FIXME: Remove -verify-ignore-unknown.
120+
// <unknown>:0: error: unexpected warning produced: imported declaration 'dispatch_sync' could not be mapped to 'DispatchQueue.sync(self:execute:)'
121+
// <unknown>:0: error: unexpected note produced: 'NSConnectionDidDieNotification' has been explicitly marked unavailable here
122+
// <unknown>:0: error: unexpected note produced: 'CGColorCreateGenericGray' was obsoleted in Swift 3

test/ClangImporter/cf.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -disable-objc-attr-requires-foundation-module -typecheck -verify -import-cf-types -I %S/Inputs/custom-modules %s
1+
// RUN: %target-swift-frontend -disable-objc-attr-requires-foundation-module -typecheck -verify -import-cf-types -I %S/Inputs/custom-modules %s -verify-ignore-unknown
22

33
// REQUIRES: objc_interop
44

@@ -160,3 +160,7 @@ protocol SwiftProto {}
160160
@objc protocol ObjCProto {}
161161
extension CCRefrigerator: ObjCProto {} // expected-error {{Core Foundation class 'CCRefrigerator' cannot conform to @objc protocol 'ObjCProto' because Core Foundation types are not classes in Objective-C}}
162162
extension CCRefrigerator: SwiftProto {}
163+
164+
// FIXME: Remove -verify-ignore-unknown.
165+
// <unknown>:0: error: unexpected note produced: 'CCFridgeRef' was obsoleted in Swift 3
166+
// <unknown>:0: error: unexpected note produced: 'NotAProblemRef' was obsoleted in Swift 3

test/ClangImporter/objc_factory_method.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: rm -rf %t && mkdir -p %t
22
// RUN: %build-clang-importer-objc-overlays
33

4-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -target x86_64-apple-macosx10.51 -typecheck %s -verify
4+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -target x86_64-apple-macosx10.51 -typecheck %s -verify -verify-ignore-unknown
55

66
// REQUIRES: OS=macosx
77
// REQUIRES: objc_interop
@@ -110,3 +110,10 @@ func testURL() {
110110
_ = NSURLRequest.requestWithString("http://www.llvm.org") // expected-error{{'requestWithString' is unavailable: use object construction 'NSURLRequest(string:)'}}
111111
_ = NSURLRequest.URLRequestWithURL(url as URL) // expected-error{{'URLRequestWithURL' is unavailable: use object construction 'NSURLRequest(url:)'}}
112112
}
113+
114+
// FIXME: Remove -verify-ignore-unknown.
115+
// <unknown>:0: error: unexpected note produced: 'hiveWithQueen' has been explicitly marked unavailable here
116+
// <unknown>:0: error: unexpected note produced: 'decimalNumberWithMantissa(_:exponent:isNegative:)' has been explicitly marked unavailable here
117+
// <unknown>:0: error: unexpected note produced: 'URLWithString' has been explicitly marked unavailable here
118+
// <unknown>:0: error: unexpected note produced: 'requestWithString' has been explicitly marked unavailable here
119+
// <unknown>:0: error: unexpected note produced: 'URLRequestWithURL' has been explicitly marked unavailable here

test/ClangImporter/objc_implicit_with.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -verify
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -verify -verify-ignore-unknown
22

33
// REQUIRES: objc_interop
44

@@ -62,3 +62,6 @@ func testFactoryMethodWithKeywordArgument() {
6262
let prot = NSCoding.self
6363
_ = NSXPCInterface(with: prot) // not "protocol:"
6464
}
65+
66+
// FIXME: Remove -verify-ignore-unknown.
67+
// <unknown>:0: error: unexpected note produced: 'hiveWithQueen' has been explicitly marked unavailable here

test/ClangImporter/objc_init.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-sil -I %S/Inputs/custom-modules %s -verify
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-sil -I %S/Inputs/custom-modules %s -verify -verify-ignore-unknown
22

33
// REQUIRES: objc_interop
44
// REQUIRES: OS=macosx
@@ -171,3 +171,6 @@ func classPropertiesAreNotInit() -> ProcessInfo {
171171
procInfo = ProcessInfo.processInfo // okay
172172
return procInfo
173173
}
174+
175+
// FIXME: Remove -verify-ignore-unknown.
176+
// <unknown>:0: error: unexpected note produced: 'NSProcessInfo' was obsoleted in Swift 3

test/ClangImporter/objc_override.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-sil -I %S/Inputs/custom-modules %s -verify
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-sil -I %S/Inputs/custom-modules %s -verify -verify-ignore-unknown
22

33
// REQUIRES: objc_interop
44

@@ -88,3 +88,6 @@ class FailSub : FailBase {
8888
override class func processValue() {} // expected-error {{overriding a throwing @objc method with a non-throwing method is not supported}}
8989
}
9090

91+
// FIXME: Remove -verify-ignore-unknown.
92+
// <unknown>:0: error: unexpected note produced: overridden declaration is here
93+
// <unknown>:0: error: unexpected note produced: setter for 'boolProperty' declared here

test/ClangImporter/objc_parse.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-sil -I %S/Inputs/custom-modules %s -verify
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-sil -I %S/Inputs/custom-modules %s -verify -verify-ignore-unknown
22

33
// REQUIRES: objc_interop
44

@@ -613,3 +613,5 @@ class NewtypeUser {
613613
@objc func intNewtypeOptional(a: MyInt?) {} // expected-error {{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
614614
}
615615

616+
// FIXME: Remove -verify-ignore-unknown.
617+
// <unknown>:0: error: unexpected note produced: did you mean 'makingHoney'?

test/ClangImporter/protocol-member-renaming.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -typecheck -import-objc-header %S/Inputs/protocol-member-renaming.h -verify %s
1+
// RUN: %target-swift-frontend -typecheck -import-objc-header %S/Inputs/protocol-member-renaming.h -verify %s -verify-ignore-unknown
22

33
// REQUIRES: objc_interop
44

@@ -16,3 +16,6 @@ class OptionalButUnavailableImpl : OptionalButUnavailable {
1616
// Note the argument label that causes this not to match the requirement.
1717
func doTheThing(object: Any) {} // no-warning
1818
}
19+
20+
// FIXME: Remove -verify-ignore-unknown.
21+
// <unknown>:0: error: unexpected note produced: 'foo(_:willConsumeObject:)' was obsoleted in Swift 3

0 commit comments

Comments
 (0)