cgraph.c
106 KB
-
cgraph: add selftest::symbol_table_test · 212755ff
This patch adds a selftest fixture for overriding the "symtab" global, so that selftests involving symtab nodes can be isolated from each other: each selftest can have its own symbol_table instance. In particular, this ensures that nodes can have a predictable "order" and thus predictable dump names within selftests. gcc/ChangeLog: * cgraph.c: Include "selftest.h". (saved_symtab): New variable. (selftest::symbol_table_test::symbol_table_test): New ctor. (selftest::symbol_table_test::~symbol_table_test): New dtor. (selftest::test_symbol_table_test): New test. (selftest::cgraph_c_tests): New. * cgraph.h (saved_symtab): New decl. (selftest::symbol_table_test): New class. * selftest-run-tests.c (selftest::run_tests): Call selftest::cgraph_c_tests. * selftest.h (selftest::cgraph_c_tests): New decl. From-SVN: r265915
David Malcolm committed