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 @@ -2082,6 +2082,24 @@ bool SimplifyCFG::simplifySwitchEnumOnObjcClassOptional(SwitchEnumInst *SEI) {
2082
2082
return true ;
2083
2083
}
2084
2084
2085
+ namespace swift ::test {
2086
+ // / Arguments:
2087
+ // / - SwitchEnumInst - the instruction to to simplify
2088
+ // / Dumps:
2089
+ // / - nothing
2090
+ static FunctionTest SimplifyCFGSwitchEnumOnObjcClassOptional (
2091
+ " simplify-cfg-simplify-switch-enum-on-objc-class-optional" ,
2092
+ [](auto &function, auto &arguments, auto &test) {
2093
+ auto *passToRun = cast<SILFunctionTransform>(createSimplifyCFG ());
2094
+ passToRun->injectPassManager (test.getPassManager ());
2095
+ passToRun->injectFunction (&function);
2096
+ SimplifyCFG (function, *passToRun, /* VerifyAll=*/ false ,
2097
+ /* EnableJumpThread=*/ false )
2098
+ .simplifySwitchEnumOnObjcClassOptional (
2099
+ cast<SwitchEnumInst>(arguments.takeInstruction ()));
2100
+ });
2101
+ } // end namespace swift::test
2102
+
2085
2103
// / simplifySwitchEnumBlock - Simplify a basic block that ends with a
2086
2104
// / switch_enum instruction that gets its operand from an enum
2087
2105
// / 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 SimplifyCFGSwitchEnumOnObjcClassOptional (
319
- " simplify-cfg-simplify-switch-enum-on-objc-class-optional" ,
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
- .simplifySwitchEnumOnObjcClassOptional (
327
- cast<SwitchEnumInst>(arguments.takeInstruction ()));
328
- });
329
-
330
318
static FunctionTest SimplifyCFGSimplifySwitchEnumUnreachableBlocks (
331
319
" simplify-cfg-simplify-switch-enum-unreachable-blocks" ,
332
320
[](auto &function, auto &arguments, auto &test) {
You can’t perform that action at this time.
0 commit comments