[llvm] [libc] Add type_traits tests (PR #65956)

Clement Courbet via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 06:45:40 PDT 2023


================
@@ -0,0 +1,268 @@
+//===-- Unittests for type_traits -----------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/__support/CPP/type_traits.h"
+#include "test/UnitTest/Test.h"
+
+// TODO: Split this file if it becomes too big.
+
+namespace __llvm_libc::cpp {
+
+class Class {};
+union Union {};
+struct Struct {};
+
+using UnqualObjectTypes = testing::TypeList<int, float, Class, Union, Struct>;
+
+TYPED_TEST(LlvmLibcTypeTraitsTest, add_lvalue_reference, UnqualObjectTypes) {
+
+  // non-ref cv, adds ref
----------------
legrosbuffle wrote:

add a test for  `T*` ?

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


More information about the llvm-commits mailing list