Emit neg.s or neg.d only if -enable-no-nans-fp-math is supplied by user,
[oota-llvm.git] / test / CodeGen / Mips / fneg.ll
diff --git a/test/CodeGen/Mips/fneg.ll b/test/CodeGen/Mips/fneg.ll
new file mode 100644 (file)
index 0000000..162146f
--- /dev/null
@@ -0,0 +1,17 @@
+; RUN: llc  < %s -march=mipsel -mcpu=mips32 | FileCheck %s 
+
+define float @foo0(i32 %a, float %d) nounwind readnone {
+entry:
+; CHECK-NOT: fabs.s
+  %sub = fsub float -0.000000e+00, %d
+  ret float %sub
+}
+
+define double @foo1(i32 %a, double %d) nounwind readnone {
+entry:
+; CHECK: foo1
+; CHECK-NOT: fabs.d
+; CHECK: jr
+  %sub = fsub double -0.000000e+00, %d
+  ret double %sub
+}