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.
27 lines
703 B
Swift
27 lines
703 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -typecheck -primary-file %s -module-cache-path %t/mcp -emit-remap-file-path %t/edits.remap -swift-version 4 %api_diff_data_dir
|
|
// RUN: %FileCheck %s -input-file=%t/edits.remap
|
|
|
|
enum SomeStringEnum : String {
|
|
case val = ""
|
|
}
|
|
|
|
#if swift(>=4.2)
|
|
func foo() {
|
|
let e : SomeStringEnum = "aa"
|
|
}
|
|
#endif
|
|
|
|
// CHECK:[
|
|
// CHECK: {
|
|
// CHECK: "file": "{{.*}}rdar31892850.swift",
|
|
// CHECK-NEXT: "offset": 344,
|
|
// CHECK-NEXT: "text": "SomeStringEnum(rawValue: "
|
|
// CHECK: },
|
|
// CHECK: {
|
|
// CHECK: "file": "{{.*}}rdar31892850.swift",
|
|
// CHECK-NEXT: "offset": 348,
|
|
// CHECK-NEXT: "text": ") ?? <#default value#>"
|
|
// CHECK: }
|
|
// CHECK:]
|