Skip to content

Commit a3db694

Browse files
committed
[Test] Ensourced visit-inner-adjacent-phis.
Moved the test next to the code it calls.
1 parent bddc946 commit a3db694

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,6 +2173,24 @@ bool swift::visitInnerAdjacentPhis(SILArgument *phi,
21732173
return true;
21742174
}
21752175

2176+
namespace swift::test {
2177+
// Arguments:
2178+
// - SILValue: phi
2179+
// Dumps:
2180+
// - function
2181+
// - the adjacent phis
2182+
static FunctionTest VisitInnerAdjacentPhisTest(
2183+
"visit-inner-adjacent-phis",
2184+
[](auto &function, auto &arguments, auto &test) {
2185+
function.dump();
2186+
visitInnerAdjacentPhis(cast<SILPhiArgument>(arguments.takeValue()),
2187+
[](auto *argument) -> bool {
2188+
argument->dump();
2189+
return true;
2190+
});
2191+
});
2192+
} // end namespace swift::test
2193+
21762194
void swift::visitTransitiveEndBorrows(
21772195
SILValue value,
21782196
function_ref<void(EndBorrowInst *)> visitEndBorrow) {

lib/SILOptimizer/UtilityPasses/TestRunner.cpp

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

314-
// Arguments:
315-
// - SILValue: phi
316-
// Dumps:
317-
// - function
318-
// - the adjacent phis
319-
static FunctionTest VisitInnerAdjacentPhisTest(
320-
"visit-inner-adjacent-phis",
321-
[](auto &function, auto &arguments, auto &test) {
322-
function.dump();
323-
visitInnerAdjacentPhis(cast<SILPhiArgument>(arguments.takeValue()),
324-
[](auto *argument) -> bool {
325-
argument->dump();
326-
return true;
327-
});
328-
});
329-
330314
// Arguments:
331315
// - SILValue: value
332316
// Dumps:

0 commit comments

Comments
 (0)