diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
commit | bfef399519ca9b8a4b4c6b563253bad7e0eeffe0 (patch) | |
tree | df8df0b0067b381eab470a3b8f28d14a552a6340 /test/Driver/fast-math.c | |
parent | 6a0372513edbc473b538d2f724efac50405d6fef (diff) |
Diffstat (limited to 'test/Driver/fast-math.c')
-rw-r--r-- | test/Driver/fast-math.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/test/Driver/fast-math.c b/test/Driver/fast-math.c index 91af2e1dce45..eba25c8fe85e 100644 --- a/test/Driver/fast-math.c +++ b/test/Driver/fast-math.c @@ -42,18 +42,14 @@ // CHECK-MATH-ERRNO: "-cc1" // CHECK-MATH-ERRNO: "-fmath-errno" // -// RUN: %clang -### -fno-fast-math -fmath-errno -c %s 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-MATH-ERRNO %s -// CHECK-NO-FAST-MATH-MATH-ERRNO: "-cc1" -// CHECK-NO-FAST-MATH-MATH-ERRNO: "-fmath-errno" -// -// RUN: %clang -### -fmath-errno -fno-fast-math -c %s 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO-NO-FAST-MATH %s -// CHECK-MATH-ERRNO-NO-FAST-MATH: "-cc1" -// CHECK-MATH-ERRNO-NO-FAST-MATH-NOT: "-fmath-errno" -// // RUN: %clang -### -fmath-errno -fno-math-errno -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" +// +// Target defaults for -fmath-errno (reusing the above checks). +// RUN: %clang -### -target i686-unknown-linux -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s // RUN: %clang -### -target i686-apple-darwin -c %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s // RUN: %clang -### -target x86_64-unknown-freebsd -c %s 2>&1 \ @@ -64,8 +60,26 @@ // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s // RUN: %clang -### -target x86_64-unknown-dragonfly -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" +// +// Check that -ffast-math disables -fmath-errno, and -fno-fast-math merely +// preserves the target default. Also check various flag set operations between +// the two flags. (Resuses above checks.) +// RUN: %clang -### -ffast-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s +// RUN: %clang -### -fmath-errno -ffast-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s +// RUN: %clang -### -ffast-math -fmath-errno -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s +// RUN: %clang -### -target i686-unknown-linux -fno-fast-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s +// RUN: %clang -### -target i686-unknown-linux -fno-math-errno -fno-fast-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s +// RUN: %clang -### -target i686-apple-darwin -fno-fast-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s +// RUN: %clang -### -target i686-apple-darwin -fno-math-errno -fno-fast-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s +// RUN: %clang -### -fno-fast-math -fno-math-errno -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s // // RUN: %clang -### -fno-math-errno -fassociative-math -freciprocal-math \ // RUN: -fno-signed-zeros -fno-trapping-math -c %s 2>&1 \ |