summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-04-13 21:45:13 +0000
committerNate Begeman <natebegeman@mac.com>2005-04-13 21:45:13 +0000
commit04ae8736484fb96c646c4835d03a17df8446c6e5 (patch)
tree018a347dfc6550e7a2423313c9474a283c425a91 /llvm
parent4ddd81657bab1e4d025ade5cbca011e19b0f131d (diff)
downloadbcm5719-llvm-04ae8736484fb96c646c4835d03a17df8446c6e5.tar.gz
bcm5719-llvm-04ae8736484fb96c646c4835d03a17df8446c6e5.zip
Add CodeGen tests for the recent SelectionDAG transforms
llvm-svn: 21292
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/Regression/CodeGen/PowerPC/select_lt0.ll45
-rw-r--r--llvm/test/Regression/CodeGen/PowerPC/setcc_no_zext.ll8
2 files changed, 53 insertions, 0 deletions
diff --git a/llvm/test/Regression/CodeGen/PowerPC/select_lt0.ll b/llvm/test/Regression/CodeGen/PowerPC/select_lt0.ll
new file mode 100644
index 00000000000..9d8732e9690
--- /dev/null
+++ b/llvm/test/Regression/CodeGen/PowerPC/select_lt0.ll
@@ -0,0 +1,45 @@
+; RUN: llvm-as < %s | llc -march=ppc32 -enable-ppc-pattern-isel | not grep cmp
+
+int %seli32_1(int %a) {
+entry:
+ %tmp.1 = setlt int %a, 0
+ %retval = select bool %tmp.1, int 5, int 0
+ ret int %retval
+}
+
+int %seli32_2(int %a, int %b) {
+entry:
+ %tmp.1 = setlt int %a, 0
+ %retval = select bool %tmp.1, int %b, int 0
+ ret int %retval
+}
+
+int %seli32_3(int %a, short %b) {
+entry:
+ %tmp.2 = cast short %b to int
+ %tmp.1 = setlt int %a, 0
+ %retval = select bool %tmp.1, int %tmp.2, int 0
+ ret int %retval
+}
+
+int %seli32_4(int %a, ushort %b) {
+entry:
+ %tmp.2 = cast ushort %b to int
+ %tmp.1 = setlt int %a, 0
+ %retval = select bool %tmp.1, int %tmp.2, int 0
+ ret int %retval
+}
+
+short %seli16_1(short %a) {
+entry:
+ %tmp.1 = setlt short %a, 0
+ %retval = select bool %tmp.1, short 7, short 0
+ ret short %retval
+}
+
+short %seli16_2(int %a, short %b) {
+entry:
+ %tmp.1 = setlt int %a, 0
+ %retval = select bool %tmp.1, short %b, short 0
+ ret short %retval
+}
diff --git a/llvm/test/Regression/CodeGen/PowerPC/setcc_no_zext.ll b/llvm/test/Regression/CodeGen/PowerPC/setcc_no_zext.ll
new file mode 100644
index 00000000000..e28d48107d5
--- /dev/null
+++ b/llvm/test/Regression/CodeGen/PowerPC/setcc_no_zext.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llc -march=ppc32 -enable-ppc-pattern-isel | not grep rlwinm
+
+int %setcc_one_or_zero(int* %a) {
+entry:
+ %tmp.1 = setne int* %a, null
+ %inc.1 = cast bool %tmp.1 to int
+ ret int %inc.1
+}
OpenPOWER on IntegriCloud