mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Introduce queries on Decl for active @available attrs.
Use these queries to replace some duplicated code. Also, move the `attr_inlinable_available.swift` test to the `Availability` sub-directory since the test has more to do with availability checking than it has to do specifically with the `@inlinable` attr.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// RUN: %target-swift-frontend -typecheck -dump-availability-scopes %s -target %target-cpu-apple-macos50 > %t.dump 2>&1
|
||||
// RUN: %target-swift-frontend -typecheck -dump-availability-scopes %s -target %target-cpu-apple-macos50 -swift-version 5 > %t.dump 2>&1
|
||||
// RUN: %FileCheck --strict-whitespace %s < %t.dump
|
||||
|
||||
// REQUIRES: OS=macosx
|
||||
@@ -454,6 +454,23 @@ func deprecatedOnMacOS() {
|
||||
let x = 1
|
||||
}
|
||||
|
||||
// Since availableOniOS() doesn't have any active @available attributes it
|
||||
// shouldn't create a scope.
|
||||
// CHECK-NOT: availableOniOS
|
||||
|
||||
@available(iOS, introduced: 53)
|
||||
func availableOniOS() { }
|
||||
|
||||
// CHECK-NEXT: {{^}} (decl version=50 decl=availableInSwift5
|
||||
|
||||
@available(swift 5)
|
||||
func availableInSwift5() { }
|
||||
|
||||
// CHECK-NEXT: {{^}} (decl version=50 unavailable=swift decl=availableInSwift6
|
||||
|
||||
@available(swift 6)
|
||||
func availableInSwift6() { }
|
||||
|
||||
// CHECK-NEXT: {{^}} (decl version=51 decl=FinalDecl
|
||||
|
||||
@available(OSX 51, *)
|
||||
|
||||
1883
test/Availability/availability_target_min_inlining.swift
Normal file
1883
test/Availability/availability_target_min_inlining.swift
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user