6666// RUN: c-index-test core -print-record %t/idx | %FileCheck -check-prefix=BROKEN-RECORD %s
6767// BROKEN-RECORD-NOT: function/Swift | systemFunc()
6868
69+ /// Subsequent builds won't attempt to index the broken swiftinterface again
6970// RUN: %target-swift-frontend -typecheck -parse-stdlib \
7071// RUN: -index-system-modules \
7172// RUN: -index-store-path %t/idx \
7879// RUN: 2>&1 | %FileCheck -check-prefix=BROKEN-BUILD-2 --allow-empty %s
7980// BROKEN-BUILD-2-NOT: indexing system module
8081
82+ /// Local errors should be preserved even when indexing against a broken swiftinterface
83+ // RUN: %empty-directory(%t/idx)
84+ // RUN: %empty-directory(%t/modulecache)
85+ // RUN: not %target-swift-frontend -typecheck -parse-stdlib \
86+ // RUN: -index-system-modules \
87+ // RUN: -index-store-path %t/idx \
88+ // RUN: -index-ignore-stdlib \
89+ // RUN: -sdk %t/SDK \
90+ // RUN: -Fsystem %t/SDK/Frameworks \
91+ // RUN: -module-cache-path %t/modulecache \
92+ // RUN: %t/ClientWithError.swift 2> %t/client-with-error.err
93+ // RUN: cat %t/client-with-error.err | %FileCheck -check-prefix=WITH-ERROR %s
94+ // WITH-ERROR: cannot convert return expression of type 'U' to return type 'T'
95+
8196//--- SecretModule.swift
8297public struct SecretType { }
8398
@@ -92,3 +107,12 @@ func leakyFunc(_ a: SecretType) { }
92107import SystemModule
93108
94109public func clientFunc( ) { }
110+
111+ //--- ClientWithError.swift
112+
113+ import SystemModule
114+ public func clientFunc( ) { }
115+
116+ struct T { }
117+ struct U { }
118+ func f( ) -> T { return U ( ) }
0 commit comments