[clang] [C23] [CLANG] Adding C23 constexpr math functions: fmin and frexp. (PR #88978)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 11:09:41 PDT 2024


================
@@ -0,0 +1,51 @@
+// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \
+// RUN: -emit-llvm -o - %s | FileCheck %s
+
+// RUN %clang_cc1 -x c++ -triple x86_64-linux-gnu -emit-llvm -o - %s \
+// RUN -std=c++23
+
+#define INFINITY ((float)(1e+300 * 1e+300))
----------------
AaronBallman wrote:

You should also add tests in SemaCXX that the calculations work at compile time. e.g.,
```
static_assert(__builtin_fmin(15.24, 1.3) == 1.3, "");
```

https://github.com/llvm/llvm-project/pull/88978


More information about the cfe-commits mailing list