summaryrefslogtreecommitdiffstats
path: root/test/Driver/fast-math.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Driver/fast-math.c')
-rw-r--r--test/Driver/fast-math.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/test/Driver/fast-math.c b/test/Driver/fast-math.c
index 91af2e1..eba25c8 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 \
OpenPOWER on IntegriCloud