[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll
Reid Spencer
reid at x10sys.com
Mon Nov 27 11:54:38 PST 2006
Changes in directory llvm/test/Regression/CodeGen/X86:
trunc-to-bool.ll updated: 1.2 -> 1.3
---
Log message:
Add 3 more test cases for ptrtoint, fptoui and fptosi
---
Diffs of the changes: (+28 -1)
trunc-to-bool.ll | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletion(-)
Index: llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll
diff -u llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll:1.2 llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll:1.3
--- llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll:1.2 Sun Nov 26 23:08:03 2006
+++ llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll Mon Nov 27 13:54:23 2006
@@ -2,7 +2,7 @@
; sure only the LSBit survives. Test that this is the case both for a returned
; value and as the operand of a branch.
; RUN: llvm-as < %s | llc -march=x86 &&
-; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | wc -l | grep 3
+; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | wc -l | grep 6
bool %test1(int %X) {
%Y = trunc int %X to bool
ret bool %Y
@@ -30,3 +30,30 @@
cond_false:
ret int 42
}
+
+int %test4(sbyte* %ptr) {
+ %tmp = ptrtoint sbyte* %ptr to bool
+ br bool %tmp, label %cond_true, label %cond_false
+cond_true:
+ ret int 21
+cond_false:
+ ret int 42
+}
+
+int %test5(float %f) {
+ %tmp = fptoui float %f to bool
+ br bool %tmp, label %cond_true, label %cond_false
+cond_true:
+ ret int 21
+cond_false:
+ ret int 42
+}
+
+int %test6(double %d) {
+ %tmp = fptosi double %d to bool
+ br bool %tmp, label %cond_true, label %cond_false
+cond_true:
+ ret int 21
+cond_false:
+ ret int 42
+}
More information about the llvm-commits
mailing list