[docs] Fix build-docs.sh
[llvm-project.git] / polly / unittests / Support / ISLTools.cpp
blob35225eb4ff373fa2cb97abf313762627f1ea2780
1 #include "polly/Support/ISLTools.h"
2 #include "gmock/gmock.h"
3 #include "gtest/gtest.h"
5 namespace isl {
6 static bool operator==(const isl::basic_set &A, const isl::basic_set &B) {
7 return A.is_equal(B);
9 } // namespace isl
11 TEST(Support, isl_iterator) {
12 std::unique_ptr<isl_ctx, decltype(&isl_ctx_free)> RawCtx(isl_ctx_alloc(),
13 &isl_ctx_free);
14 isl::ctx Ctx(RawCtx.get());
16 isl::basic_set A(
17 Ctx, "{ [x, y] : 0 <= x <= 5 and y >= 0 and x > 0 and 0 < y <= 5 }");
18 isl::basic_set B(
19 Ctx, "{ [x, y] : 0 <= x <= 5 and y >= 0 and x <= 4 and y <= 3 + x }");
20 isl::set S = A.unite(B);
22 ASSERT_EQ(S.n_basic_set().release(), 2);
23 std::vector<isl::basic_set> Sets;
24 for (auto BS : S.get_basic_set_list())
25 Sets.push_back(BS);
26 EXPECT_THAT(Sets, testing::UnorderedElementsAre(A, B));