File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -1790,6 +1790,24 @@ bool SimplifyCFG::simplifySwitchEnumUnreachableBlocks(SwitchEnumInst *SEI) {
1790
1790
return true ;
1791
1791
}
1792
1792
1793
+ namespace swift ::test {
1794
+ // / Arguments:
1795
+ // / - SwitchEnumInst - the instruction to to simplify
1796
+ // / Dumps:
1797
+ // / - nothing
1798
+ static FunctionTest SimplifyCFGSimplifySwitchEnumUnreachableBlocks (
1799
+ " simplify-cfg-simplify-switch-enum-unreachable-blocks" ,
1800
+ [](auto &function, auto &arguments, auto &test) {
1801
+ auto *passToRun = cast<SILFunctionTransform>(createSimplifyCFG ());
1802
+ passToRun->injectPassManager (test.getPassManager ());
1803
+ passToRun->injectFunction (&function);
1804
+ SimplifyCFG (function, *passToRun, /* VerifyAll=*/ false ,
1805
+ /* EnableJumpThread=*/ false )
1806
+ .simplifySwitchEnumUnreachableBlocks (
1807
+ cast<SwitchEnumInst>(arguments.takeInstruction ()));
1808
+ });
1809
+ } // end namespace swift::test
1810
+
1793
1811
// / Checks that the someBB only contains obj_method calls (possibly chained) on
1794
1812
// / the optional value.
1795
1813
// /
Original file line number Diff line number Diff line change @@ -315,18 +315,6 @@ static FunctionTest FieldSensitiveMultiDefUseLiveRangeTest(
315
315
// MARK: SimplifyCFG Unit Tests
316
316
// ===----------------------------------------------------------------------===//
317
317
318
- static FunctionTest SimplifyCFGSimplifySwitchEnumUnreachableBlocks (
319
- " simplify-cfg-simplify-switch-enum-unreachable-blocks" ,
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
- .simplifySwitchEnumUnreachableBlocks (
327
- cast<SwitchEnumInst>(arguments.takeInstruction ()));
328
- });
329
-
330
318
static FunctionTest SimplifyCFGSimplifyTermWithIdenticalDestBlocks (
331
319
" simplify-cfg-simplify-term-with-identical-dest-blocks" ,
332
320
[](auto &function, auto &arguments, auto &test) {
You can’t perform that action at this time.
0 commit comments