Support for the -fno-math-builtin option was added in r186899. The codegen side
is being tested in test/CodeGen/nomathbuiltin.c. The missing part was just
passing the option through the driver.
PR26317
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258814
91177308-0d34-0410-b5e6-
96231b3b80d8
options::OPT_fno_apple_pragma_pack, false))
CmdArgs.push_back("-fapple-pragma-pack");
+ // Process -fno-math-builtin options.
// le32-specific flags:
// -fno-math-builtin: clang should not convert math builtins to intrinsics
// by default.
- if (getToolChain().getArch() == llvm::Triple::le32) {
+ if (Args.hasArg(options::OPT_fno_math_builtin) ||
+ getToolChain().getArch() == llvm::Triple::le32)
CmdArgs.push_back("-fno-math-builtin");
- }
// Default to -fno-builtin-str{cat,cpy} on Darwin for ARM.
//
return pow(a, b);
// CHECK: call {{.*}}double @pow
}
-
// RUN: %clang -### -S -fexec-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-INPUT-CHARSET %s
// CHECK-INVALID-INPUT-CHARSET: error: invalid value 'iso-8859-1' in '-fexec-charset=iso-8859-1'
+// RUN: %clang -### -S -fno-math-builtin %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MATH-BUILTIN %s
+// CHECK-NO-MATH-BUILTIN: "-fno-math-builtin"
+
// Test that we don't error on these.
// RUN: %clang -### -S -Werror \
// RUN: -falign-functions -falign-functions=2 -fno-align-functions \