diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-05-17 19:25:55 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-05-17 19:25:55 +0000 |
commit | de96f39392fedb5f2f538377a57ba52b2d7e346f (patch) | |
tree | 6005e927e9375d37d24133c896c215f641ca84bb | |
parent | c6e05029979522c85a23f0d5ce59a4510e5173c7 (diff) | |
download | bcm5719-llvm-de96f39392fedb5f2f538377a57ba52b2d7e346f.tar.gz bcm5719-llvm-de96f39392fedb5f2f538377a57ba52b2d7e346f.zip |
[InstCombine] add test for wrong icmp constant (PR27792)
The code fix for this was checked in at r269797.
llvm-svn: 269803
-rw-r--r-- | llvm/test/Transforms/InstCombine/icmp.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll index 24a539be2b6..099d15944ab 100644 --- a/llvm/test/Transforms/InstCombine/icmp.ll +++ b/llvm/test/Transforms/InstCombine/icmp.ll @@ -2097,3 +2097,15 @@ if.then3: ; preds = %if.end return: ; preds = %if.end, %entry, %if.then3 ret void } + +; When canonicalizing to 'sgt', make sure the constant is correct. + +define i1 @PR27792(i128 %a) { +; CHECK-LABEL: @PR27792( +; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i128 %a, -1 +; CHECK-NEXT: ret i1 [[CMP]] +; + %cmp = icmp sge i128 %a, 0 + ret i1 %cmp +} + |