Skip to content

Commit fa94c20

Browse files
committed
ModuleInterface: Adopt swiftinterface verification lit substitutions in preserve-type-repr.swift. The test was originally written assuming that CHECK: lines are always matched by FileCheck even when alternate prefixes are specified via --check-prefix, so it contained some incorrect expectations that needed to be updated.
1 parent f40f0b0 commit fa94c20

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

test/ModuleInterface/preserve-type-repr.swift

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend %s -typecheck -enable-library-evolution -emit-module-interface-path %t/External.swiftinterface -module-name External -DEXTERNAL
3-
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path - %s -enable-library-evolution -module-name PreferTypeRepr -module-interface-preserve-types-as-written -I %t | %FileCheck %s --check-prefix PREFER
4-
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path - %s -enable-library-evolution -module-name PreferTypeRepr -I %t | %FileCheck %s --check-prefix DONTPREFER
2+
3+
// -- Generate an interface for the External module.
4+
// RUN: %target-swift-emit-module-interface(%t/External.swiftinterface) %s -module-name External -DEXTERNAL
5+
// RUN: %target-swift-typecheck-module-from-interface(%t/External.swiftinterface) -module-name External
6+
7+
// -- Check output with -module-interface-preserve-types-as-written.
8+
// RUN: %target-swift-emit-module-interface(%t/Preserve.swiftinterface) %s -module-name PreferTypeRepr -module-interface-preserve-types-as-written -I %t
9+
// RUN: %target-swift-typecheck-module-from-interface(%t/Preserve.swiftinterface) -module-name PreferTypeRepr -I %t
10+
// RUN: %FileCheck --check-prefixes=CHECK,PREFER %s < %t/Preserve.swiftinterface
11+
12+
// -- Check output without the flag.
13+
// RUN: %target-swift-emit-module-interface(%t/DontPreserve.swiftinterface) %s -module-name PreferTypeRepr -I %t
14+
// RUN: %target-swift-typecheck-module-from-interface(%t/DontPreserve.swiftinterface) -module-name PreferTypeRepr -I %t
15+
// RUN: %FileCheck --check-prefixes=CHECK,DONTPREFER %s < %t/DontPreserve.swiftinterface
516

617
#if EXTERNAL
718
public struct Toy {
@@ -48,9 +59,11 @@ public struct Ex<T: Pet> {
4859
// CHECK-NEXT: }
4960
public struct My<T> {}
5061

51-
// CHECK: extension My where T : PreserveTypeRepr.Pet
62+
// PREFER: extension My where T : PreferTypeRepr.Pet
63+
// DONTPREFER: extension PreferTypeRepr.My where T : PreferTypeRepr.Pet
5264
extension My where T: Pet {
53-
// CHECK: public func isPushingUpDaisies() -> Swift.String
65+
// PREFER: public func isPushingUpDaisies() -> String
66+
// DONTPREFER: public func isPushingUpDaisies() -> Swift.String
5467
public func isPushingUpDaisies() -> String { "" }
5568
}
5669

0 commit comments

Comments
 (0)