|
1 | 1 | // 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 |
5 | 16 |
|
6 | 17 | #if EXTERNAL
|
7 | 18 | public struct Toy {
|
@@ -48,9 +59,11 @@ public struct Ex<T: Pet> {
|
48 | 59 | // CHECK-NEXT: }
|
49 | 60 | public struct My<T> {}
|
50 | 61 |
|
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 |
52 | 64 | 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 |
54 | 67 | public func isPushingUpDaisies() -> String { "" }
|
55 | 68 | }
|
56 | 69 |
|
|
0 commit comments