OSDN Git Service

add some tests for floating point compare
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 10 Oct 2006 14:26:06 +0000 (14:26 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 10 Oct 2006 14:26:06 +0000 (14:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30855 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/ARM/fpcmp.ll [new file with mode: 0644]

diff --git a/test/CodeGen/ARM/fpcmp.ll b/test/CodeGen/ARM/fpcmp.ll
new file mode 100644 (file)
index 0000000..6d9012d
--- /dev/null
@@ -0,0 +1,41 @@
+; RUN: llvm-as < %s | llc -march=arm &&
+; RUN: llvm-as < %s | llc -march=arm  | grep movlt &&
+; RUN: llvm-as < %s | llc -march=arm  | grep moveq &&
+; RUN: llvm-as < %s | llc -march=arm  | grep movgt &&
+; RUN: llvm-as < %s | llc -march=arm  | grep movge &&
+; RUN: llvm-as < %s | llc -march=arm  | grep movle
+
+int %f1(float %a) {
+entry:
+       %tmp = setlt float %a, 1.000000e+00             ; <bool> [#uses=1]
+       %tmp = cast bool %tmp to int            ; <int> [#uses=1]
+       ret int %tmp
+}
+
+int %f2(float %a) {
+entry:
+       %tmp = seteq float %a, 1.000000e+00             ; <bool> [#uses=1]
+       %tmp = cast bool %tmp to int            ; <int> [#uses=1]
+       ret int %tmp
+}
+
+int %f3(float %a) {
+entry:
+       %tmp = setgt float %a, 1.000000e+00             ; <bool> [#uses=1]
+       %tmp = cast bool %tmp to int            ; <int> [#uses=1]
+       ret int %tmp
+}
+
+int %f4(float %a) {
+entry:
+       %tmp = setge float %a, 1.000000e+00             ; <bool> [#uses=1]
+       %tmp = cast bool %tmp to int            ; <int> [#uses=1]
+       ret int %tmp
+}
+
+int %f5(float %a) {
+entry:
+       %tmp = setle float %a, 1.000000e+00             ; <bool> [#uses=1]
+       %tmp = cast bool %tmp to int            ; <int> [#uses=1]
+       ret int %tmp
+}