mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
IR: Allow MDSubrange to have 'count: -1'
It turns out that `count: -1` is a special value indicating an empty array, such as `Values` in: struct T { unsigned Count; int Values[]; }; Handle it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229769 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -670,6 +670,14 @@ TEST_F(MDSubrangeTest, get) {
|
||||
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
|
||||
}
|
||||
|
||||
TEST_F(MDSubrangeTest, getEmptyArray) {
|
||||
auto *N = MDSubrange::get(Context, -1, 0);
|
||||
EXPECT_EQ(dwarf::DW_TAG_subrange_type, N->getTag());
|
||||
EXPECT_EQ(-1, N->getCount());
|
||||
EXPECT_EQ(0, N->getLo());
|
||||
EXPECT_EQ(N, MDSubrange::get(Context, -1, 0));
|
||||
}
|
||||
|
||||
typedef MetadataTest MDEnumeratorTest;
|
||||
|
||||
TEST_F(MDEnumeratorTest, get) {
|
||||
|
Reference in New Issue
Block a user