llvm/llvm/unittests/CodeGen/SchedBoundary.cpp

#include "llvm/CodeGen/MachineScheduler.h"
#include "gtest/gtest.h"

usingnamespacellvm;

#ifndef NDEBUG
TEST(ResourceSegmentsDeath, OverwriteOnRight) {
  auto X = ResourceSegments({{10, 20}});
  EXPECT_DEATH(X.add({15, 30}), "A resource is being overwritten");
}

TEST(ResourceSegmentsDeath, OverwriteOnLeft) {
  auto X = ResourceSegments({{10, 20}});
  EXPECT_DEATH(X.add({5, 11}), "A resource is being overwritten");
  ;
}

TEST(ResourceSegmentsDeath, FullOverwrite) {
  auto X = ResourceSegments({{10, 20}});
  EXPECT_DEATH(X.add({15, 18}), "A resource is being overwritten");
}

TEST(ResourceSegmentsDeath, ZeroSizeIntervalsNotAllowed) {
  auto X = ResourceSegments({{10, 20}});
  EXPECT_DEATH(X.add({20, 30}, 0), "0-size interval history has no use.");
}
#endif // NDEBUG

TEST(ResourceSegments, ConsecutiveLeftNoOverlap) {}

TEST(ResourceSegments, ConsecutiveLeftWithOverlap) {}

TEST(ResourceSegments, ConsecutiveRightNoOverlap) {}

TEST(ResourceSegments, ConsecutiveRightWithOverlap) {}

TEST(ResourceSegments, Disjoint) {}

TEST(ResourceSegments, SortAfterAdd) {}

TEST(ResourceSegments, AddWithCutOff) {}

TEST(ResourceSegments, add_01) {}

TEST(ResourceSegments, add_02) {}

#ifndef NDEBUG
TEST(ResourceSegmentsDeath, add_empty) {
  auto X = ResourceSegments({{10, 20}, {30, 40}});
  X.add({22, 22});
  EXPECT_EQ(X, ResourceSegments({{10, 20}, {30, 40}}));
}
#endif

TEST(ResourceSegments, sort_two) {}

TEST(ResourceSegments, sort_three) {}

TEST(ResourceSegments, merge_two) {}

TEST(ResourceSegments, merge_three) {}

////////////////////////////////////////////////////////////////////////////////
// Intersection
TEST(ResourceSegments, intersects) {}

////////////////////////////////////////////////////////////////////////////////
// TOP-DOWN getFirstAvailableAt
TEST(ResourceSegments, getFirstAvailableAtFromTop_oneCycle) {}

TEST(ResourceSegments, getFirstAvailableAtFromTop_twoCycles) {}

TEST(ResourceSegments, getFirstAvailableAtFromTop_twoCycles_Shifted) {}

TEST(ResourceSegments, getFirstAvailableAtFromTop_twoCycles_Shifted_withGap) {}

TEST(ResourceSegments, getFirstAvailableAtFromTop_basic) {}

TEST(ResourceSegments, getFirstAvailableAtFromTop_advanced) {}

////////////////////////////////////////////////////////////////////////////////
// BOTTOM-UP getFirstAvailableAt
TEST(ResourceSegments, getFirstAvailableAtFromBottom) {}

TEST(ResourceSegments, getFirstAvailableAtFromBottom_01) {}

TEST(ResourceSegments, getFirstAvailableAtFromBottom_02) {}

TEST(ResourceSegments, getFirstAvailableAtFromBottom_02_shifted) {}

TEST(ResourceSegments, getFirstAvailableAtFromBottom_03) {}

TEST(ResourceSegments, getFirstAvailableAtFromBottom_03_shifted) {}
TEST(ResourceSegments, getFirstAvailableAtFromBottom_empty) {}