diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-04-26 02:10:51 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-04-26 02:10:51 +0000 |
commit | 3634c66b41840a88fef7ea0f87ef64fe75316020 (patch) | |
tree | b51d1d8a86e177dd467de8f6048748aaa54dad84 /clang/test/Driver/fast-math.c | |
parent | bc8c5b5d67445625191fecf0e539e757c95849ea (diff) | |
download | bcm5719-llvm-3634c66b41840a88fef7ea0f87ef64fe75316020.tar.gz bcm5719-llvm-3634c66b41840a88fef7ea0f87ef64fe75316020.zip |
Fix a long-standing bug where Clang had a different default from GCC on
Linux and other (non-Darwin) platforms and have it use -fmath-errno by
default (for better or worse).
Darwin has seen the light here and uses -fno-math-errno by default, this
patch preserves that.
If any maintainers for a non-Linux platform would also like to opt-in to
-fno-math-errno by default, I'm happy to add folks, but we're currently
getting buts and misleading comparisons with GCC due to this difference
in behavior on Linux at least.
llvm-svn: 155607
Diffstat (limited to 'clang/test/Driver/fast-math.c')
-rw-r--r-- | clang/test/Driver/fast-math.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/test/Driver/fast-math.c b/clang/test/Driver/fast-math.c index aef7cc3624d..40b60cbcd66 100644 --- a/clang/test/Driver/fast-math.c +++ b/clang/test/Driver/fast-math.c @@ -19,8 +19,15 @@ // CHECK-MATH-ERRNO: "-cc1" // CHECK-MATH-ERRNO: "-fmath-errno" // -// RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \ -// RUN: -fno-trapping-math -c %s 2>&1 \ +// RUN: %clang -### -fmath-errno -fno-math-errno -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s +// RUN: %clang -### -target i686-apple-darwin -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s +// CHECK-NO-MATH-ERRNO: "-cc1" +// CHECK-NO-MATH-ERRNO-NOT: "-fmath-errno" +// +// RUN: %clang -### -fno-math-errno -fassociative-math -freciprocal-math \ +// RUN: -fno-signed-zeros -fno-trapping-math -c %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-UNSAFE-MATH %s // CHECK-UNSAFE-MATH: "-cc1" // CHECK-UNSAFE-MATH: "-menable-unsafe-fp-math" @@ -36,7 +43,7 @@ // RUN: | FileCheck --check-prefix=CHECK-NO-INFS %s // RUN: %clang -### -ffinite-math-only -c %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-NO-NANS %s -// RUN: %clang -### -funsafe-math-optimizations -c %s 2>&1 \ +// RUN: %clang -### -funsafe-math-optimizations -fno-math-errno -c %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-UNSAFE-MATH %s // // One umbrella flag is *really* weird and also changes the semantics of the |