Skip to content

Commit

Permalink
test: right shift assignment constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
drewr95 committed Mar 13, 2024
1 parent 9a39c75 commit 8316556
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/test_type_def.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,23 @@ namespace
CHECK_EQUAL(i<<=2, uint32_t(t));
}

//*************************************************************************
TEST(test_operator_right_shift_assignment_constexpr)
{
class __type_t__;
typedef etl::type_def<__type_t__, uint32_t> type_t;

constexpr auto right_shift_assignment = []() {
type_t t(0x5A3DUL);
return t >>= 2;
};

uint32_t i = 0x5A3DUL;
constexpr type_t t = right_shift_assignment();

CHECK_EQUAL(i>>=2, uint32_t(t));
}

//*************************************************************************
TEST(test_comparisons)
{
Expand Down

0 comments on commit 8316556

Please sign in to comment.