diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-11-01 10:26:36 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-11-01 10:26:36 +0000 |
commit | 9cb285d510ba759afda24edf4ea32ff3677c4369 (patch) | |
tree | dbf91fe2299926de82ef29c7bfc5f7606d1c003b /test/Transforms/JumpThreading/crash.ll | |
parent | 8fb614cb3bac896f9c85092877b98325385aeb02 (diff) |
Add a test case for PR14233.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/JumpThreading/crash.ll')
-rw-r--r-- | test/Transforms/JumpThreading/crash.ll | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/test/Transforms/JumpThreading/crash.ll b/test/Transforms/JumpThreading/crash.ll index b9c03544db..2fe87464c1 100644 --- a/test/Transforms/JumpThreading/crash.ll +++ b/test/Transforms/JumpThreading/crash.ll @@ -511,3 +511,56 @@ lbl_260: ; preds = %for.cond, %entry if.end: ; preds = %for.cond ret void } + +define void @PR14233(i1 %cmp, i1 %cmp2, i1 %cmp3, i1 %cmp4) { +entry: + br i1 %cmp, label %cond.true, label %cond.false + +cond.true: + br label %if.end + +cond.false: + br label %if.end + +if.end: + %A = phi i64 [ 0, %cond.true ], [ 1, %cond.false ] + br i1 %cmp2, label %bb, label %if.end2 + +bb: + br label %if.end2 + +if.end2: + %B = phi i64 [ ptrtoint (i8* ()* @PR14233.f1 to i64), %bb ], [ %A, %if.end ] + %cmp.ptr = icmp eq i64 %B, ptrtoint (i8* ()* @PR14233.f2 to i64) + br i1 %cmp.ptr, label %cond.true2, label %if.end3 + +cond.true2: + br i1 %cmp3, label %bb2, label %ur + +bb2: + br i1 %cmp4, label %if.end4, label %if.end3 + +if.end4: + unreachable + +if.end3: + %cmp.ptr2 = icmp eq i64 %B, ptrtoint (i8* ()* @PR14233.f2 to i64) + br i1 %cmp.ptr2, label %ur, label %if.then601 + +if.then601: + %C = icmp eq i64 %B, 0 + br i1 %C, label %bb3, label %bb4 + +bb3: + unreachable + +bb4: + unreachable + +ur: + unreachable +} + +declare i8* @PR14233.f1() + +declare i8* @PR14233.f2() |