aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Mips/cmov.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/Mips/cmov.ll')
-rwxr-xr-xtest/CodeGen/Mips/cmov.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/cmov.ll b/test/CodeGen/Mips/cmov.ll
new file mode 100755
index 0000000..7d3e025
--- /dev/null
+++ b/test/CodeGen/Mips/cmov.ll
@@ -0,0 +1,15 @@
+; RUN: llc -march=mips -mcpu=4ke < %s | FileCheck %s
+
+@i1 = global [3 x i32] [i32 1, i32 2, i32 3], align 4
+@i3 = common global i32* null, align 4
+
+; CHECK: lw $3, %got(i3)($gp)
+; CHECK: addiu $5, $gp, %got(i1)
+define i32* @cmov1(i32 %s) nounwind readonly {
+entry:
+ %tobool = icmp ne i32 %s, 0
+ %tmp1 = load i32** @i3, align 4
+ %cond = select i1 %tobool, i32* getelementptr inbounds ([3 x i32]* @i1, i32 0, i32 0), i32* %tmp1
+ ret i32* %cond
+}
+