File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
test/Interop/SwiftToCxx/structs Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ int main() {
4040// CHECK: find - small dump
4141// CURRENT-NEXT: x = 66
4242// CHANGE-NEXT: x&y = 0&65
43+ copySmallStruct.mutate ();
44+ copySmallStruct.dump ();
45+ // CHECK: find - small dump
46+ // CURRENT-NEXT: x = 132
47+ // CHANGE-NEXT: x&y = 0&4294967230
4348
4449 printSmallAndLarge (smallStruct, largeStruct);
4550// CHECK: find - small dump
Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ public struct FirstSmallStruct {
1616 print ( " x&y = \( x) & \( y) " )
1717#else
1818 print ( " x = \( x) " )
19+ #endif
20+ }
21+
22+ public mutating func mutate( ) {
23+ x = x * 2
24+ #if CHANGE_LAYOUT
25+ y = ~ y
1926#endif
2027 }
2128}
@@ -61,6 +68,9 @@ public struct FirstSmallStruct {
6168// CHECK-NEXT: inline void FirstSmallStruct::dump() const {
6269// CHECK-NEXT: return _impl::$s7Structs16FirstSmallStructV4dumpyyF(_getOpaquePointer());
6370// CHECK-NEXT: }
71+ // CHECK-NEXT: inline void FirstSmallStruct::mutate() {
72+ // CHECK-NEXT: return _impl::$s7Structs16FirstSmallStructV6mutateyyF(_getOpaquePointer());
73+ // CHECK-NEXT: }
6474
6575@frozen public struct FrozenStruct {
6676 private let storedInt : Int32
You can’t perform that action at this time.
0 commit comments