summaryrefslogtreecommitdiff
path: root/gcc/selftest.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2018-11-08 14:55:54 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2018-11-08 14:55:54 +0000
commit212755ff9137bcd3975e02f4936c96bdb7eaf709 (patch)
tree3c5fb53164804c22395d16b8ad4db4ae78afe627 /gcc/selftest.h
parent1c8badf66bec4e0ff73ae24bf4f8cabbef8c137a (diff)
cgraph: add selftest::symbol_table_test
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
Diffstat (limited to 'gcc/selftest.h')
-rw-r--r--gcc/selftest.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/selftest.h b/gcc/selftest.h
index 8da7c4ae1c0..4e4c755f9b0 100644
--- a/gcc/selftest.h
+++ b/gcc/selftest.h
@@ -215,6 +215,7 @@ class test_runner
alphabetical order. */
extern void attribute_c_tests ();
extern void bitmap_c_tests ();
+extern void cgraph_c_tests ();
extern void diagnostic_c_tests ();
extern void diagnostic_show_locus_c_tests ();
extern void dumpfile_c_tests ();