// RUN: %empty-directory(%t) // RUN: %round-trip-syntax-test --swift-syntax-test %swift-syntax-test --file %s @available(SwiftStdlib 5.5, *) actor Counter { private var value = 0 private let scratchBuffer: UnsafeMutableBufferPointer init(maxCount: Int) { scratchBuffer = .allocate(capacity: maxCount) scratchBuffer.initialize(repeating: 0) } func next() -> Int { let current = value // Make sure we haven't produced this value before assert(scratchBuffer[current] == 0) scratchBuffer[current] = 1 value = value + 1 return current } } @available(SwiftStdlib 5.5, *) func worker(identity: Int, counters: [Counter], numIterations: Int) async { for i in 0..] = [] for i in 0..= 2 ? Int(args[1])! : 10 let workers = args.count >= 3 ? Int(args[2])! : 100 let iterations = args.count >= 4 ? Int(args[3])! : 1000 print("counters: \(counters), workers: \(workers), iterations: \(iterations)") await runTest(numCounters: counters, numWorkers: workers, numIterations: iterations) } } struct X3 { subscript(_ i : Int) -> Int { get async throws {} } }