@@ -6,14 +6,13 @@ Author: Michael Tautschnig
66
77\*******************************************************************/
88
9- #include < testing-utils/use_catch.h>
10-
119#include < util/arith_tools.h>
1210#include < util/bitvector_expr.h>
1311#include < util/byte_operators.h>
1412#include < util/c_types.h>
1513#include < util/cmdline.h>
1614#include < util/config.h>
15+ #include < util/mathematical_expr.h>
1716#include < util/namespace.h>
1817#include < util/pointer_expr.h>
1918#include < util/pointer_predicates.h>
@@ -22,6 +21,8 @@ Author: Michael Tautschnig
2221#include < util/std_expr.h>
2322#include < util/symbol_table.h>
2423
24+ #include < testing-utils/use_catch.h>
25+
2526TEST_CASE (" Simplify pointer_offset(address of array index)" , " [core][util]" )
2627{
2728 config.set_arch (" none" );
@@ -571,3 +572,17 @@ TEST_CASE("Simplify bitxor", "[core][util]")
571572 false_c_bool);
572573 }
573574}
575+
576+ TEST_CASE (" Simplify power" , " [core][util]" )
577+ {
578+ const symbol_tablet symbol_table;
579+ const namespacet ns{symbol_table};
580+
581+ SECTION (" Simplification for power" )
582+ {
583+ symbol_exprt a{" a" , integer_typet{}};
584+
585+ REQUIRE (
586+ simplify_expr (power_exprt{a, from_integer (1 , integer_typet{})}, ns) == a);
587+ }
588+ }
0 commit comments