[libc-commits] [libc] [llvm] [libc] Add user defined literals to ease testing (PR #81267)

via libc-commits libc-commits at lists.llvm.org
Fri Feb 9 08:47:12 PST 2024


================
@@ -0,0 +1,166 @@
+//===-- User literal for unsigned integers ----------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+// This set of user defined literals allows uniform constructions of constants
+// up to 256 bits and also help with unit tests (EXPECT_EQ requires the same
+// type for LHS and RHS).
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_INTEGER_LITERALS_H
+#define LLVM_LIBC_SRC___SUPPORT_INTEGER_LITERALS_H
+
+#include "src/__support/UInt128.h"           // UInt128
+#include "src/__support/macros/attributes.h" // LIBC_INLINE
+#include <limits.h>                          // CHAR_BIT
----------------
lntue wrote:

Can you include the internal header `src/__support/CPP/limits.h` instead.

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


More information about the libc-commits mailing list