aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/Analysis/CFGTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Analysis/CFGTest.cpp')
-rw-r--r--unittests/Analysis/CFGTest.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/unittests/Analysis/CFGTest.cpp b/unittests/Analysis/CFGTest.cpp
index 2358803..e931709 100644
--- a/unittests/Analysis/CFGTest.cpp
+++ b/unittests/Analysis/CFGTest.cpp
@@ -147,6 +147,23 @@ TEST_F(IsPotentiallyReachableTest, SameBlockPath) {
ExpectPath(true);
}
+TEST_F(IsPotentiallyReachableTest, SameBlockNoLoop) {
+ ParseAssembly(
+ "define void @test() {\n"
+ "entry:\n"
+ " br label %middle\n"
+ "middle:\n"
+ " %B = bitcast i8 undef to i8\n"
+ " bitcast i8 undef to i8\n"
+ " bitcast i8 undef to i8\n"
+ " %A = bitcast i8 undef to i8\n"
+ " br label %nextblock\n"
+ "nextblock:\n"
+ " ret void\n"
+ "}\n");
+ ExpectPath(false);
+}
+
TEST_F(IsPotentiallyReachableTest, StraightNoPath) {
ParseAssembly(
"define void @test() {\n"