diff --git a/test/test_type_def.cpp b/test/test_type_def.cpp index 36d7fb15b..13aa2b39e 100644 --- a/test/test_type_def.cpp +++ b/test/test_type_def.cpp @@ -371,7 +371,7 @@ namespace CHECK_EQUAL(i<<=2, uint32_t(t)); } - //************************************************************************* + //************************************************************************* TEST(test_operator_right_shift_assignment_constexpr) { class __type_t__; @@ -388,6 +388,23 @@ namespace CHECK_EQUAL(i>>=2, uint32_t(t)); } + //************************************************************************* + TEST(test_operator_modulus_assignment_constexpr) + { + class __type_t__; + typedef etl::type_def<__type_t__, uint32_t> type_t; + + constexpr auto modulus_assignment = []() { + type_t t(0x5A3DUL); + return t %= 2; + }; + + uint32_t i = 0x5A3DUL; + constexpr type_t t = modulus_assignment(); + + CHECK_EQUAL(i%=2, uint32_t(t)); + } + //************************************************************************* TEST(test_comparisons) {