summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-01-28 03:48:02 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-01-28 03:48:02 +0000
commit4189a538e4ae10e6ed359b07cdcc96fd0822c811 (patch)
tree7bec3284da2ad606d0a1fec9d5e75fd5db2bab30 /test
parent25feae555d7c50c35a156373fa79ce50453746fd (diff)
downloadllvm-4189a538e4ae10e6ed359b07cdcc96fd0822c811.tar.gz
llvm-4189a538e4ae10e6ed359b07cdcc96fd0822c811.tar.bz2
llvm-4189a538e4ae10e6ed359b07cdcc96fd0822c811.tar.xz
Handle some more combinations of extend and icmp. Fixes PR1940.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46431 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll b/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll
new file mode 100644
index 0000000000..12bfb80a16
--- /dev/null
+++ b/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | opt -instcombine | notcast
+; RUN: llvm-as < %s | opt -instcombine | not grep {icmp s}
+; PR1940
+
+define i1 @test1(i8 %A, i8 %B) {
+ %a = zext i8 %A to i32
+ %b = zext i8 %B to i32
+ %c = icmp sgt i32 %a, %b
+ ret i1 %c
+}
+
+define i1 @test2(i8 %A, i8 %B) {
+ %a = sext i8 %A to i32
+ %b = sext i8 %B to i32
+ %c = icmp ugt i32 %a, %b
+ ret i1 %c
+}