OSDN Git Service

Test case for r152280, r152285 and r152290.
authorAkira Hatanaka <ahatanaka@mips.com>
Thu, 8 Mar 2012 03:32:42 +0000 (03:32 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Thu, 8 Mar 2012 03:32:42 +0000 (03:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152292 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/Mips/zeroreg.ll [new file with mode: 0644]

diff --git a/test/CodeGen/Mips/zeroreg.ll b/test/CodeGen/Mips/zeroreg.ll
new file mode 100644 (file)
index 0000000..b890e1d
--- /dev/null
@@ -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}