[libc-commits] [libc] [libc] Annex K: Add constraint handler unit test class (PR #197707)

Jeff Bailey via libc-commits libc-commits at lists.llvm.org
Thu Jul 9 06:54:43 PDT 2026


================
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file contains a test fixture for checking Annex K's constraint handler
+/// behavior.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_TEST_UNITTEST_CONSTRAINTHANDLERCHECKINGTEST_H
+#define LLVM_LIBC_TEST_UNITTEST_CONSTRAINTHANDLERCHECKINGTEST_H
+
+#include "hdr/types/constraint_handler_t.h"
+#include "hdr/types/errno_t.h"
+#include "src/stdlib/set_constraint_handler_s.h"
+#include "test/UnitTest/Test.h"
+
+namespace {
+
+bool error_flag;
+
+void local_constraint_handler(const char *__restrict /*msg*/,
----------------
kaladron wrote:

It might be nice to note that this conforms to constraint_handler_t so that someone undersand why the signature is the way it is.

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


More information about the libc-commits mailing list