mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 05:31:06 +00:00
Adding additional tests to ensure that initializer lists created from return values and as function arguments also work as expected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229513 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fc25a7429b
commit
4e29d0712c
@ -90,10 +90,23 @@ TEST(ArrayRefTest, ConstConvert) {
|
||||
a = ArrayRef<int *>(A);
|
||||
}
|
||||
|
||||
static ArrayRef<int> ReturnTest12() { return {1, 2}; }
|
||||
static void ArgTest12(ArrayRef<int> A) {
|
||||
EXPECT_EQ(2, A.size());
|
||||
EXPECT_EQ(1, A[0]);
|
||||
EXPECT_EQ(2, A[1]);
|
||||
}
|
||||
|
||||
TEST(ArrayRefTest, InitializerList) {
|
||||
ArrayRef<int> A = { 0, 1, 2, 3, 4 };
|
||||
for (int i = 0; i < 5; ++i)
|
||||
EXPECT_EQ(i, A[i]);
|
||||
|
||||
A = ReturnTest12();
|
||||
EXPECT_EQ(1, A[0]);
|
||||
EXPECT_EQ(2, A[1]);
|
||||
|
||||
ArgTest12({1, 2});
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
|
Loading…
Reference in New Issue
Block a user