llvm-project/clang/test/Driver
Chandler Carruth 306bd2c6aa Fix PR11685 by implementing -ffast-math and its various friends in the
Clang driver. This involves a bunch of silly option parsing code to try
to carefully emulate GCC's options. Currently, this takes a conservative
approach, and unless all of the unsafe optimizations are enabled, none
of them are. The fine grained control doesn't seem particularly useful.
If it ever becomes useful, we can add that to LLVM first, and then
expose it here.

This also fixes a few tiny bugs in the flag management around
-fhonor-infinities and -fhonor-nans; the flags now form proper sets both
for enabling and disabling, with the last flag winning.

I've also implemented a moderately terrifying GCC feature where
a language change is also provided by the '-ffast-math' flag by defining
the __FAST_MATH__ preprocessor macro. This feature is tracked and
serialized in the frontend but it isn't used yet. A subsequent patch
will add the preprocessor macro and tests for it.

I've manually tested that codegen appears to respect this, but I've not
dug in enough to see if there is an easy way to test codegen options w/o
relying on the particulars of LLVM's optimizations.

llvm-svn: 147434
2012-01-02 14:19:45 +00:00
..
Inputs add tree test for suse on ppc64 (r146142) 2011-12-08 20:36:19 +00:00
Wp-args.c Driver: Fix PR4062 by dissecting one particular -Wp, form. 2010-06-14 21:37:09 +00:00
Xarch.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
Xlinker-args.c Fix typo. 2010-06-15 08:21:35 +00:00
analyze.c Use -fno-math-errno by default, and remove the IsMathErrnoDefault 2010-01-08 02:20:44 +00:00
apple-kext-i386.cpp Switch to the C++11 warning flags in tests. 2011-10-18 05:54:07 +00:00
apple-kext-mkernel.c Frontend: Add a more explicit -backend-option flag for passing backend command 2011-03-22 16:48:17 +00:00
arc-exceptions.m Automatic Reference Counting. 2011-06-15 23:02:42 +00:00
arc.c Automatic Reference Counting. 2011-06-15 23:02:42 +00:00
arch.c Set the default arch based on the triple. 2010-06-28 17:18:09 +00:00
arm-darwin-builtin.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
ast.c fix a bunch of comment typos found by codespell. Patch by 2011-04-15 05:22:18 +00:00
at_file.c Implement support for reading arguments specified in a file with @file. If 2010-07-19 15:20:12 +00:00
at_file.c.args Implement support for reading arguments specified in a file with @file. If 2010-07-19 15:20:12 +00:00
bindings.c Driver: Start ripping out support for -pipe, which is worthless and complicates 2010-08-02 02:38:03 +00:00
cc-log-diagnostics.c Print a typo correction hint for unknown warning flags. 2011-11-14 23:30:34 +00:00
cc-print-options.c Add -no-canonical-prefixes to tests which assert on the name of the 2011-04-13 22:28:36 +00:00
ccc-add-args.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
ccc-host-triple-no-integrated-as.c Whitespace. 2011-07-20 19:27:01 +00:00
cfi.c Stop disabling integrated assembler with -static. <rdar://problem/10175391> 2011-10-30 00:20:28 +00:00
clang-c-as-cxx.c PR5803: clang++: Treat untyped 'C' inputs as C++. 2010-02-17 20:32:58 +00:00
clang-exception-flags.cpp Add a test case that would have caught the bug fixed in r126640. 2011-02-28 07:38:09 +00:00
clang-g-opts.c Don't produce debug info when given -g. Fixes PR6529. 2010-03-07 04:46:18 +00:00
clang-translation.c Driver/ARM: Match GCC behavior in that -msoft-float disables NEON, despite this 2011-03-17 00:07:34 +00:00
clang_cpp.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
clang_f_opts.c Move all of the logic for __DEPRECATED to the driver based on comments 2011-04-23 19:48:40 +00:00
clang_wrapv_opts.c Add my test case for r128353. I think this is the last test case to fail 2011-03-27 21:03:41 +00:00
cpath.c [driver] Fix test case for Windows due to fallout from r141202+r141205. 2011-10-06 22:05:26 +00:00
darwin-as.c Stop disabling integrated assembler with -static. <rdar://problem/10175391> 2011-10-30 00:20:28 +00:00
darwin-cc.c test/Driver/darwin-cc.c: FileCheck-ize and tweak for Mingw MSYS bash. 2011-03-18 03:21:26 +00:00
darwin-debug-flags.c Add missing triple to darwin clang driver test. 2011-12-22 21:32:51 +00:00
darwin-dsymutil.c Driver/Darwin: Dsymutil actions should put the dSYM adjacent to the output file. 2011-03-25 18:16:51 +00:00
darwin-iphone-defaults.m Enable stack protectors by default for iOS. <rdar://problem/8836680> 2011-12-14 06:08:25 +00:00
darwin-ld.c tests/Driver/darwin-ld.c: Get rid of the "splatter" test case. We have enough 2011-11-17 00:36:53 +00:00
darwin-objc-defaults.m Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
darwin-objc-gc.m Driver: Ignore -fobjc-gc and -fobjc-gc-only for platforms which don't support them. 2010-04-10 16:20:23 +00:00
darwin-objc-options.m Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
darwin-verify-debug.c Right now this requires asserts. 2011-08-23 21:47:58 +00:00
darwin-version.c Driver/Darwin: Allow OS X deployment targets like 10.4.11, even though they 2011-04-21 21:27:33 +00:00
darwin-xarch.c Driver/Darwin: Honor -Xarch_FOO when the arch matches either the toolchain or 2011-06-21 00:20:17 +00:00
debug-options-as.c Split out clang/test/Driver/debug-options-as.c from debug-options.c, and mark it as XFAIL: mingw32. 2011-12-31 02:36:23 +00:00
debug-options.c Split out clang/test/Driver/debug-options-as.c from debug-options.c, and mark it as XFAIL: mingw32. 2011-12-31 02:36:23 +00:00
debug.c test/Driver/debug.c: Mark this as "REQUIRES: shell". 2011-10-22 11:28:32 +00:00
default-toolchain.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
dragonfly.c Update tests to not search of as. 2010-10-29 21:18:11 +00:00
emit-llvm.c Use ld directly on linux. Changes from the previous try: 2010-11-07 20:14:31 +00:00
exceptions.m Driver/Obj-C: Be compatible with GCC behavior in that -fno-exceptions *does not* 2011-03-17 23:28:31 +00:00
fast-math.c Fix PR11685 by implementing -ffast-math and its various friends in the 2012-01-02 14:19:45 +00:00
flags.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
frame-pointer.c Don't use the frame pointer on linux x86 and x86_64 if optimizing. This 2011-12-14 21:02:23 +00:00
freebsd.c Add hardcoded -L/usr/lib after all -L options to the FreeBSD linker 2011-01-30 08:12:24 +00:00
gcc_forward.c Driver/OptParser: Add a NoForward flag to prevent forwarding certain options to 2010-08-13 04:44:20 +00:00
gnu-runtime.m Somehow the -fgnu-runtime option itself got lost in all that shuffling. 2011-07-06 02:36:30 +00:00
hello.c test/Driver/hello.c: Tweak for cygming. 2011-03-16 13:51:46 +00:00
immediate-options.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
index-header-map.c Introduce the "-index-header-map" option, to give special semantics 2011-07-28 04:45:53 +00:00
ios-simulator-arcruntime.c Revert r142311, -mios-simulator-version-min does not work correctly. 2011-10-18 00:22:49 +00:00
le32-unknown-nacl.cpp Specify -ccc-clang-archs for le32 targets which may not be supported by default. 2011-10-04 05:18:19 +00:00
linux-header-search.cpp Try to fix an issue on some hosts where the 'lib' in the builtin include 2011-11-09 08:26:57 +00:00
linux-ld.c Teach the link-step test to verify that we don't pass bad --hash-style 2011-12-17 21:57:25 +00:00
lto.c Driver: Support invoking Clang on .ll or .bc inputs. 2010-06-07 23:28:45 +00:00
m_and_mm.c Driver: M and MM should be grouped together, <rdar://problem/8744831>. 2010-12-08 21:33:40 +00:00
mg.c Implement -MG. Fixes PR9613 2011-07-12 19:35:15 +00:00
mno-global-merge.c [driver] Add -mglobal-merge/-mno-global-merge machine options to enable/disable merging of 2011-08-26 00:26:29 +00:00
no-objc-arr.m Automatic Reference Counting. 2011-06-15 23:02:42 +00:00
noexecstack.c Fix this test on machines that don't run clang -cc1as when asked to assemble. 2011-06-23 05:38:06 +00:00
nostdincxx.cpp XFAIL the -nostdinc++ test on Windows; it doesn't look like we even have the notion of separate C and C++ paths there 2010-03-24 20:45:20 +00:00
nostdlib.c On linux, -nostdlib was causing a --start-group with no --end-group to be passed 2011-06-04 06:27:06 +00:00
nostdlibinc.c Driver: Add support for a new -nostdlibinc option. 2011-10-11 18:20:16 +00:00
objc++-cpp-output.mm Add support of -x objc-cpp-output, -x objc++-cpp-output to the Driver. 2011-08-13 23:13:37 +00:00
objc-cpp-output.m Add support of -x objc-cpp-output, -x objc++-cpp-output to the Driver. 2011-08-13 23:13:37 +00:00
openbsd.c Update tests to not search of as. 2010-10-29 21:18:11 +00:00
option-aliases.c Driver: Change Option parsing to always create arguments referring to unaliased 2010-06-09 22:44:34 +00:00
output-file-cleanup.c Un-XFAIL this test on Darwin, it reportedly passes now. 2011-11-21 21:56:51 +00:00
parsing.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
phases.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
preprocessor.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
pth.c Revert r116605, a lot more were committed by mistake. 2010-10-15 18:51:34 +00:00
qa_override.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
redzone.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
rewrite-objc.m Fix test for unrelated changes. 2011-12-06 03:46:28 +00:00
stackrealign.c Stack realignment is a tristate. Add -mno-stackrealign to turn off all stack 2011-12-06 03:33:03 +00:00
std.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
std.cpp Add support for -std=gnu90 and -std=c++03, for compatibility with modern gcc. 2011-10-14 00:34:28 +00:00
sysroot-flags.c test/Driver/sysroot-flags.c: Tweak for Mingw MSYS bash. 2011-03-18 03:21:33 +00:00
sysroot.c Tweak two tests with MSYS-bash tolerant. 2011-07-11 16:21:34 +00:00
unknown-gcc-arch.c Update tests to use %clang instead of 'clang', and forcibly disable use of ' 2009-12-15 22:01:24 +00:00
x86_features.c Make clang behave in a gcc-compatible way in the presence of multiple flags for the same x86 target feature (e.g. -mno-sse -msse). gcc uses a somewhat unintuitive algorithm here in that the enabled SSE instructions is based on the order of the *last* flag for *each* feature-level, so that "-mno-sse -msse2" only enables SSE2, but "-mno-sse -msse2 -msse" enables all SSE levels. 2011-07-02 00:34:19 +00:00