public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jeff Law <law@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-7724] selftest: Move C-specific tests to c_family
Date: Sat, 19 Mar 2022 18:29:58 +0000 (GMT)	[thread overview]
Message-ID: <20220319182958.8EECD385840C@sourceware.org> (raw)

https://gcc.gnu.org/g:981524428b21bf6935f8f9a3b8394d5504f4f0fc

commit r12-7724-g981524428b21bf6935f8f9a3b8394d5504f4f0fc
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date:   Sat Mar 19 14:25:51 2022 -0400

    selftest: Move C-specific tests to c_family
    
    When trying to make use of the selftest framework over on the rust
    frontend, we ran into issues where rust1 was expected to produce errors
    containing C-like type names such as `int`.
    
    I had gotten in contact with David Malcolm on the gcc mailing list [1],
    who advised moving some test functions to a better location. The
    offending functions have also been renamed in order to better fit the C
    family of tests, and are thus not called when performing general
    selftests anymore.
    
    Kindly,
    
    [1]: https://gcc.gnu.org/pipermail/gcc/2021-November/237703.html
    
    2022-02-16 Arthur Cohen <arthur.cohen@embecosm.com>
    
    gcc/c-family/
    
            * c-common.cc (c_family_tests): Call the new tests.
            * c-common.h (c_diagnostic_tests): Declare.
            (c_opt_problem_cc_tests): Likewise.
    
    gcc/
            * diagnostic.cc (diagnostic_cc_tests): Rename to...
            (c_diagnostic_cc_tests): ...this.
            * opt-problem.cc (opt_problem_cc_tests): Rename to...
            (c_opt_problem_cc_tests): ...this.
            * selftest-run-tests.cc (selftest::run_tests): No longer run
            opt_problem_cc_tests or diagnostic_cc_tests.
            * selftest.h (diagnostic_cc_tests): Remove declaration.
            (opt_problem_cc_tests): Likewise.

Diff:
---
 gcc/c-family/c-common.cc  | 2 ++
 gcc/c-family/c-common.h   | 2 ++
 gcc/diagnostic.cc         | 2 +-
 gcc/opt-problem.cc        | 2 +-
 gcc/selftest-run-tests.cc | 2 --
 gcc/selftest.h            | 2 --
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc
index 7203d761df1..d034837bb5b 100644
--- a/gcc/c-family/c-common.cc
+++ b/gcc/c-family/c-common.cc
@@ -9120,6 +9120,8 @@ c_family_tests (void)
   c_indentation_cc_tests ();
   c_pretty_print_cc_tests ();
   c_spellcheck_cc_tests ();
+  c_diagnostic_cc_tests ();
+  c_opt_problem_cc_tests ();
 }
 
 } // namespace selftest
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 5f0b5d99d07..52a85bfb783 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -1512,8 +1512,10 @@ extern tree braced_lists_to_strings (tree, tree);
 namespace selftest {
   /* Declarations for specific families of tests within c-family,
      by source file, in alphabetical order.  */
+  extern void c_diagnostic_cc_tests (void);
   extern void c_format_cc_tests (void);
   extern void c_indentation_cc_tests (void);
+  extern void c_opt_problem_cc_tests (void);
   extern void c_pretty_print_cc_tests (void);
   extern void c_spellcheck_cc_tests (void);
 
diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
index 87eb473d2f3..73324a728fe 100644
--- a/gcc/diagnostic.cc
+++ b/gcc/diagnostic.cc
@@ -2472,7 +2472,7 @@ test_num_digits ()
 /* Run all of the selftests within this file.  */
 
 void
-diagnostic_cc_tests ()
+c_diagnostic_cc_tests ()
 {
   test_print_escaped_string ();
   test_print_parseable_fixits_none ();
diff --git a/gcc/opt-problem.cc b/gcc/opt-problem.cc
index e45d14e94b6..11fec57d679 100644
--- a/gcc/opt-problem.cc
+++ b/gcc/opt-problem.cc
@@ -324,7 +324,7 @@ test_opt_result_failure_at (const line_table_case &case_)
 /* Run all of the selftests within this file.  */
 
 void
-opt_problem_cc_tests ()
+c_opt_problem_cc_tests ()
 {
   test_opt_result_success ();
   for_each_line_table_case (test_opt_result_failure_at);
diff --git a/gcc/selftest-run-tests.cc b/gcc/selftest-run-tests.cc
index 99c35423253..d59e0aeddee 100644
--- a/gcc/selftest-run-tests.cc
+++ b/gcc/selftest-run-tests.cc
@@ -76,7 +76,6 @@ selftest::run_tests ()
   json_cc_tests ();
   cgraph_cc_tests ();
   optinfo_emit_json_cc_tests ();
-  opt_problem_cc_tests ();
   ordered_hash_map_tests_cc_tests ();
   splay_tree_cc_tests ();
 
@@ -95,7 +94,6 @@ selftest::run_tests ()
   /* Higher-level tests, or for components that other selftests don't
      rely on.  */
   diagnostic_show_locus_cc_tests ();
-  diagnostic_cc_tests ();
   diagnostic_format_json_cc_tests ();
   edit_context_cc_tests ();
   fold_const_cc_tests ();
diff --git a/gcc/selftest.h b/gcc/selftest.h
index 7a715631c62..7568a6d24d4 100644
--- a/gcc/selftest.h
+++ b/gcc/selftest.h
@@ -222,7 +222,6 @@ extern void attribs_cc_tests ();
 extern void bitmap_cc_tests ();
 extern void cgraph_cc_tests ();
 extern void convert_cc_tests ();
-extern void diagnostic_cc_tests ();
 extern void diagnostic_format_json_cc_tests ();
 extern void diagnostic_show_locus_cc_tests ();
 extern void digraph_cc_tests ();
@@ -238,7 +237,6 @@ extern void hash_map_tests_cc_tests ();
 extern void hash_set_tests_cc_tests ();
 extern void input_cc_tests ();
 extern void json_cc_tests ();
-extern void opt_problem_cc_tests ();
 extern void optinfo_emit_json_cc_tests ();
 extern void opts_cc_tests ();
 extern void ordered_hash_map_tests_cc_tests ();


                 reply	other threads:[~2022-03-19 18:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220319182958.8EECD385840C@sourceware.org \
    --to=law@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).