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
5154MoveOnlyCxxOperators . 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
7075MoveOnlyCxxOperators . 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
113120MoveOnlyCxxOperators . 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
132141MoveOnlyCxxOperators . test ( " testNonCopyableHolderValueConstDerefDerivedDerived pointee value " ) {
0 commit comments