static llvm::cl::opt<bool>
MathErrno("fmath-errno",
llvm::cl::desc("Require math functions to respect errno"),
- llvm::cl::init(true));
+ llvm::cl::init(true), llvm::cl::AllowInverse);
//===----------------------------------------------------------------------===//
// Analyzer Options.
-// RUN: clang -fsyntax-only -verify %s
+// RUN: clang -fsyntax-only -verify -fno-math-errno %s
int foo(int X, int Y);
+double sqrt(double X); // implicitly const because of -fno-math-errno!
+
void bar(volatile int *VP, int *P, int A,
_Complex double C, volatile _Complex double VC) {
__real__ C; // expected-warning {{expression result unused}}
__real__ VC;
+
+ // We know this can't change errno because of -fno-math-errno.
+ sqrt(A); // expected-warning {{expression result unused}}
}
extern void t1();