Skip to content

Commit 3a340c7

Browse files
committed
[cxx-interop] move-only: do not test consume with unsafeAddress accessors - they do not yet work
1 parent 633e7f1 commit 3a340c7

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

test/Interop/Cxx/class/move-only/move-only-cxx-value-type-generics.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -enable-experimental-feature NoncopyableGenerics)
2+
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -enable-experimental-feature NoncopyableGenerics -O)
23
//
34
// REQUIRES: executable_test
45

@@ -27,9 +28,11 @@ MoveOnlyCxxValueType.test("Test move only type ref return pointee borrow") {
2728
expectEqual(k, 2)
2829
k = borrowNC(holder.__returnMutNonCopyableRefUnsafe().pointee)
2930
expectEqual(k, 6)
31+
#if ALLOW_CONSUME
3032
consumingNC(holder.__returnMutNonCopyableRefUnsafe().pointee)
3133
k = borrowNC(holder.__returnNonCopyableRefUnsafe().pointee)
3234
expectEqual(k, -123 * 3)
35+
#endif
3336
}
3437

3538
runAllTests()

test/Interop/Cxx/class/move-only/move-only-cxx-value-type.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop)
2+
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -O)
23
//
34
// REQUIRES: executable_test
45

test/Interop/Cxx/operators/move-only/move-only-synthesized-properties.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop)
2+
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -O)
23
//
34
// REQUIRES: executable_test
45

@@ -44,8 +45,10 @@ MoveOnlyCxxOperators.test("testNonCopyableHolderPairedDeref pointee borrow") {
4445
expectEqual(holder.pointee.x, 3)
4546
holder.pointee.x = 34
4647
expectEqual(holder.pointee.x, 34)
48+
#if SUPPORT_CONSUME
4749
consumingNC(holder.pointee)
4850
expectEqual(holder.pointee.x, 0)
51+
#endif
4952
}
5053

5154
MoveOnlyCxxOperators.test("testNonCopyableHolderMutDeref pointee borrow") {
@@ -63,8 +66,10 @@ MoveOnlyCxxOperators.test("testNonCopyableHolderMutDeref pointee borrow") {
6366
expectEqual(holder.pointee.x, 3)
6467
holder.pointee.x = 34
6568
expectEqual(holder.pointee.x, 34)
69+
#if SUPPORT_CONSUME
6670
consumingNC(holder.pointee)
6771
expectEqual(holder.pointee.x, 0)
72+
#endif
6873
}
6974

7075
MoveOnlyCxxOperators.test("testNonCopyableHolderValueConstDeref pointee value") {
@@ -106,8 +111,10 @@ MoveOnlyCxxOperators.test("testNonCopyableHolderPairedDerefDerivedDerived pointe
106111
expectEqual(holder.pointee.x, 3)
107112
holder.pointee.x = 34
108113
expectEqual(holder.pointee.x, 34)
114+
#if SUPPORT_CONSUME
109115
consumingNC(holder.pointee)
110116
expectEqual(holder.pointee.x, 0)
117+
#endif
111118
}
112119

113120
MoveOnlyCxxOperators.test("testNonCopyableHolderMutDerefDerivedDerived pointee borrow") {
@@ -125,8 +132,10 @@ MoveOnlyCxxOperators.test("testNonCopyableHolderMutDerefDerivedDerived pointee b
125132
expectEqual(holder.pointee.x, 3)
126133
holder.pointee.x = 34
127134
expectEqual(holder.pointee.x, 34)
135+
#if SUPPORT_CONSUME
128136
consumingNC(holder.pointee)
129137
expectEqual(holder.pointee.x, 0)
138+
#endif
130139
}
131140

132141
MoveOnlyCxxOperators.test("testNonCopyableHolderValueConstDerefDerivedDerived pointee value") {

0 commit comments

Comments
 (0)