================
@@ -1,17 +1,24 @@
-// RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic -emit-llvm -o - %s
-// RUN: %clang_cc1 -verify -Wall -pedantic -emit-llvm -o - %s
+// RUN: %clang_cc1 -verify -std=c2y -ffreestanding -Wall -pedantic -emit-llvm
-o - %s
+// RUN: %clang_cc1 -verify -ffreestanding -Wall -pedantic -emit-llvm -o - %s
// expected-no-diagnostics
/* WG14 N3364: Yes
* Give consistent wording for SNAN initialization v3
*
* Ensure that initializing from a signaling NAN (optionally with a unary + or
* -) at translation time behaves correctly at runtime.
+ *
+ * This also serves as a test for C23's WG14 N2710 which introduces these
+ * macros into float.h in Clang 22.
*/
-#define FLT_SNAN __builtin_nansf("1")
-#define DBL_SNAN __builtin_nans("1")
-#define LD_SNAN __builtin_nansl("1")
+#if __STDC_VERSION__ >= 202311L
+#include <float.h>
+#else
+#define FLT_SNAN __builtin_nansf("")
----------------
shafik wrote:
I am quiet curious how changing the arguments from "1" to "" did not result in
any of the results changing.
https://github.com/llvm/llvm-project/pull/162858
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits