Files
swift-mirror/test/Concurrency/Macros/task_local_macro_expansion.swift
Allan Shortlidge c02fc4724d Tests: Remove -disable-availability-checking from many Concurrency tests.
Instead, use the `%target-swift-5.1-abi-triple` substitution to compile the tests
for deployment to the minimum OS versions required for use of _Concurrency APIs.
2024-10-18 16:21:51 -07:00

40 lines
986 B
Swift

// REQUIRES: swift_swift_parser, asserts
//
// UNSUPPORTED: back_deploy_concurrency
// REQUIRES: concurrency
//
// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t-scratch)
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -typecheck -verify -plugin-path %swift-plugin-dir -I %t -dump-macro-expansions %s -dump-macro-expansions 2>&1 | %FileCheck %s
struct Nein {
@TaskLocal
public static var example: String = "hello"
}
// CHECK: public static let $example: TaskLocal<String> = TaskLocal(wrappedValue: "hello")
//
// CHECK: {
// CHECK: get {
// CHECK: $example.get()
// CHECK: }
// CHECK: }
struct Available {
@available(OSX 10.9, *)
struct AvailableValue {}
@TaskLocal
@available(OSX 10.9, *)
private static var example: AvailableValue?
}
// CHECK: private static let $example: TaskLocal<AvailableValue?> = TaskLocal(wrappedValue: nil)
//
// CHECK: {
// CHECK: get {
// CHECK: $example.get()
// CHECK: }
// CHECK: }