mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This involved adding a new substitution called %api_diff_data_dir that when building against a host toolchain, looks in the host toolchain (next to swiftc) rather than in the resource dir. The reason why I need to do this is this allows me to perform a stdlib stage2 build without needing to build swift itself. The only interesting changes here are that I had to add %api_diff_data_dir to a bunch of normal/expected tests and also add %api_diff_data_dir's length to the offsets in rdar31892850.swift.
18 lines
711 B
Plaintext
18 lines
711 B
Plaintext
// RUN: %target-swift-frontend -typecheck %s -swift-version 4 %api_diff_data_dir
|
|
// RUN: %target-swift-frontend -typecheck -update-code -primary-file %s -emit-migrated-file-path %t.result -swift-version 4 %api_diff_data_dir
|
|
// RUN: diff -u %s.expected %t.result
|
|
|
|
// REQUIRES: VENDOR=apple
|
|
|
|
func migrate<T, U: Sequence, V: Collection>(lseq: LazySequence<T>, lcol: LazyCollection<T>, seq: U, col: V, test: Bool) {
|
|
_ = lseq.compactMap { test ? nil : $0 }
|
|
_ = lcol.compactMap { test ? nil : $0 }
|
|
_ = seq.compactMap { test ? nil : $0 }
|
|
_ = col.compactMap { test ? nil : "\($0)" }
|
|
|
|
_ = lseq.flatMap { [$0, $0] }
|
|
_ = lcol.flatMap { [$0, $0] }
|
|
_ = seq.flatMap { [$0, $0] }
|
|
_ = col.flatMap { "\($0)" }
|
|
}
|