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 @@ -2138,6 +2138,24 @@ bool SimplifyCFG::simplifySwitchEnumBlock(SwitchEnumInst *SEI) {
2138
2138
return true ;
2139
2139
}
2140
2140
2141
+ namespace swift ::test {
2142
+ // / Arguments:
2143
+ // / - SwitchEnumInst - the instruction to to simplify
2144
+ // / Dumps:
2145
+ // / - nothing
2146
+ static FunctionTest SimplifyCFGSimplifySwitchEnumBlock (
2147
+ " simplify-cfg-simplify-switch-enum-block" ,
2148
+ [](auto &function, auto &arguments, auto &test) {
2149
+ auto *passToRun = cast<SILFunctionTransform>(createSimplifyCFG ());
2150
+ passToRun->injectPassManager (test.getPassManager ());
2151
+ passToRun->injectFunction (&function);
2152
+ SimplifyCFG (function, *passToRun, /* VerifyAll=*/ false ,
2153
+ /* EnableJumpThread=*/ false )
2154
+ .simplifySwitchEnumBlock (
2155
+ cast<SwitchEnumInst>(arguments.takeInstruction ()));
2156
+ });
2157
+ } // end namespace swift::test
2158
+
2141
2159
// / simplifySwitchValueBlock - Simplify a basic block that ends with a
2142
2160
// / switch_value instruction that gets its operand from an integer
2143
2161
// / literal instruction.
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 SimplifyCFGSimplifySwitchEnumBlock (
319
- " simplify-cfg-simplify-switch-enum-block" ,
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
- .simplifySwitchEnumBlock (
327
- cast<SwitchEnumInst>(arguments.takeInstruction ()));
328
- });
329
-
330
318
static FunctionTest SimplifyCFGSwitchEnumOnObjcClassOptional (
331
319
" simplify-cfg-simplify-switch-enum-on-objc-class-optional" ,
332
320
[](auto &function, auto &arguments, auto &test) {
You can’t perform that action at this time.
0 commit comments