summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-03-08 03:32:42 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-03-08 03:32:42 +0000
commitd60cb3822f6095bb77e6918b1b32e3bc515cc513 (patch)
tree59130dcd54de89610524551e155fff086593680d /llvm
parent85f3fa5411a86e36cc9b97c2a906827b1a356ccc (diff)
downloadbcm5719-llvm-d60cb3822f6095bb77e6918b1b32e3bc515cc513.tar.gz
bcm5719-llvm-d60cb3822f6095bb77e6918b1b32e3bc515cc513.zip
Test case for r152280, r152285 and r152290.
llvm-svn: 152292
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/CodeGen/Mips/zeroreg.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/zeroreg.ll b/llvm/test/CodeGen/Mips/zeroreg.ll
new file mode 100644
index 00000000000..b890e1dba9f
--- /dev/null
+++ b/llvm/test/CodeGen/Mips/zeroreg.ll
@@ -0,0 +1,27 @@
+; RUN: llc < %s -march=mipsel | FileCheck %s
+
+@g1 = external global i32
+
+define i32 @foo0(i32 %s) nounwind readonly {
+entry:
+; CHECK-NOT: addiu
+; CHECK: movn
+ %tobool = icmp ne i32 %s, 0
+ %0 = load i32* @g1, align 4, !tbaa !0
+ %cond = select i1 %tobool, i32 0, i32 %0
+ ret i32 %cond
+}
+
+define i32 @foo1(i32 %s) nounwind readonly {
+entry:
+; CHECK-NOT: addiu
+; CHECK: movz
+ %tobool = icmp ne i32 %s, 0
+ %0 = load i32* @g1, align 4, !tbaa !0
+ %cond = select i1 %tobool, i32 %0, i32 0
+ ret i32 %cond
+}
+
+!0 = metadata !{metadata !"int", metadata !1}
+!1 = metadata !{metadata !"omnipotent char", metadata !2}
+!2 = metadata !{metadata !"Simple C/C++ TBAA", null}
OpenPOWER on IntegriCloud