File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -2793,6 +2793,23 @@ bool SimplifyCFG::canonicalizeSwitchEnums() {
2793
2793
return Changed;
2794
2794
}
2795
2795
2796
+ namespace swift ::test {
2797
+ // / Arguments:
2798
+ // / - none
2799
+ // / Dumps:
2800
+ // / - nothing
2801
+ static FunctionTest SimplifyCFGCanonicalizeSwitchEnum (
2802
+ " simplify-cfg-canonicalize-switch-enum" ,
2803
+ [](auto &function, auto &arguments, auto &test) {
2804
+ auto *passToRun = cast<SILFunctionTransform>(createSimplifyCFG ());
2805
+ passToRun->injectPassManager (test.getPassManager ());
2806
+ passToRun->injectFunction (&function);
2807
+ SimplifyCFG (function, *passToRun, /* VerifyAll=*/ false ,
2808
+ /* EnableJumpThread=*/ false )
2809
+ .canonicalizeSwitchEnums ();
2810
+ });
2811
+ } // end namespace swift::test
2812
+
2796
2813
static SILBasicBlock *isObjCMethodCallBlock (SILBasicBlock &Block) {
2797
2814
auto *Branch = dyn_cast<BranchInst>(Block.getTerminator ());
2798
2815
if (!Branch)
Original file line number Diff line number Diff line change @@ -315,17 +315,6 @@ static FunctionTest FieldSensitiveMultiDefUseLiveRangeTest(
315
315
// MARK: SimplifyCFG Unit Tests
316
316
// ===----------------------------------------------------------------------===//
317
317
318
- static FunctionTest SimplifyCFGCanonicalizeSwitchEnum (
319
- " simplify-cfg-canonicalize-switch-enum" ,
320
- [](auto &function, auto &arguments, auto &test) {
321
- auto *passToRun = cast<SILFunctionTransform>(createSimplifyCFG ());
322
- passToRun->injectPassManager (test.getPassManager ());
323
- passToRun->injectFunction (&function);
324
- SimplifyCFG (function, *passToRun, /* VerifyAll=*/ false ,
325
- /* EnableJumpThread=*/ false )
326
- .canonicalizeSwitchEnums ();
327
- });
328
-
329
318
static FunctionTest SimplifyCFGSimplifySwitchEnumBlock (
330
319
" simplify-cfg-simplify-switch-enum-block" ,
331
320
[](auto &function, auto &arguments, auto &test) {
You can’t perform that action at this time.
0 commit comments