IR: Allow 16-bits for column info

Raise the limit for column information from 8 bits to 16 bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226291 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-01-16 17:33:08 +00:00
parent 44fb4b337f
commit fb7514fccb
5 changed files with 17 additions and 14 deletions

View File

@@ -397,19 +397,19 @@ TEST_F(MDLocationTest, Overflow) {
EXPECT_EQ(7u, L->getColumn());
}
unsigned U24 = 1u << 24;
unsigned U8 = 1u << 8;
unsigned U16 = 1u << 16;
{
MDLocation *L = MDLocation::get(Context, U24 - 1, U8 - 1, N);
MDLocation *L = MDLocation::get(Context, U24 - 1, U16 - 1, N);
EXPECT_EQ(U24 - 1, L->getLine());
EXPECT_EQ(U8 - 1, L->getColumn());
EXPECT_EQ(U16 - 1, L->getColumn());
}
{
MDLocation *L = MDLocation::get(Context, U24, U8, N);
MDLocation *L = MDLocation::get(Context, U24, U16, N);
EXPECT_EQ(0u, L->getLine());
EXPECT_EQ(0u, L->getColumn());
}
{
MDLocation *L = MDLocation::get(Context, U24 + 1, U8 + 1, N);
MDLocation *L = MDLocation::get(Context, U24 + 1, U16 + 1, N);
EXPECT_EQ(0u, L->getLine());
EXPECT_EQ(0u, L->getColumn());
}