#include #include "../common.h" #include TEST_CASE("Operand Utilities") { constexpr pfor::expr::Access r = pfor::expr::Access::read, w = pfor::expr::Access::write; SECTION("WorstAccess") { TEST_IF(REQUIRE, ==, r, pfor::expr::WorstAccess::value); TEST_IF(REQUIRE, ==, w, pfor::expr::WorstAccess::value); TEST_IF(REQUIRE, ==, w, pfor::expr::WorstAccess::value); TEST_IF(REQUIRE, ==, w, pfor::expr::WorstAccess::value); TEST_IF(REQUIRE, ==, w, pfor::expr::WorstAccess::value); } SECTION("Tags") { using Iterator = void; using T1R = pfor::expr::OperandTag; using T2R = pfor::expr::OperandTag; using T3R = pfor::expr::OperandTag; using T1W = pfor::expr::OperandTag; using T2W = pfor::expr::OperandTag; using T3W = pfor::expr::OperandTag; using I0 = pfor::Pack<>; using I1 = pfor::Pack; using I2 = pfor::Pack; using I3 = pfor::Pack; SECTION("CountWrite") { using R = pfor::expr::OperandTag; using W = pfor::expr::OperandTag; TEST_IF(REQUIRE, ==, 0, pfor::expr::CountWrite>::value); TEST_IF(REQUIRE, ==, 1, pfor::expr::CountWrite>::value); TEST_IF(REQUIRE, ==, 2, pfor::expr::CountWrite>::value); TEST_IF(REQUIRE, ==, 3, pfor::expr::CountWrite>::value); TEST_IF(REQUIRE, ==, 4, pfor::expr::CountWrite>::value); } SECTION("IncludeTags") { using O0 = pfor::expr::IncludeTags; using O1 = pfor::expr::IncludeTags; using O2 = pfor::expr::IncludeTags; using O3 = pfor::expr::IncludeTags; using E0 = pfor::Pack<>; using E1 = pfor::Pack; using E2 = pfor::Pack; using E3 = pfor::Pack; TEST(REQUIRE, is_same_v); TEST(REQUIRE, is_same_v); TEST(REQUIRE, is_same_v); TEST(REQUIRE, is_same_v); } SECTION("ExcludeTags") { using O0 = pfor::expr::ExcludeTags; using O1 = pfor::expr::ExcludeTags; using O2 = pfor::expr::ExcludeTags; using O3 = pfor::expr::ExcludeTags; using E0 = pfor::Pack<>; using E1 = pfor::Pack; using E2 = pfor::Pack; using E3 = pfor::Pack; TEST(REQUIRE, is_same_v); TEST(REQUIRE, is_same_v); TEST(REQUIRE, is_same_v); TEST(REQUIRE, is_same_v); } } }