summaryrefslogtreecommitdiff
path: root/test/CodeGen/Generic/select.ll
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-08-22 03:05:13 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-08-22 03:05:13 +0000
commitddd575101d97d6167fd4a011e2d4f02c7afa9935 (patch)
treed5a0ebd28f1b06c2266b05932cc36ca392ff39f5 /test/CodeGen/Generic/select.ll
parent397f58bb0b63c9a40218f257d6c21922931b17f9 (diff)
downloadllvm-ddd575101d97d6167fd4a011e2d4f02c7afa9935.tar.gz
llvm-ddd575101d97d6167fd4a011e2d4f02c7afa9935.tar.bz2
llvm-ddd575101d97d6167fd4a011e2d4f02c7afa9935.tar.xz
Add functions castbool and boolexpr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Generic/select.ll')
-rw-r--r--test/CodeGen/Generic/select.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGen/Generic/select.ll b/test/CodeGen/Generic/select.ll
index 5976e5f88d..4a34d58785 100644
--- a/test/CodeGen/Generic/select.ll
+++ b/test/CodeGen/Generic/select.ll
@@ -108,6 +108,30 @@ retlbl:
end
+;; Test use of a boolean result in cast operations.
+;; Requires converting a condition code result into a 0/1 value in a reg.
+;;
+implementation
+
+int %castbool(int %A, int %B) {
+bb0: ; [#uses=0]
+ %cond213 = setlt int %A, %B ; <bool> [#uses=1]
+ %cast110 = cast bool %cond213 to ubyte ; <ubyte> [#uses=1]
+ %cast109 = cast ubyte %cast110 to int ; <int> [#uses=1]
+ ret int %cast109
+}
+
+
+;; Test use of a boolean result in arithmetic and logical operations.
+;; Requires converting a condition code result into a 0/1 value in a reg.
+;;
+bool %boolexpr(bool %b, int %N) {
+ %b2 = setge int %N, 0
+ %b3 = and bool %b, %b2
+ ret bool %b3
+}
+
+
; Test branch on floating point comparison
;
void "testfloatbool"(float %x, float %y) ; Def %0, %1 - float