mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Make @abi non-experimental
This includes changing the feature name so that compilers with the experimental feature don’t accidentally pick up content that only works in the final version. Resolves rdar://150065196.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name attrs \
|
||||
// RUN: -emit-private-module-interface-path %t.private.swiftinterface \
|
||||
// RUN: -enable-experimental-feature ABIAttribute
|
||||
// RUN: -emit-private-module-interface-path %t.private.swiftinterface
|
||||
|
||||
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name attrs
|
||||
// RUN: %target-swift-typecheck-module-from-interface(%t.private.swiftinterface) -module-name attrs
|
||||
@@ -8,8 +7,6 @@
|
||||
// RUN: %FileCheck %s --check-prefixes CHECK,PUBLIC-CHECK --input-file %t.swiftinterface
|
||||
// RUN: %FileCheck %s --check-prefixes CHECK,PRIVATE-CHECK --input-file %t.private.swiftinterface
|
||||
|
||||
// REQUIRES: swift_feature_ABIAttribute
|
||||
|
||||
// CHECK: @_transparent public func glass() -> Swift.Int { return 0 }{{$}}
|
||||
@_transparent public func glass() -> Int { return 0 }
|
||||
|
||||
@@ -38,7 +35,7 @@ internal func __specialize_someGenericFunction<T>(_ t: T) -> Int {
|
||||
|
||||
@abi(func __abi__abiAttrOnFunction(param: Int))
|
||||
public func abiAttrOnFunction(param: Int) {}
|
||||
// CHECK: #if {{.*}} $ABIAttribute
|
||||
// CHECK: #if {{.*}} $ABIAttributeSE0479
|
||||
// CHECK: @abi(func __abi__abiAttrOnFunction(param: Swift.Int))
|
||||
// CHECK: public func abiAttrOnFunction(param: Swift.Int)
|
||||
// CHECK: #else
|
||||
@@ -48,7 +45,7 @@ public func abiAttrOnFunction(param: Int) {}
|
||||
|
||||
@abi(let __abi__abiAttrOnVar: Int)
|
||||
public var abiAttrOnVar: Int = 42
|
||||
// CHECK: #if {{.*}} $ABIAttribute
|
||||
// CHECK: #if {{.*}} $ABIAttributeSE0479
|
||||
// CHECK: @abi(var __abi__abiAttrOnVar: Swift.Int)
|
||||
// CHECK: public var abiAttrOnVar: Swift.Int
|
||||
// CHECK: #else
|
||||
@@ -57,7 +54,7 @@ public var abiAttrOnVar: Int = 42
|
||||
// CHECK: #endif
|
||||
|
||||
public struct MutatingTest {
|
||||
// CHECK: #if {{.*}} $ABIAttribute
|
||||
// CHECK: #if {{.*}} $ABIAttributeSE0479
|
||||
// CHECK: @abi(mutating func abiMutFunc())
|
||||
// CHECK: public mutating func abiMutFunc()
|
||||
// CHECK: #else
|
||||
@@ -68,14 +65,14 @@ public struct MutatingTest {
|
||||
public mutating func abiMutFunc() {}
|
||||
}
|
||||
|
||||
// PUBLIC-CHECK-NOT: #if {{.*}} $ABIAttribute
|
||||
// PUBLIC-CHECK-NOT: #if {{.*}} $ABIAttributeSE0479
|
||||
// PUBLIC-CHECK-NOT: @abi(func abiSpiFunc())
|
||||
// PUBLIC-CHECK-NOT: public func abiSpiFunc()
|
||||
// PUBLIC-CHECK-NOT: #else
|
||||
// PUBLIC-CHECK-NOT: @_silgen_name("$s5attrs10abiSpiFuncyyF")
|
||||
// PUBLIC-CHECK-NOT: public func abiSpiFunc()
|
||||
// PUBLIC-CHECK-NOT: #endif
|
||||
// PRIVATE-CHECK: #if {{.*}} $ABIAttribute
|
||||
// PRIVATE-CHECK: #if {{.*}} $ABIAttributeSE0479
|
||||
// PRIVATE-CHECK: @abi(func abiSpiFunc())
|
||||
// PRIVATE-CHECK: public func abiSpiFunc()
|
||||
// PRIVATE-CHECK: #else
|
||||
@@ -88,7 +85,7 @@ public struct MutatingTest {
|
||||
// We should print feature guards outside, but not inside, an @abi attribute.
|
||||
@abi(func sendingABI() -> sending Any?)
|
||||
public func sendingABI() -> Any? { nil }
|
||||
// CHECK: #if {{.*}} && $ABIAttribute
|
||||
// CHECK: #if {{.*}} && $ABIAttributeSE0479
|
||||
// CHECK: @abi(func sendingABI() -> sending Any?)
|
||||
// CHECK: public func sendingABI() -> Any?
|
||||
// CHECK: #elseif {{.*}} && $SendingArgsAndResults
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s \
|
||||
// RUN: -enable-objc-interop -module-name attrs_objc \
|
||||
// RUN: -enable-experimental-feature ABIAttribute
|
||||
// RUN: -enable-objc-interop -module-name attrs_objc
|
||||
|
||||
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name attrs_objc
|
||||
|
||||
// RUN: %FileCheck %s --input-file %t.swiftinterface
|
||||
|
||||
// REQUIRES: objc_interop
|
||||
// REQUIRES: swift_feature_ABIAttribute
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers
|
||||
public class ObjCTest: NSObject {
|
||||
// CHECK: #if {{.*}} $ABIAttribute
|
||||
// CHECK: #if {{.*}} $ABIAttributeSE0479
|
||||
// CHECK: @abi(func abiObjCFunc())
|
||||
// CHECK: @objc public func abiObjCFunc()
|
||||
// CHECK: #else
|
||||
@@ -23,7 +21,7 @@ public class ObjCTest: NSObject {
|
||||
@abi(func abiObjCFunc())
|
||||
@objc public func abiObjCFunc() {}
|
||||
|
||||
// CHECK: #if {{.*}} $ABIAttribute
|
||||
// CHECK: #if {{.*}} $ABIAttributeSE0479
|
||||
// CHECK: @abi(func abiImplicitObjCFunc())
|
||||
// CHECK: @objc public func abiImplicitObjCFunc()
|
||||
// CHECK: #else
|
||||
@@ -33,7 +31,7 @@ public class ObjCTest: NSObject {
|
||||
@abi(func abiImplicitObjCFunc())
|
||||
public func abiImplicitObjCFunc() {}
|
||||
|
||||
// CHECK: #if {{.*}} $ABIAttribute
|
||||
// CHECK: #if {{.*}} $ABIAttributeSE0479
|
||||
// CHECK: @abi(func abiIBActionFunc(_: Any))
|
||||
// CHECK: @objc @IBAction @_Concurrency.MainActor @preconcurrency public func abiIBActionFunc(_: Any)
|
||||
// CHECK: #else
|
||||
|
||||
Reference in New Issue
Block a user