aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/xor2.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/xor2.ll')
-rw-r--r--test/Transforms/InstCombine/xor2.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/xor2.ll b/test/Transforms/InstCombine/xor2.ll
new file mode 100644
index 0000000..efb3146
--- /dev/null
+++ b/test/Transforms/InstCombine/xor2.ll
@@ -0,0 +1,17 @@
+; This test makes sure that these instructions are properly eliminated.
+;
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {xor }
+
+; PR1253
+define i1 @test0(i32 %A) {
+ %B = xor i32 %A, -2147483648
+ %C = icmp sgt i32 %B, -1
+ ret i1 %C
+}
+
+define i1 @test1(i32 %A) {
+ %B = xor i32 %A, 12345
+ %C = icmp slt i32 %B, 0
+ ret i1 %C
+}
+