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.
14 lines
845 B
Swift
14 lines
845 B
Swift
// REQUIRES: objc_interop
|
|
// RUN: %empty-directory(%t) && %target-swift-frontend -c -update-code -primary-file %s -F %S/mock-sdk -emit-migrated-file-path %t/stdlib_rename.swift.result -emit-remap-file-path %t/stdlib_rename.swift.remap -o /dev/null %api_diff_data_dir
|
|
// RUN: diff -u %S/stdlib_rename.swift.expected %t/stdlib_rename.swift.result
|
|
// RUN: %empty-directory(%t) && %target-swift-frontend -c -update-code -primary-file %s -F %S/mock-sdk -emit-migrated-file-path %t/stdlib_rename.swift.result -emit-remap-file-path %t/stdlib_rename.swift.remap -o /dev/null -swift-version 4.2 %api_diff_data_dir
|
|
// RUN: diff -u %S/stdlib_rename.swift.expected %t/stdlib_rename.swift.result
|
|
|
|
func test1(_ a: [String], s: String) {
|
|
_ = a.index(of: s)
|
|
_ = a.index(where: { _ in true })
|
|
}
|
|
func test2(_ s: String, c: Character) {
|
|
_ = s.index(of: c)
|
|
}
|