diff options
-rw-r--r-- | test/Transforms/InstCombine/phi.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/phi.ll b/test/Transforms/InstCombine/phi.ll index e4b1381f85..52d9157a44 100644 --- a/test/Transforms/InstCombine/phi.ll +++ b/test/Transforms/InstCombine/phi.ll @@ -26,3 +26,23 @@ BB2: ret int %B } +int %test3(int %A, bool %b) { +BB0: br label %Loop + +Loop: + %B = phi int [%A, %BB0], [%B, %Loop] ; PHI has same value always. + br bool %b, label %Loop, label %Exit +Exit: + ret int %B +} + +int %test3(bool %b) { +BB0: ret int 7 ; Loop is unreachable + +Loop: + %B = phi int [%B, %L2], [%B, %Loop] ; PHI has same value always. + br bool %b, label %L2, label %Loop +L2: + br label %Loop +} + |