summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll')
-rw-r--r--test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll b/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll
new file mode 100644
index 000000000000..50533db06d55
--- /dev/null
+++ b/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep add
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul
+; PR2330
+
+define i1 @f(i32 %x, i32 %y) nounwind {
+entry:
+ %A = add i32 %x, 5
+ %B = add i32 %y, 5
+ %C = icmp eq i32 %A, %B
+ ret i1 %C
+}
+
+define i1 @g(i32 %x, i32 %y) nounwind {
+entry:
+ %A = mul i32 %x, 5
+ %B = mul i32 %y, 5
+ %C = icmp eq i32 %A, %B
+ ret i1 %C
+}