================
@@ -0,0 +1,270 @@
+// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify -std=c++20 
%s
+// RUN: %clang_cc1 -verify -std=c++20 %s
+
+
+
+static_assert(__builtin_nearbyint(1.1) == 1.0);
+static_assert(__builtin_nearbyint(1.9) == 2.0);
+static_assert(__builtin_nearbyint(-1.1) == -1.0);
+static_assert(__builtin_nearbyint(-1.9) == -2.0);
+
+static_assert(__builtin_nearbyintf(1.1f) == 1.0f);
----------------
spavloff wrote:

Functions that depend on rounding mode. like `nearbyint`, should be tested with 
statis rounding mode. `#pragma STDC FENV_ROUND` may be used to set the mode. 
Although clang warns that the pragma is unsupported, it must correctly assign 
FPOptions in AST.


https://github.com/llvm/llvm-project/pull/194327
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to