//===-- 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 "utils/UnitTest/Test.h" using namespace __llvm_libc::cpp; TEST(LlvmLibcIntegerSequencetTest, Basic) { EXPECT_TRUE((IsSameV, MakeIntegerSequence>)); using ISeq = IntegerSequence; EXPECT_TRUE((IsSameV>)); using LSeq = IntegerSequence; EXPECT_TRUE((IsSameV>)); using ULLSeq = IntegerSequence; EXPECT_TRUE((IsSameV>)); } template bool checkArray(IntegerSequence 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(MakeIntegerSequence{})); }