Skip to content

Commit 906a4b9

Browse files
committed
[Test] Ensourced extended-liveness.
Moved the test next to the code it calls.
1 parent 1cd2632 commit 906a4b9

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

lib/SIL/Utils/OwnershipLiveness.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,4 +413,24 @@ static FunctionTest
413413
liveness.getLiveness().computeBoundary(boundary);
414414
boundary.print(llvm::outs());
415415
});
416+
417+
// Arguments:
418+
// - SILValue: value
419+
// Dumps:
420+
// - function
421+
// - the computed pruned liveness
422+
// - the liveness boundary
423+
static FunctionTest ExtendedLinearLivenessTest(
424+
"extended-liveness", [](auto &function, auto &arguments, auto &test) {
425+
SILValue value = arguments.takeValue();
426+
function.dump();
427+
llvm::dbgs() << "Extended liveness: " << value;
428+
ExtendedLinearLiveness liveness(value);
429+
liveness.compute();
430+
liveness.print(llvm::outs());
431+
432+
PrunedLivenessBoundary boundary;
433+
liveness.getLiveness().computeBoundary(boundary);
434+
boundary.print(llvm::outs());
435+
});
416436
} // end namespace swift::test

lib/SILOptimizer/UtilityPasses/TestRunner.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -311,26 +311,6 @@ static FunctionTest FieldSensitiveMultiDefUseLiveRangeTest(
311311
boundary.print(llvm::errs());
312312
});
313313

314-
// Arguments:
315-
// - SILValue: value
316-
// Dumps:
317-
// - function
318-
// - the computed pruned liveness
319-
// - the liveness boundary
320-
static FunctionTest ExtendedLinearLivenessTest(
321-
"extended-liveness", [](auto &function, auto &arguments, auto &test) {
322-
SILValue value = arguments.takeValue();
323-
function.dump();
324-
llvm::dbgs() << "Extended liveness: " << value;
325-
ExtendedLinearLiveness liveness(value);
326-
liveness.compute();
327-
liveness.print(llvm::outs());
328-
329-
PrunedLivenessBoundary boundary;
330-
liveness.getLiveness().computeBoundary(boundary);
331-
boundary.print(llvm::outs());
332-
});
333-
334314
// Arguments:
335315
// - SILValue: value
336316
// Dumps:

0 commit comments

Comments
 (0)