diff options
-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 +} + |