summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanak@gmail.com>2011-05-28 01:07:07 +0000
committerAkira Hatanaka <ahatanak@gmail.com>2011-05-28 01:07:07 +0000
commitb406843fe5daa38d36c2f2fc6c41078334e63107 (patch)
treefc2578922d9049e3126c568563229238066c1d76 /llvm/test
parent8816bbc02db7fbf9b678418725300f5ea724ac25 (diff)
downloadbcm5719-llvm-b406843fe5daa38d36c2f2fc6c41078334e63107.tar.gz
bcm5719-llvm-b406843fe5daa38d36c2f2fc6c41078334e63107.zip
Define a wrapper node for target constant nodes (tglobaladdr, etc.).
Need this to prevent emitting illegal conditional move instructions. llvm-svn: 132240
Diffstat (limited to 'llvm/test')
-rwxr-xr-xllvm/test/CodeGen/Mips/cmov.ll18
1 files changed, 17 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/Mips/cmov.ll b/llvm/test/CodeGen/Mips/cmov.ll
index 8329c891f0c..ec3796190cc 100755
--- a/llvm/test/CodeGen/Mips/cmov.ll
+++ b/llvm/test/CodeGen/Mips/cmov.ll
@@ -4,8 +4,8 @@
@i1 = global [3 x i32] [i32 1, i32 2, i32 3], align 4
@i3 = common global i32* null, align 4
-; CHECK: lw ${{[0-9]+}}, %got(i3)($gp)
; CHECK: addiu ${{[0-9]+}}, $gp, %got(i1)
+; CHECK: lw ${{[0-9]+}}, %got(i3)($gp)
define i32* @cmov1(i32 %s) nounwind readonly {
entry:
%tobool = icmp ne i32 %s, 0
@@ -14,3 +14,19 @@ entry:
ret i32* %cond
}
+@c = global i32 1, align 4
+@d = global i32 0, align 4
+
+; CHECK: cmov2:
+; CHECK: addiu $[[R0:[0-9]+]], $gp, %got(c)
+; CHECK: addiu $[[R1:[0-9]+]], $gp, %got(d)
+; CHECK: movn $[[R1]], $[[R0]], ${{[0-9]+}}
+define i32 @cmov2(i32 %s) nounwind readonly {
+entry:
+ %tobool = icmp ne i32 %s, 0
+ %tmp1 = load i32* @c, align 4
+ %tmp2 = load i32* @d, align 4
+ %cond = select i1 %tobool, i32 %tmp1, i32 %tmp2
+ ret i32 %cond
+}
+
OpenPOWER on IntegriCloud