Skip to content

Commit 822174e

Browse files
authored
Merge pull request #60561 from hyp/eng/i/hdr-for-built-module
[interop][SwiftToCxx] add a test that verifies that we can emit C++ header from previously built swiftmodule/swiftinterface
2 parents 7024813 + 34b5ead commit 822174e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend %s -emit-module -module-name Core -o %t
3+
// RUN: %target-swift-frontend -parse-as-library %t/Core.swiftmodule -typecheck -module-name Core -clang-header-expose-public-decls -emit-clang-header-path %t/core.h
4+
// RUN: %FileCheck %s < %t/core.h
5+
6+
// RUN: %empty-directory(%t-evo)
7+
// RUN: %target-swift-frontend %s -emit-module -enable-library-evolution -module-name Core -o %t-evo
8+
// RUN: %target-swift-frontend -parse-as-library %t-evo/Core.swiftmodule -enable-library-evolution -typecheck -module-name Core -clang-header-expose-public-decls -emit-clang-header-path %t-evo/core.h
9+
// RUN: %FileCheck %s < %t-evo/core.h
10+
11+
// RUN: %empty-directory(%t-int)
12+
// RUN: %target-swift-frontend %s -typecheck -emit-module-interface-path %t-int/Core.swiftinterface -module-name Core
13+
// RUN: %target-swift-frontend -parse-as-library %t-int/Core.swiftinterface -typecheck -module-name Core -clang-header-expose-public-decls -emit-clang-header-path %t-int/core.h
14+
// RUN: %FileCheck %s < %t-int/core.h
15+
16+
// RUN: %empty-directory(%t-int-evo)
17+
// RUN: %target-swift-frontend %s -typecheck -enable-library-evolution -emit-module-interface-path %t-int-evo/Core.swiftinterface -module-name Core
18+
// RUN: %target-swift-frontend -parse-as-library %t-int-evo/Core.swiftinterface -typecheck -enable-library-evolution -module-name Core -clang-header-expose-public-decls -emit-clang-header-path %t-int-evo/core.h
19+
// RUN: %FileCheck %s < %t-int-evo/core.h
20+
21+
public func reprintedInImportedModule() -> Int {
22+
return 42
23+
}
24+
25+
// CHECK: namespace Core {
26+
// CHECK: swift::Int reprintedInImportedModule() noexcept SWIFT_WARN_UNUSED_RESULT {

0 commit comments

Comments
 (0)