mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[semantic-arc-opts] Implement @owned phi web elimination for phi webs with a single phi node that only have copy_value introducers.
This is the most simple initial version that I can commit. The hope is that this will help to bring this up in a nice way. I am going to handle the multiple phi node and load [copy] case later to reduce code churn. <rdar://problem/56720436>
This commit is contained in:
@@ -90,6 +90,37 @@ TEST(FrozenMultiMapCustomTest, SimpleFind) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(FrozenMultiMapCustomTest, TestResetWorks) {
|
||||
Canary::resetIDs();
|
||||
FrozenMultiMap<Canary, Canary> map;
|
||||
|
||||
auto key1 = Canary();
|
||||
auto key2 = Canary();
|
||||
map.insert(key1, Canary());
|
||||
map.insert(key1, Canary());
|
||||
map.insert(key1, Canary());
|
||||
map.insert(key2, Canary());
|
||||
map.insert(key2, Canary());
|
||||
|
||||
map.setFrozen();
|
||||
map.reset();
|
||||
map.insert(key1, Canary());
|
||||
map.insert(key1, Canary());
|
||||
map.insert(key1, Canary());
|
||||
map.insert(key2, Canary());
|
||||
map.insert(key2, Canary());
|
||||
|
||||
map.setFrozen();
|
||||
|
||||
// Just do a quick sanity test.
|
||||
auto range = map.getRange();
|
||||
auto begin = range.begin();
|
||||
auto end = range.end();
|
||||
++begin;
|
||||
++begin;
|
||||
EXPECT_EQ(std::distance(begin, end), 0);
|
||||
}
|
||||
|
||||
TEST(FrozenMultiMapCustomTest, SimpleIter) {
|
||||
Canary::resetIDs();
|
||||
FrozenMultiMap<Canary, Canary> map;
|
||||
|
||||
Reference in New Issue
Block a user