Index: test/Analysis/RegionInfo/outgoing_edge.ll =================================================================== --- /dev/null +++ test/Analysis/RegionInfo/outgoing_edge.ll @@ -0,0 +1,28 @@ +; REQUIRES: asserts +; RUN: opt -regions -analyze < %s | FileCheck %s + +; While working on improvements to the region info analysis, this test +; case caused an incorrect region 1 => 2 to be detected. It is incorrect +; because entry has an outgoing edge to 3. This is interesting because +; 1 dom 2 and 2 pdom 1, which should have been enough to prevent incoming +; forward edges into the region and outgoing forward edges from the region. + +define void @meread_() nounwind { +entry: + br label %"0" + +"0": ; preds = %"3", %entry + br label %"1" + +"1": ; preds = %"0" + br i1 true, label %"2", label %"3" + +"2": ; preds = %"1" + br i1 true, label %"3", label %end + +"3": ; preds = %"2", %"1" + br label %"0" + +end: ; preds = %"2" + ret void + }