Skip to content

Commit 2de28df

Browse files
committed
AST: Use -verify-emitted-module-interface in test case the emits a swiftinterface containing a back-deployed decl. Also leave a FIXME to stop using -merge-modules in the future and fix a diagnostic typo.
1 parent dcf5af4 commit 2de28df

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

include/swift/AST/DiagnosticsParse.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ WARNING(attr_availability_wildcard_ignored,none,
15371537
"* as platform name has no effect in '%0' attribute", (StringRef))
15381538

15391539
ERROR(attr_availability_need_platform_version,none,
1540-
"expected at least one platform version in in '%0' attribute", (StringRef))
1540+
"expected at least one platform version in '%0' attribute", (StringRef))
15411541

15421542
WARNING(attr_availability_platform_version_major_minor_only,none,
15431543
"'%0' only uses major and minor version number", (StringRef))

test/ModuleInterface/back-deploy-attr.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
// Ensure @_backDeploy attributes and function bodies are printed in
44
// swiftinterface files.
5-
// RUN: %target-swift-frontend -emit-module -o %t/Test.swiftmodule -emit-module-interface-path %t/Test.swiftinterface -module-name Test %s
5+
// RUN: %swiftc_driver -emit-module -o %t/Test.swiftmodule -emit-module-interface-path %t/Test.swiftinterface -enable-library-evolution -verify-emitted-module-interface -module-name Test %s
66
// RUN: %FileCheck %s --check-prefix FROMSOURCE --check-prefix CHECK < %t/Test.swiftinterface
77

8+
// FIXME(backDeploy): Remove this step in favor of a test that exercises using
9+
// a back deployed API from a test library so that we can avoid -merge-modules
10+
811
// Ensure @_backDeploy attributes and function bodies are present after
912
// deserializing .swiftmodule files.
1013
// RUN: %target-swift-frontend -emit-module -o /dev/null -merge-modules %t/Test.swiftmodule -disable-objc-attr-requires-foundation-module -emit-module-interface-path %t/TestFromModule.swiftinterface -module-name Test

test/attr/backDeploy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public func duplicatePlatformsFunc1() {}
118118
public func duplicatePlatformsFunc2() {}
119119

120120
@available(macOS 12.0, *)
121-
@_backDeploy() // expected-error {{expected at least one platform version in in '@_backDeploy' attribute}}
121+
@_backDeploy() // expected-error {{expected at least one platform version in '@_backDeploy' attribute}}
122122
public func zeroPlatformVersionsFunc() {}
123123

124124
@available(macOS 12.0, *)

0 commit comments

Comments
 (0)