public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@mengyan1223.wang>
To: gcc-patches@gcc.gnu.org
Cc: Matthew Fortune <mfortune@gmail.com>, xry111@mengyan1223.wang
Subject: [PATCH] testsuite: mips: use noinline attribute instead of -fno-inline
Date: Tue, 22 Jun 2021 15:05:38 +0800	[thread overview]
Message-ID: <8f047551a4694778606d615bd22ef619006d044e.camel@mengyan1223.wang> (raw)

mips.exp does not support -fno-inline, causing the tests return "ERROR:
Unrecognised option: -fno-inline for dg-options ... ".

Use noinline attribute like other mips target tests, to workaround it.

gcc/testsuite/

	* gcc.target/mips/cfgcleanup-jalr2.c: Remove -fno-inline and add
	  __attribute__((noinline)).
	* gcc.target/mips/cfgcleanup-jalr3.c: Likewise.
---
 gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c | 11 ++++++++---
 gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c |  6 +++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c
index bf22f064288..6a9f86a3be0 100644
--- a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c
+++ b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c
@@ -1,10 +1,15 @@
 /* { dg-do compile } */
-/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fno-inline -fipa-ra -mcompact-branches=never" } */
+/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fipa-ra -mcompact-branches=never" } */
 /* { dg-skip-if "needs codesize optimization" { *-*-* } { "-O0" "-O1" "-O2" "-O3" } { "" } } */
 
-static int foo (void* p) { __asm__ (""::"r"(p):"$t0"); return 0; }
+static int __attribute__((noinline))
+foo (void* p)
+{
+  __asm__ (""::"r"(p):"$t0");
+  return 0;
+}
 
-static int bar (void* p) { return 1; }
+__attribute__((noinline)) static int bar (void* p) { return 1; }
 
 int
 test (void* p)
diff --git a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c
index 805b31af9f0..50937412827 100644
--- a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c
+++ b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c
@@ -1,10 +1,10 @@
 /* { dg-do compile } */
-/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fno-inline -fipa-ra -mcompact-branches=never" } */
+/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fipa-ra -mcompact-branches=never" } */
 /* { dg-skip-if "needs codesize optimization" { *-*-* } { "-O0" "-O1" "-O2" "-O3" } { "" } } */
 
-static int foo (void* p) { return 0; }
+__attribute__((noinline)) static int foo (void* p) { return 0; }
 
-static int bar (void* p) { return 1; }
+__attribute__((noinline)) static int bar (void* p) { return 1; }
 
 int
 test (void* p)
-- 
2.32.0




             reply	other threads:[~2021-06-22  7:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  7:05 Xi Ruoyao [this message]
2021-06-24 16:48 ` Jeff Law
2021-06-24 17:02   ` Xi Ruoyao
2021-06-25 11:13     ` Richard Sandiford
2021-06-25 13:21     ` Xi Ruoyao
2021-06-25 14:40       ` Richard Sandiford
2021-07-08 23:44         ` Jeff Law
2021-07-09  6:42           ` Xi Ruoyao
2021-07-09 11:16             ` Richard Sandiford
2021-07-23  2:21               ` Maciej W. Rozycki
2021-07-23  3:18                 ` Xi Ruoyao
2021-07-23  6:01                   ` Xi Ruoyao
2021-07-26 13:55                     ` Richard Sandiford
2021-07-26 15:02                       ` Maciej W. Rozycki

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=8f047551a4694778606d615bd22ef619006d044e.camel@mengyan1223.wang \
    --to=xry111@mengyan1223.wang \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mfortune@gmail.com \
    /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).