mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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.
19 lines
664 B
Plaintext
19 lines
664 B
Plaintext
// RUN: %empty-directory(%t) && %target-swift-frontend -c -update-code -primary-file %s -emit-migrated-file-path %t/post_fixit_pass.swift.result -o /dev/null -F %S/mock-sdk -swift-version 4 %api_diff_data_dir
|
|
// RUN: %diff -u %S/post_fixit_pass.swift.expected %t/post_fixit_pass.swift.result
|
|
|
|
#if swift(>=4.2)
|
|
public struct SomeAttribute: RawRepresentable {
|
|
public init(rawValue: Int) { self.rawValue = rawValue }
|
|
public init(_ rawValue: Int) { self.rawValue = rawValue }
|
|
public var rawValue: Int
|
|
public typealias RawValue = Int
|
|
}
|
|
#else
|
|
public typealias SomeAttribute = Int
|
|
#endif
|
|
|
|
func foo(_ d: SomeAttribute) {
|
|
let i: Int = d.rawValue
|
|
}
|
|
|