summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/sub.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-12 23:52:51 +0000
committerChris Lattner <sabre@nondot.org>2004-03-12 23:52:51 +0000
commit99780ce87466692c9106acce9b6e5b19ebfa4644 (patch)
tree2f902fc9e2f71f633da3e1cb6d6d2619a48d1162 /test/Transforms/InstCombine/sub.ll
parent7a82ba0510aece59f59fe988ab273c3542b4d559 (diff)
downloadllvm-99780ce87466692c9106acce9b6e5b19ebfa4644.tar.gz
llvm-99780ce87466692c9106acce9b6e5b19ebfa4644.tar.bz2
llvm-99780ce87466692c9106acce9b6e5b19ebfa4644.tar.xz
new testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/sub.ll')
-rw-r--r--test/Transforms/InstCombine/sub.ll14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/sub.ll b/test/Transforms/InstCombine/sub.ll
index ad1ae0a548..59dc5bd06e 100644
--- a/test/Transforms/InstCombine/sub.ll
+++ b/test/Transforms/InstCombine/sub.ll
@@ -1,7 +1,7 @@
; This test makes sure that these instructions are properly eliminated.
;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep sub | not grep -v 'sub int %Cok, %Bok'
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep -v 'sub int %Cok, %Bok' | not grep sub
implementation
@@ -74,3 +74,15 @@ bool %test11(ubyte %A, ubyte %B) {
%cD = setne ubyte %C, 0 ; == setne A, B
ret bool %cD
}
+
+int %test12(int %A) {
+ %B = shr int %A, ubyte 31
+ %C = sub int 0, %B ; == ushr A, 31
+ ret int %C
+}
+
+uint %test13(uint %A) {
+ %B = shr uint %A, ubyte 31
+ %C = sub uint 0, %B ; == sar A, 31
+ ret uint %C
+}