mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
If a file is run through the migration workflow a second or third time, but fails to compile in its current state in Swift 4, it might be possible for the previous remap file to get picked up, resulting in the old changes getting applied twice or at the wrong offsets. At the start of the migration, proactively remove the remap file to prevent this. rdar://problem/32545844
14 lines
764 B
Swift
14 lines
764 B
Swift
// RUN: rm -rf %t && mkdir -p %t && cp %s %t/input.swift
|
|
// RUN: %target-swift-frontend -c -update-code -primary-file %t/input.swift -emit-migrated-file-path %t/always_remove_old_remap_file.result -emit-remap-file-path %t/always_remove_old_remap_file.remap -o /dev/null
|
|
// RUN: ls %t/always_remove_old_remap_file.remap
|
|
|
|
// Simulate leaving behind code that can't build in Swift 4:
|
|
// RUN: echo asdfads >> %t/input.swift
|
|
|
|
// Migrate again. This should delete the old remap file.
|
|
// RUN: not %target-swift-frontend -c -update-code -primary-file %t/input.swift -emit-migrated-file-path %t/always_remove_old_remap_file.result -emit-remap-file-path %t/always_remove_old_remap_file.remap -o /dev/null
|
|
|
|
// RUN: not ls %t/always_remove_old_remap_file.remap
|
|
|
|
func foo() {}
|