aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-09-29 17:37:07 +0000
committerChris Lattner <sabre@nondot.org>2004-09-29 17:37:07 +0000
commita2393502be3028d99f62e2ff98f803aa6cf5026e (patch)
tree71c52ddcd3c36e22a51c12021c7ddb38cdbdab74 /test
parent9ed920437aa57886d7c9d98089955e464c3a75e0 (diff)
downloadexternal_llvm-a2393502be3028d99f62e2ff98f803aa6cf5026e.zip
external_llvm-a2393502be3028d99f62e2ff98f803aa6cf5026e.tar.gz
external_llvm-a2393502be3028d99f62e2ff98f803aa6cf5026e.tar.bz2
New testcasses for divides that can be eliminated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16587 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/div.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/div.ll b/test/Transforms/InstCombine/div.ll
index 19e0d40..8e03fc0 100644
--- a/test/Transforms/InstCombine/div.ll
+++ b/test/Transforms/InstCombine/div.ll
@@ -30,3 +30,28 @@ uint %test5(uint %A) {
%C = div uint %B, 4294967292
ret uint %C
}
+
+bool %test6(uint %A) {
+ %B = div uint %A, 123
+ %C = seteq uint %B, 0 ; A < 123
+ ret bool %C
+}
+
+bool %test7(uint %A) {
+ %B = div uint %A, 10
+ %C = seteq uint %B, 2 ; A >= 20 && A < 30
+ ret bool %C
+}
+
+bool %test8(ubyte %A) {
+ %B = div ubyte %A, 123
+ %C = seteq ubyte %B, 2 ; A >= 246
+ ret bool %C
+}
+
+bool %test9(ubyte %A) {
+ %B = div ubyte %A, 123
+ %C = setne ubyte %B, 2 ; A < 246
+ ret bool %C
+}
+