Skip to content

Commit 2f10ca6

Browse files
authored
Merge pull request #6510 from gottesmm/stable/202211013/rdar106921827
[swift] Rename move function related tests to consume operator.
2 parents 1242826 + 9ed4e8e commit 2f10ca6

File tree

8 files changed

+50
-50
lines changed

8 files changed

+50
-50
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SWIFT_SOURCES := main.swift
2+
SWIFTFLAGS_EXTRAS :=
3+
4+
include Makefile.rules

lldb/test/API/lang/swift/variables/move_function/TestSwiftMoveFunction.py renamed to lldb/test/API/lang/swift/variables/consume_operator/TestSwiftConsumeOperator.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# TestSwiftMoveFunction.py
1+
# TestSwiftConsumeOperator.py
22
#
33
# This source file is part of the Swift.org open source project
44
#
@@ -11,7 +11,7 @@
1111
# ------------------------------------------------------------------------------
1212
"""
1313
Check that we properly show variables at various points of the CFG while
14-
stepping with the move function.
14+
stepping with the consume operator.
1515
"""
1616
import lldb
1717
from lldbsuite.test.lldbtest import *
@@ -24,16 +24,16 @@
2424
def stderr_print(line):
2525
sys.stderr.write(line + "\n")
2626

27-
class TestSwiftMoveFunctionType(TestBase):
27+
class TestSwiftConsumeOperatorType(TestBase):
2828

2929
mydir = TestBase.compute_mydir(__file__)
3030

3131
# Skip on aarch64 linux: rdar://91005071
3232
@skipIf(archs=['aarch64'], oslist=['linux'])
3333
@swiftTest
34-
def test_swift_move_function(self):
34+
def test_swift_consume_operator(self):
3535
"""Check that we properly show variables at various points of the CFG while
36-
stepping with the move function.
36+
stepping with the consume operator.
3737
"""
3838
self.build()
3939

@@ -82,7 +82,7 @@ def do_check_copyable_value_test(self):
8282

8383
# Go to breakpoint 3. k should no longer be valid.
8484
self.process.Continue()
85-
self.assertIsNone(varK.value, "K is live but was moved?!")
85+
self.assertIsNone(varK.value, "K is live but was consumed?!")
8686

8787
# Run so we hit the next breakpoint to jump to the next test's
8888
# breakpoint.
@@ -99,7 +99,7 @@ def do_check_copyable_var_test(self):
9999

100100
# Go to breakpoint 3. We invalidated k
101101
self.process.Continue()
102-
self.assertIsNone(varK.value, "K is live but was moved?!")
102+
self.assertIsNone(varK.value, "K is live but was consumed?!")
103103

104104
# Go to the last breakpoint and make sure that k is reinitialized
105105
# properly.
@@ -138,7 +138,7 @@ def do_check_addressonly_var_test(self):
138138

139139
# Go to breakpoint 3. K was invalidated.
140140
self.process.Continue()
141-
self.assertIsNone(varK.value, "K is live but was moved?!")
141+
self.assertIsNone(varK.value, "K is live but was consumed?!")
142142

143143
# Go to the last breakpoint and make sure that k is reinitialized
144144
# properly.
@@ -159,7 +159,7 @@ def do_check_copyable_value_arg_test(self):
159159

160160
# Go to breakpoint 3. k should no longer be valid.
161161
self.process.Continue()
162-
#self.assertIsNone(varK.value, "K is live but was moved?!")
162+
#self.assertIsNone(varK.value, "K is live but was consumed?!")
163163

164164
# Run so we hit the next breakpoint to jump to the next test's
165165
# breakpoint.
@@ -176,7 +176,7 @@ def do_check_copyable_var_arg_test(self):
176176

177177
# Go to breakpoint 3. We invalidated k
178178
self.process.Continue()
179-
self.assertIsNone(varK.value, "K is live but was moved?!")
179+
self.assertIsNone(varK.value, "K is live but was consumed?!")
180180

181181
# Go to the last breakpoint and make sure that k is reinitialized
182182
# properly.
@@ -217,7 +217,7 @@ def do_check_addressonly_var_arg_test(self):
217217

218218
# Go to breakpoint 3. K was invalidated.
219219
self.process.Continue()
220-
self.assertIsNone(varK.value, "K is live but was moved?!")
220+
self.assertIsNone(varK.value, "K is live but was consumed?!")
221221

222222
# Go to the last breakpoint and make sure that k is reinitialized
223223
# properly.
@@ -296,13 +296,13 @@ def do_check_copyable_var_ccf_true_reinit_out_block(self):
296296
# Now we have executed the move and we are about to run code using
297297
# m. Make sure that K is not available!
298298
self.assertEqual(varK.unsigned, 0,
299-
"varK was already moved! Should be nullptr")
299+
"varK was already consumed! Should be nullptr")
300300
self.process.Continue()
301301

302302
# We are now out of the conditional lexical block on the line of code
303303
# that redefines k. k should still be not available.
304304
self.assertEqual(varK.unsigned, 0,
305-
"varK was already moved! Should be nullptr")
305+
"varK was already consumed! Should be nullptr")
306306
self.process.Continue()
307307

308308
# Ok, we have now reinit k and are about to call a method on it. We
@@ -328,7 +328,7 @@ def do_check_copyable_var_ccf_true_reinit_in_block(self):
328328
# Now we have executed the move and we are about to reinit k but have
329329
# not yet. Make sure we are not available!
330330
self.assertEqual(varK.unsigned, 0,
331-
"varK was already moved! Should be nullptr")
331+
"varK was already consumed! Should be nullptr")
332332
self.process.Continue()
333333

334334
# We are now still inside the conditional part of the code, but have
@@ -361,7 +361,7 @@ def do_check_copyable_var_ccf_false_reinit_out_block(self):
361361
# line. Since this is reachable from the move and we haven't reinit yet,
362362
# k should not be available.
363363
self.assertEqual(varK.unsigned, 0,
364-
"varK was already moved! Should be nullptr")
364+
"varK was already consumed! Should be nullptr")
365365
self.process.Continue()
366366

367367
# Ok, we have now reinit k and are about to call a method on it. We

lldb/test/API/lang/swift/variables/move_function/main.swift renamed to lldb/test/API/lang/swift/variables/consume_operator/main.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ public func copyableValueTest() {
3434
print("stop here") // Set breakpoint
3535
let k = Klass()
3636
k.doSomething()
37-
let m = _move k // Set breakpoint
37+
let m = consume k // Set breakpoint
3838
m.doSomething() // Set breakpoint
3939
}
4040

4141
public func copyableVarTest() {
4242
print("stop here") // Set breakpoint
4343
var k = Klass()
4444
k.doSomething()
45-
let m = _move k // Set breakpoint
45+
let m = consume k // Set breakpoint
4646
m.doSomething()
4747
k = Klass() // Set breakpoint
4848
k.doSomething() // Set breakpoint
@@ -53,15 +53,15 @@ public func addressOnlyValueTest<T : P>(_ x: T) {
5353
print("stop here") // Set breakpoint
5454
let k = x
5555
k.doSomething()
56-
let m = _move k // Set breakpoint
56+
let m = consume k // Set breakpoint
5757
m.doSomething() // Set breakpoint
5858
}
5959

6060
public func addressOnlyVarTest<T : P>(_ x: T) {
6161
print("stop here") // Set breakpoint
6262
var k = x
6363
k.doSomething()
64-
let m = _move k // Set breakpoint
64+
let m = consume k // Set breakpoint
6565
m.doSomething()
6666
k = x // Set breakpoint
6767
k.doSomething() // Set breakpoint
@@ -74,14 +74,14 @@ public func addressOnlyVarTest<T : P>(_ x: T) {
7474
public func copyableValueArgTest(_ k: __owned Klass) {
7575
print("stop here") // Set breakpoint
7676
k.doSomething()
77-
let m = _move k // Set breakpoint
77+
let m = consume k // Set breakpoint
7878
m.doSomething() // Set breakpoint
7979
}
8080

8181
public func copyableVarArgTest(_ k: inout Klass) {
8282
print("stop here") // Set breakpoint
8383
k.doSomething()
84-
let m = _move k // Set breakpoint
84+
let m = consume k // Set breakpoint
8585
m.doSomething()
8686
k = Klass() // Set breakpoint
8787
k.doSomething() // Set breakpoint
@@ -91,14 +91,14 @@ public func copyableVarArgTest(_ k: inout Klass) {
9191
public func addressOnlyValueArgTest<T : P>(_ k: __owned T) {
9292
print("stop here") // Set breakpoint
9393
k.doSomething()
94-
let m = _move k // Set breakpoint
94+
let m = consume k // Set breakpoint
9595
m.doSomething() // Set breakpoint
9696
}
9797

9898
public func addressOnlyVarArgTest<T : P>(_ k: inout T, _ x: T) {
9999
print("stop here") // Set breakpoint
100100
k.doSomething()
101-
let m = _move k // Set breakpoint
101+
let m = consume k // Set breakpoint
102102
m.doSomething()
103103
k = x // Set breakpoint
104104
k.doSomething() // Set breakpoint
@@ -112,7 +112,7 @@ public func copyableValueCCFTrueTest() {
112112
let k = Klass() // Set breakpoint
113113
k.doSomething() // Set breakpoint
114114
if trueBoolValue {
115-
let m = _move k // Set breakpoint
115+
let m = consume k // Set breakpoint
116116
m.doSomething() // Set breakpoint
117117
}
118118
// Set breakpoint
@@ -122,7 +122,7 @@ public func copyableValueCCFFalseTest() {
122122
let k = Klass() // Set breakpoint
123123
k.doSomething() // Set breakpoint
124124
if falseBoolValue {
125-
let m = _move k
125+
let m = consume k
126126
m.doSomething()
127127
}
128128
// Set breakpoint
@@ -132,7 +132,7 @@ public func copyableVarTestCCFlowTrueReinitOutOfBlockTest() {
132132
var k = Klass() // Set breakpoint
133133
k.doSomething()
134134
if trueBoolValue {
135-
let m = _move k // Set breakpoint
135+
let m = consume k // Set breakpoint
136136
m.doSomething() // Set breakpoint
137137
}
138138
k = Klass() // Set breakpoint
@@ -143,7 +143,7 @@ public func copyableVarTestCCFlowTrueReinitInBlockTest() {
143143
var k = Klass() // Set breakpoint
144144
k.doSomething()
145145
if trueBoolValue {
146-
let m = _move k // Set breakpoint
146+
let m = consume k // Set breakpoint
147147
m.doSomething()
148148
k = Klass() // Set breakpoint
149149
k.doSomething() // Set breakpoint
@@ -155,7 +155,7 @@ public func copyableVarTestCCFlowFalseReinitOutOfBlockTest() {
155155
var k = Klass() // Set breakpoint
156156
k.doSomething() // Set breakpoint
157157
if falseBoolValue {
158-
let m = _move k
158+
let m = consume k
159159
m.doSomething()
160160
}
161161
k = Klass() // Set breakpoint
@@ -166,7 +166,7 @@ public func copyableVarTestCCFlowFalseReinitInBlockTest() {
166166
var k = Klass() // Set breakpoint
167167
k.doSomething() // Set breakpoint
168168
if falseBoolValue {
169-
let m = _move k
169+
let m = consume k
170170
m.doSomething()
171171
k = Klass()
172172
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SWIFT_SOURCES := main.swift
2+
SWIFTFLAGS_EXTRAS := -parse-as-library
3+
4+
include Makefile.rules

lldb/test/API/lang/swift/variables/move_function_async/TestSwiftMoveFunctionAsync.py renamed to lldb/test/API/lang/swift/variables/consume_operator_async/TestSwiftConsumeOperatorAsync.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# TestSwiftMoveFunctionAsync.py
1+
# TestSwiftConsumeOperatorAsync.py
22
#
33
# This source file is part of the Swift.org open source project
44
#
@@ -11,7 +11,7 @@
1111
# ------------------------------------------------------------------------------
1212
"""
1313
Check that we properly show variables at various points of the CFG while
14-
stepping with the move function.
14+
stepping with the consume operator.
1515
"""
1616
import lldb
1717
from lldbsuite.test.lldbtest import *
@@ -24,14 +24,14 @@
2424
def stderr_print(line):
2525
sys.stderr.write(line + "\n")
2626

27-
class TestSwiftMoveFunctionAsyncType(TestBase):
27+
class TestSwiftConsumeOperatorAsyncType(TestBase):
2828

2929
mydir = TestBase.compute_mydir(__file__)
3030

3131
@swiftTest
32-
def test_swift_move_function_async(self):
32+
def test_swift_consume_operator_async(self):
3333
"""Check that we properly show variables at various points of the CFG while
34-
stepping with the move function.
34+
stepping with the consume operator.
3535
"""
3636
self.build()
3737

@@ -89,16 +89,16 @@ def do_check_copyable_value_test(self):
8989
varK = self.get_var('k')
9090
self.assertGreater(varK.unsigned, 0, "varK not initialized?!")
9191

92-
# We are now at break point 3. We have moved k, it should be empty.
92+
# We are now at break point 3. We have consumed k, it should be empty.
9393
self.continue_to(3)
9494
varK = self.get_var('k')
95-
self.assertIsNone(varK.value, "K is live but was moved?!")
95+
self.assertIsNone(varK.value, "K is live but was consumed?!")
9696

9797
# Finally, we are on the other side of the final force split. Make sure
9898
# the value still isn't available.
9999
self.continue_to(4)
100100
varK = self.get_var('k')
101-
self.assertIsNone(varK.value, "K is live but was moved?!")
101+
self.assertIsNone(varK.value, "K is live but was consumed?!")
102102

103103
def do_check_copyable_var_test(self):
104104
# Run so we hit the next breakpoint to jump to the next test's
@@ -125,17 +125,17 @@ def do_check_copyable_var_test(self):
125125
varK = self.get_var('k')
126126
self.assertGreater(varK.unsigned, 0, "varK not initialized?!")
127127

128-
# We are now at break point 8. We have moved k, it should be empty.
128+
# We are now at break point 8. We have consumed k, it should be empty.
129129
self.continue_to(8)
130130
varK = self.get_var('k')
131-
self.assertIsNone(varK.value, "K is live but was moved?!")
131+
self.assertIsNone(varK.value, "K is live but was consumed?!")
132132

133133
# Now, we are on the other side of the final force split. Make sure
134134
# the value still isn't available.
135135
self.continue_to(9)
136136
self.runCmd('# On other side of force split')
137137
varK = self.get_var('k')
138-
self.assertIsNone(varK.value, "K is live but was moved?!")
138+
self.assertIsNone(varK.value, "K is live but was consumed?!")
139139

140140
# Finally, we have reinitialized k, look for k.
141141
self.continue_to(10)

lldb/test/API/lang/swift/variables/move_function_async/main.swift renamed to lldb/test/API/lang/swift/variables/consume_operator_async/main.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public func copyableValueTest() async {
2525
let k = Klass()
2626
k.doSomething()
2727
await forceSplit() // Set breakpoint 01
28-
let m = _move k // Set breakpoint 02
28+
let m = consume k // Set breakpoint 02
2929
m.doSomething() // Set breakpoint 03
3030
await forceSplit()
3131
m.doSomething() // Set breakpoint 04
@@ -36,7 +36,7 @@ public func copyableVarTest() async {
3636
var k = Klass() // Set breakpoint 05
3737
k.doSomething()
3838
await forceSplit() // Set breakpoint 06
39-
let m = _move k // Set breakpoint 07
39+
let m = consume k // Set breakpoint 07
4040
m.doSomething() // Set breakpoint 08
4141
await forceSplit()
4242
k = Klass() // Set breakpoint 09

lldb/test/API/lang/swift/variables/move_function/Makefile

Lines changed: 0 additions & 4 deletions
This file was deleted.

lldb/test/API/lang/swift/variables/move_function_async/Makefile

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)