1 #include "polly/Support/ISLTools.h"
2 #include "gmock/gmock.h"
3 #include "gtest/gtest.h"
6 static bool operator==(const isl::basic_set
&A
, const isl::basic_set
&B
) {
11 TEST(Support
, isl_iterator
) {
12 std::unique_ptr
<isl_ctx
, decltype(&isl_ctx_free
)> RawCtx(isl_ctx_alloc(),
14 isl::ctx
Ctx(RawCtx
.get());
17 Ctx
, "{ [x, y] : 0 <= x <= 5 and y >= 0 and x > 0 and 0 < y <= 5 }");
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())
26 EXPECT_THAT(Sets
, testing::UnorderedElementsAre(A
, B
));