Skip to content

Commit deb3090

Browse files
committed
[cxx-interop] Test import-as-member for inline functions
rdar://138930477
1 parent f8664ad commit deb3090

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

test/Interop/Cxx/namespace/Inputs/import-as-member.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ struct NestedStruct {
88

99
int nestedStruct_method(MyNS::NestedStruct p) SWIFT_NAME("MyNS.NestedStruct.method(self:)") { return p.value; }
1010
int nestedStruct_methodConstRef(const MyNS::NestedStruct &p) SWIFT_NAME("MyNS.NestedStruct.methodConstRef(self:)") { return p.value + 1; }
11+
inline int nestedStruct_methodInline(MyNS::NestedStruct p) SWIFT_NAME("MyNS.NestedStruct.methodInline(self:)") { return p.value + 2; }
1112

1213
namespace MyNS {
1314
namespace MyDeepNS {

test/Interop/Cxx/namespace/import-as-member-module-interface.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// CHECK: extension MyNS.NestedStruct {
44
// CHECK-NEXT: func method() -> Int32
55
// CHECK-NEXT: func methodConstRef() -> Int32
6+
// CHECK-NEXT: func methodInline() -> Int32
67
// CHECK-NEXT: }
78

89
// CHECK: extension MyNS.MyDeepNS.DeepNestedStruct {

test/Interop/Cxx/namespace/import-as-member.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ NamespacesTestSuite.test("Struct in a namespace") {
1111
let s = MyNS.NestedStruct()
1212
expectEqual(123, s.method())
1313
expectEqual(124, s.methodConstRef())
14+
expectEqual(125, s.methodInline())
1415
}
1516

1617
NamespacesTestSuite.test("Struct in a deep namespace") {

0 commit comments

Comments
 (0)