mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-31 09:22:31 +00:00
Add a test for converting ArrayRef<T *> to ArrayRef<const T *>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216821 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
24ae56d4c9
commit
8316713a9e
@ -63,4 +63,14 @@ TEST(ArrayRefTest, EmptyEquals) {
|
||||
EXPECT_TRUE(ArrayRef<unsigned>() == ArrayRef<unsigned>());
|
||||
}
|
||||
|
||||
TEST(ArrayRefTest, ConstConvert) {
|
||||
int buf[4];
|
||||
for (int i = 0; i < 4; ++i)
|
||||
buf[i] = i;
|
||||
|
||||
static int *A[] = {&buf[0], &buf[1], &buf[2], &buf[3]};
|
||||
ArrayRef<const int *> a((ArrayRef<int *>(A)));
|
||||
a = ArrayRef<int *>(A);
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
|
Loading…
x
Reference in New Issue
Block a user