Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions llvm/unittests/ExecutionEngine/Orc/WaitingOnGraphTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,31 @@ TEST_F(WaitingOnGraphTest, Emit_TrivialSequence) {
EXPECT_EQ(ER1.Failed.size(), 0U);
}

TEST_F(WaitingOnGraphTest, Emit_SingleContainerSimpleCycle) {
// Test an emit of two nodes with a dependence cycle within a single
// container:
// N0: (0, 0) -> (0, 1)
// N1: (0, 1) -> (0, 0)
// We expect intra-simplify cycle elimination to clear both dependence sets,
// and coalescing to join them into one supernode covering both defs.
SuperNodeBuilder B;
ContainerElementsMap Defs0({{0, {0}}});
ContainerElementsMap Deps0({{0, {1}}});
B.add(Defs0, Deps0);

auto ER0 = emit(TestGraph::simplify(B.takeSuperNodes()));
EXPECT_EQ(ER0.Ready.size(), 0U);
EXPECT_EQ(ER0.Failed.size(), 0U);

ContainerElementsMap Defs1({{0, {1}}});
ContainerElementsMap Deps1({{0, {0}}});
B.add(Defs1, Deps1);
auto ER1 = emit(TestGraph::simplify(B.takeSuperNodes()));

EXPECT_EQ(collapseDefs(ER1.Ready), merge(Defs0, Defs1));
EXPECT_EQ(ER1.Failed.size(), 0U);
}

TEST_F(WaitingOnGraphTest, Emit_TrivialReverseSequence) {
// Perform a sequence of two emits where the first emit depends on the
// second. Check that both nodes become ready after the second emit.
Expand Down