Skip to content

Commit ffac595

Browse files
committed
test: add a C++ interop test for the msvcprt module
Add a test to verify that the C++ module is importable and expected functions are visible. This was requested in #59767 by @egorzhdan.
1 parent 198b974 commit ffac595

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-ide-test -print-module -module-to-print std -source-filename none -enable-experimental-cxx-interop -module-cache-path %t | %FileCheck %s -check-prefix CHECK-STD
3+
// RUN: %target-swift-ide-test -print-module -module-to-print=std.string -source-filename=x -enable-experimental-cxx-interop -module-cache-path %t | %FileCheck %s -check-prefix CHECK-STRING
4+
5+
// This test is specific to msvcprt and therefore only runs on Windows.
6+
// REQUIRES: OS=windows-msvc
7+
8+
// CHECK-STD: import std.iosfwd
9+
// CHECK-STD: import std.string
10+
11+
// CHECK-STRING: enum std {
12+
// CHECK-STRING: struct __CxxTemplateInstSs {
13+
// CHECK-STRING: typealias value_type = CChar
14+
// CHECK-STRING: }
15+
// CHECK-STRING: struct __CxxTemplateInstSbIwSt11char_traitsIwESaIwEE {
16+
// CHECK-STRING: typealias value_type = CWideChar
17+
// CHECK-STRING: }
18+
// CHECK-STRING: static func to_string(_ _Val: Int32) -> std.string
19+
// CHECK-STRING: static func to_wstring(_ _Val: Int32) -> std.wstring
20+
// CHECK-STRING: typealias size_t = size_t
21+
// CHECK-STRING: typealias string = __CxxTemplateInstSs
22+
// CHECK-STRING: typealias wstring = __CxxTemplateInstSbIwSt11char_traitsIwESaIwEE
23+
// CHECK-STRING: }
24+

0 commit comments

Comments
 (0)