Fix an erroneous check for isFNeg; the FNeg case is handled
authorDan Gohman <gohman@apple.com>
Thu, 4 Jun 2009 23:43:29 +0000 (23:43 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 4 Jun 2009 23:43:29 +0000 (23:43 +0000)
a few lines later on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72904 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp
test/CodeGen/CBackend/fneg.ll [new file with mode: 0644]

index ed3ff8171f2333016d021d1baafd13ba2e80ed22..5814d2750edcc6c5fd9825f7803c3486318deb4a 100644 (file)
@@ -2600,7 +2600,7 @@ void CWriter::visitBinaryOperator(Instruction &I) {
 
   // If this is a negation operation, print it out as such.  For FP, we don't
   // want to print "-0.0 - X".
-  if (BinaryOperator::isNeg(&I) || BinaryOperator::isFNeg(&I)) {
+  if (BinaryOperator::isNeg(&I)) {
     Out << "-(";
     writeOperand(BinaryOperator::getNegArgument(cast<BinaryOperator>(&I)));
     Out << ")";
diff --git a/test/CodeGen/CBackend/fneg.ll b/test/CodeGen/CBackend/fneg.ll
new file mode 100644 (file)
index 0000000..68849b2
--- /dev/null
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llc -march=c
+
+define void @func() nounwind {
+  entry:
+  %0 = fsub double -0.0, undef
+  ret void
+}