mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Test] Ensourced simplify-cfg-canonicalize....
-switch-enum. Moved the test next to the code it calls.
This commit is contained in:
@@ -2793,6 +2793,23 @@ bool SimplifyCFG::canonicalizeSwitchEnums() {
|
||||
return Changed;
|
||||
}
|
||||
|
||||
namespace swift::test {
|
||||
/// Arguments:
|
||||
/// - none
|
||||
/// Dumps:
|
||||
/// - nothing
|
||||
static FunctionTest SimplifyCFGCanonicalizeSwitchEnum(
|
||||
"simplify-cfg-canonicalize-switch-enum",
|
||||
[](auto &function, auto &arguments, auto &test) {
|
||||
auto *passToRun = cast<SILFunctionTransform>(createSimplifyCFG());
|
||||
passToRun->injectPassManager(test.getPassManager());
|
||||
passToRun->injectFunction(&function);
|
||||
SimplifyCFG(function, *passToRun, /*VerifyAll=*/false,
|
||||
/*EnableJumpThread=*/false)
|
||||
.canonicalizeSwitchEnums();
|
||||
});
|
||||
} // end namespace swift::test
|
||||
|
||||
static SILBasicBlock *isObjCMethodCallBlock(SILBasicBlock &Block) {
|
||||
auto *Branch = dyn_cast<BranchInst>(Block.getTerminator());
|
||||
if (!Branch)
|
||||
|
||||
Reference in New Issue
Block a user