From 54e23dd90166c28c36b5790c470023c1d2b426e6 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 16 Apr 2020 09:25:18 -0400 Subject: [PATCH 045/179] FIXME: enable test_assignment --- gcc/analyzer/region-model2.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/analyzer/region-model2.cc b/gcc/analyzer/region-model2.cc index 20cb0b7299f..a2ca9784eb3 100644 --- a/gcc/analyzer/region-model2.cc +++ b/gcc/analyzer/region-model2.cc @@ -7409,6 +7409,7 @@ test_purge_unused_svalue2s () ASSERT_EQ (ctxt.get_num_diagnostics (), 0); } +#endif /* Verify that simple assignments work as expected. */ @@ -7420,18 +7421,27 @@ test_assignment () tree y = build_global_decl ("y", integer_type_node); /* "x == 0", then use of y, then "y = 0;". */ + region_model2_manager mgr; region_model2 model; +#if 0 ADD_SAT_CONSTRAINT (model, x, EQ_EXPR, int_0); ASSERT_CONDITION_UNKNOWN (model, y, EQ_EXPR, int_0); - model.set_value (model.get_lvalue (y, NULL), - model.get_rvalue (int_0, NULL), +#endif + model.set_value (&mgr, + model.get_lvalue (&mgr, y, NULL), + model.get_rvalue (&mgr, int_0, NULL), NULL); +#if 0 ASSERT_CONDITION_TRUE (model, y, EQ_EXPR, int_0); ASSERT_CONDITION_TRUE (model, y, EQ_EXPR, x); +#endif +#if 0 ASSERT_DUMP_EQ (model, true, "y: 0, {x}: unknown, x == y"); +#endif } +#if 0 /* Verify that compound assignments work as expected. */ static void @@ -8421,7 +8431,9 @@ analyzer_region_model2_cc_tests () test_region2_equality (); test_purging_by_criteria (); test_purge_unused_svalue2s (); +#endif test_assignment (); +#if 0 test_compound_assignment (); #endif test_stack_frames (); -- 2.21.0