summaryrefslogtreecommitdiff
path: root/clang/test/Preprocessor/flt_eval_macro.cpp
AgeCommit message (Collapse)Author
2023-03-10Revert "Currently the control of the eval-method is mixed with fast-math."Zahira Ammarguellat
Setting __FLT_EVAL_METHOD__ to -1 with fast-math will set __GLIBC_FLT_EVAL_METHOD to 2 and long double ends up being used for float_t and double_t. This creates some ABI breakage with various C libraries. See details here: https://github.com/llvm/llvm-project/issues/60781 This reverts commit bbf0d1932a3c1be970ed8a580e51edf571b80fd5.
2022-06-29[Clang][Preprocessor] Fix inconsistent `FLT_EVAL_METHOD` when compiling vs ↵Egor Zhdan
preprocessing When running `clang -E -Ofast` on macOS, the `__FLT_EVAL_METHOD__` macro is `0`, which causes the following typedef to be emitted into the preprocessed source: `typedef float float_t`. However, when running `clang -c -Ofast`, `__FLT_EVAL_METHOD__` is `-1`, and `typedef long double float_t` is emitted. This causes build errors for certain projects, which are not reproducible when compiling from preprocessed source. The issue is that `__FLT_EVAL_METHOD__` is configured in `Sema::Sema` which is not executed when running in `-E` mode. This change moves that logic into the preprocessor initialization method, which is invoked correctly in `-E` mode. rdar://96134605 rdar://92748429 Differential Revision: https://reviews.llvm.org/D128814
2022-02-23Add support for floating-point option `ffp-eval-method` and forZahira Ammarguellat
`pragma clang fp eval_method`. Differential Revision: https://reviews.llvm.org/D109239
2022-02-18Revert "Add support for floating-point option `ffp-eval-method` and for"Florian Hahn
This reverts commit 32b73bc6ab8234b670c34d5ef999300e072cc706. This breaks builds on macOS in some configurations, because __FLT_EVAL_METHOD__ is set to an unexpected value. E.g. https://green.lab.llvm.org/green/job/clang-stage1-RA/28282/consoleFull#129538464349ba4694-19c4-4d7e-bec5-911270d8a58c More details available in the review thread https://reviews.llvm.org/D109239
2022-02-17Add support for floating-point option `ffp-eval-method` and forZahira Ammarguellat
`pragma clang fp eval_method`. https://reviews.llvm.org/D109239
2022-02-15Revert "Add support for floating-point option `ffp-eval-method` and for"Nico Weber
This reverts commit 4bafe65c2b2f1ce745894a509a6d80c87fb1c335. Breaks at least Misc/warning-flags.c, see comments on https://reviews.llvm.org/D109239
2022-02-15Add support for floating-point option `ffp-eval-method` and forZahira Ammarguellat
`pragma clang fp eval_method`.