[clang] [clang] Add __builtin_iseqsig (PR #244875)
Brad Smith via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 23 15:54:27 PST 2026
================
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -x c++ %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fexperimental-new-constant-interpreter %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fexperimental-new-constant-interpreter -x c++ %s
+// RUN: %clang_cc1 -fsyntax-only -verify -ffp-exception-behavior=strict -fexperimental-strict-floating-point %s
+// RUN: %clang_cc1 -fsyntax-only -verify -ffp-exception-behavior=strict -fexperimental-strict-floating-point -fexperimental-new-constant-interpreter %s
+
+#if !__has_builtin(__builtin_iseqsig)
+#error "__builtin_iseqsig is not available"
+#endif
+
+int ok(float f, double d, long double ld, int i) {
+ return __builtin_iseqsig(f, f) + __builtin_iseqsig(d, f) +
+ __builtin_iseqsig(ld, d) + __builtin_iseqsig(d, i) +
+ __builtin_iseqsig(i, ld);
+}
+
+int bad(int i, float f) {
+ return __builtin_iseqsig(i, i) + // expected-error {{ordered compare requires two args of floating point type ('int' and 'int')}}
----------------
brad0 wrote:
I think it should be the same. iseqsig takes the same arguments as the other comparison builtins, and GCC also gives the same error for all of them, including iseqsig. The "ordered compare" wording does not fit well for isunordered either, but that is not new. If we want better wording, I can change it for all of them in a separate patch.
https://github.com/llvm/llvm-project/pull/244875
More information about the cfe-commits
mailing list