Added -Wfloat-equal option to the driver.  This makes warnings about
floating point comparisons using == or != an opt-in rather than a default
warning.

Updated test case to use -Wfloat-equal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44053 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index f568302..5897da3 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -356,6 +356,10 @@
 WarnUnusedMacros("Wunused_macros",
          llvm::cl::desc("Warn for unused macros in the main translation unit"));
 
+static llvm::cl::opt<bool>
+WarnFloatEqual("Wfloat-equal",
+   llvm::cl::desc("Warn about equality comparisons of floating point values."));
+
 /// InitializeDiagnostics - Initialize the diagnostic object, based on the
 /// current command line option settings.
 static void InitializeDiagnostics(Diagnostic &Diags) {
@@ -366,6 +370,10 @@
   // Silence the "macro is not used" warning unless requested.
   if (!WarnUnusedMacros)
     Diags.setDiagnosticMapping(diag::pp_macro_not_used, diag::MAP_IGNORE);
+               
+  // Silence "floating point comparison" warnings unless requested.
+  if (!WarnFloatEqual)
+    Diags.setDiagnosticMapping(diag::warn_floatingpoint_eq, diag::MAP_IGNORE);
 }
 
 //===----------------------------------------------------------------------===//