llvm-project
9527c104 - [CIR] Add RegionBranchOpInterface unit tests and fix control flow bugs (#195433)

Commit
25 days ago
[CIR] Add RegionBranchOpInterface unit tests and fix control flow bugs (#195433) Add unit tests for RegionBranchOpInterface implementations across CIR control flow operations: IfOp, ScopeOp, TernaryOp, SwitchOp, WhileOp, ForOp, DoWhileOp, and TryOp. The tests verify successor regions, terminator successors, loop detection, repetitive region marking, and op/terminator successor consistency. Fix a missing return in ConditionOp::getSuccessorRegions that caused fallthrough from the loop case to an unconditional cast<AwaitOp>, crashing when the parent is a loop operation. Fix IfOp::getSuccessorRegions to report parent exit as a successor when the else region is absent, correctly modeling the case where the condition is false.
Author
Parents
Loading