Skip to content

Commit 8f0378c

Browse files
committed
[Test] Ensourced find-enclosing-defs.
Moved the test next to the code it calls.
1 parent a3db694 commit 8f0378c

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,6 +2063,23 @@ bool swift::visitEnclosingDefs(SILValue value,
20632063
.visitEnclosingDefs(value, visitor);
20642064
}
20652065

2066+
namespace swift::test {
2067+
// Arguments:
2068+
// - SILValue: value
2069+
// Dumps:
2070+
// - function
2071+
// - the enclosing defs
2072+
static FunctionTest FindEnclosingDefsTest(
2073+
"find-enclosing-defs", [](auto &function, auto &arguments, auto &test) {
2074+
function.dump();
2075+
llvm::dbgs() << "Enclosing Defs:\n";
2076+
visitEnclosingDefs(arguments.takeValue(), [](SILValue def) {
2077+
def->dump();
2078+
return true;
2079+
});
2080+
});
2081+
} // end namespace swift::test
2082+
20662083
bool swift::visitBorrowIntroducers(SILValue value,
20672084
function_ref<bool(SILValue)> visitor) {
20682085
if (isa<SILUndef>(value))

lib/SILOptimizer/UtilityPasses/TestRunner.cpp

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

314-
// Arguments:
315-
// - SILValue: value
316-
// Dumps:
317-
// - function
318-
// - the enclosing defs
319-
static FunctionTest FindEnclosingDefsTest(
320-
"find-enclosing-defs", [](auto &function, auto &arguments, auto &test) {
321-
function.dump();
322-
llvm::dbgs() << "Enclosing Defs:\n";
323-
visitEnclosingDefs(arguments.takeValue(), [](SILValue def) {
324-
def->dump();
325-
return true;
326-
});
327-
});
328-
329314
// Arguments:
330315
// - SILValue: value
331316
// Dumps:

0 commit comments

Comments
 (0)