//===-- Unittests for IntegerSequence -------------------------------------===// // // 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/utility.h" #include "test/UnitTest/Test.h" using namespace LIBC_NAMESPACE::cpp; TEST(LlvmLibcIntegerSequencetTest, Basic) { EXPECT_TRUE( (is_same_v, make_integer_sequence>)); using ISeq = integer_sequence; EXPECT_TRUE((is_same_v>)); using LSeq = integer_sequence; EXPECT_TRUE((is_same_v>)); using ULLSeq = integer_sequence; EXPECT_TRUE( (is_same_v>)); } template bool checkArray(integer_sequence seq) { T arr[sizeof...(Ts)]{Ts...}; for (T i = 0; i < static_cast(sizeof...(Ts)); i++) if (arr[i] != i) return false; return true; } TEST(LlvmLibcIntegerSequencetTest, Many) { EXPECT_TRUE(checkArray(make_integer_sequence{})); }