diff options
author | Bob Wilson <bob.wilson@apple.com> | 2012-07-19 03:52:53 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2012-07-19 03:52:53 +0000 |
commit | 455e72e7625a8f87c2c302d8d82baee5c111e094 (patch) | |
tree | 597a36c3c1247cc52988afda5d8445a9b8c34b60 /test/Preprocessor/predefined-macros.c | |
parent | f81678707e936cf04a2a9f7c21d51a77ffc1f6c9 (diff) |
Define __FINITE_MATH_ONLY__ based on -ffast-math and -ffinite-math-only.
This macro was being unconditionally set to zero, preceded by a FIXME comment.
This fixes <rdar://problem/11845441>. Patch by Michael Gottesman!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Preprocessor/predefined-macros.c')
-rw-r--r-- | test/Preprocessor/predefined-macros.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Preprocessor/predefined-macros.c b/test/Preprocessor/predefined-macros.c index 5c11c3b7b2..2c193018b5 100644 --- a/test/Preprocessor/predefined-macros.c +++ b/test/Preprocessor/predefined-macros.c @@ -13,3 +13,16 @@ // RUN: %clang_cc1 %s -E -dM -ffast-math -o - \ // RUN: | FileCheck %s --check-prefix=CHECK-FAST-MATH // CHECK-FAST-MATH: #define __FAST_MATH__ +// CHECK-FAST-MATH: #define __FINITE_MATH_ONLY__ 1 +// +// RUN: %clang_cc1 %s -E -dM -ffinite-math-only -o - \ +// RUN: | FileCheck %s --check-prefix=CHECK-FINITE-MATH-ONLY +// CHECK-FINITE-MATH-ONLY: #define __FINITE_MATH_ONLY__ 1 +// +// RUN: %clang %s -E -dM -fno-finite-math-only -o - \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-FINITE-MATH-ONLY +// CHECK-NO-FINITE-MATH-ONLY: #define __FINITE_MATH_ONLY__ 0 +// +// RUN: %clang_cc1 %s -E -dM -o - \ +// RUN: | FileCheck %s --check-prefix=CHECK-FINITE-MATH-FLAG-UNDEFINED +// CHECK-FINITE-MATH-FLAG-UNDEFINED: #define __FINITE_MATH_ONLY__ 0 |