efriedma added inline comments.
================ Comment at: clang/test/Sema/constant-builtins-fmax.cpp:35-39 +#define FMAX_TEST_BOTH_ZERO(T, FUNC) \ + static_assert(0.0 == FUNC(0.0, 0.0)); \ + static_assert(0.0 == FUNC(-0.0, 0.0)); \ + static_assert(0.0 == FUNC(0.0, -0.0)); \ + static_assert(0.0 == FUNC(-0.0, -0.0)); ---------------- Izaron wrote: > jcranmer-intel wrote: > > These tests aren't covering what the sign of zero is in these cases. > Cool! Thank you, today I learned that this compiles: > ``` > static_assert(0.0 == 0.0); > static_assert(0.0 == -0.0); > static_assert(0.0 == +0.0); > ``` > > So I think I need to test the `+0.0` cases with the `__builtin_signbit` (I > didn't find another way), BUT this function is not constexpr yet. So I need > to implement a constexpr `__builtin_signbit` first... In a new pull request. I think __builtin_copysign should be sufficient. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134369/new/ https://reviews.llvm.org/D134369 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits