Skip to content

Commit 85a4f18

Browse files
committed
[embedded] Add test/embedded/cxxshim.swift testcase
1 parent a02586f commit 85a4f18

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/embedded/cxxshim.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %{python} %utils/split_file.py -o %t %s
3+
4+
// RUN: %target-swift-frontend -I %t %t/Main.swift -enable-experimental-feature Embedded -cxx-interoperability-mode=default -c -o %t/a.o -Rmodule-loading
5+
6+
// BEGIN header.h
7+
8+
// C++
9+
struct Base { int field; };
10+
struct Derived : Base {};
11+
12+
// BEGIN module.modulemap
13+
14+
module MyModule {
15+
header "header.h"
16+
}
17+
18+
// BEGIN Main.swift
19+
20+
import MyModule
21+
22+
public func foo() {
23+
var d = Derived()
24+
d.field = 123
25+
}
26+
27+
foo()

0 commit comments

Comments
 (0)