Skip to content

Commit 99c24b7

Browse files
committed
Tests: Add an -emit-module-interface test case for lazy_typecheck.swift.
1 parent 5186971 commit 99c24b7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// RUN: %target-swift-frontend -swift-version 5 %S/../Inputs/lazy_typecheck.swift -module-name lazy_typecheck -emit-module -emit-module-path /dev/null -emit-module-interface-path %t/lazy_typecheck.swiftinterface -enable-library-evolution -parse-as-library -package-name Package -experimental-lazy-typecheck -experimental-skip-all-function-bodies -experimental-serialize-external-decls-only
4+
// RUN: %FileCheck %s < %t/lazy_typecheck.swiftinterface
5+
6+
// CHECK: import Swift
7+
8+
// CHECK: public func publicFunc() -> Swift.Int
9+
// CHECK: publicFuncWithDefaultArg(_ x: Swift.Int = 1) -> Swift.Int
10+
// CHECK: @inlinable internal func inlinableFunc() -> Swift.Int {
11+
// CHECK-NEXT: return true // expected-error {{[{][{]}}cannot convert return expression of type 'Bool' to return type 'Int'{{[}][}]}}
12+
// CHECK-NEXT: }
13+
// CHECK: public func constrainedGenericPublicFunction<T>(_ t: T) where T : lazy_typecheck.PublicProto
14+
// CHECK: @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
15+
// CHECK-NEXT: public func publicFuncWithOpaqueReturnType() -> some lazy_typecheck.PublicProto
16+
17+
// CHECK: @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
18+
// CHECK-NEXT: @_alwaysEmitIntoClient public func publicAEICFuncWithOpaqueReturnType() -> some Any {
19+
// CHECK-NEXT: if #available(macOS 20, *) {
20+
// CHECK-NEXT: return 3
21+
// CHECK-NEXT: } else {
22+
// CHECK-NEXT: return "hi"
23+
// CHECK-NEXT: }
24+
// CHECK-NEXT: }
25+
26+
// CHECK: public protocol PublicProto {
27+
// CHECK: func req() -> Swift.Int
28+
// CHECK: }
29+
30+
// CHECK: public struct PublicStruct {
31+
// CHECK: public func publicMethod() -> Swift.Int
32+
// CHECK: }

0 commit comments

Comments
 (0)