public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <oliva@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Richard Earnshaw <richard.earnshaw@arm.com>,
	Marcus Shawcroft <marcus.shawcroft@arm.com>,
	Kyrylo Tkachov <kyrylo.tkachov@arm.com>,
	richard.sandiford@arm.com
Subject: Re: [PATCH] aarch64: testsuite: symbol-range compile only
Date: Wed, 22 Jun 2022 02:14:35 -0300	[thread overview]
Message-ID: <orh74db7pg.fsf@lxoliva.fsfla.org> (raw)
In-Reply-To: <mptbkum72l3.fsf@arm.com> (Richard Sandiford's message of "Tue, 21 Jun 2022 11:06:32 +0100")

On Jun 21, 2022, Richard Sandiford <richard.sandiford@arm.com> wrote:

> Could we instead have a new target selector for whether the memory
> map includes xGB of RAM?

How about this?  Testing on aarch64-rtems6.0.  Ok to install?


aarch64: testsuite: symbol-range fallback to compile

From: Alexandre Oliva <oliva@adacore.com>

On some of our embedded aarch64 targets, RAM size is too small for
this test to fit.  It doesn't look like this test requires linking,
and if it does, the -tiny version may presumably get most of the
coverage without going overboard in target system requirements.

Still, linking may be useful, so introduce a TwoPlusGigs effective
target, that checks for the ability to link a program with 2GB of
sbss, and use that to select whether to link or just compile
symbol-range.c.


for  gcc/testsuite/ChangeLog

	* lib/target-supports.exp
	(check_effective_target_TwoPlusGigs): New.
	* gcc.target/aarch64/symbol-range.c: Link only on
	TwoPlusGigs targets, compile otherwise.
---
 gcc/testsuite/gcc.target/aarch64/symbol-range.c |    3 ++-
 gcc/testsuite/lib/target-supports.exp           |    9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/aarch64/symbol-range.c b/gcc/testsuite/gcc.target/aarch64/symbol-range.c
index d8e82fa1b2829..f9a916c7ae2f0 100644
--- a/gcc/testsuite/gcc.target/aarch64/symbol-range.c
+++ b/gcc/testsuite/gcc.target/aarch64/symbol-range.c
@@ -1,4 +1,5 @@
-/* { dg-do link } */
+/* { dg-do link { target TwoPlusGigs } } */
+/* { dg-do compile { target { ! TwoPlusGigs } } } */
 /* { dg-options "-O3 -save-temps -mcmodel=small" } */
 
 char fixed_regs[0x80000000];
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index d1f4eb7641fa7..0507d6e617fef 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2906,6 +2906,15 @@ proc check_effective_target_le { } {
     }]
 }
 
+# Return 1 if we can link a program with 2+GB of data.
+
+proc check_effective_target_TwoPlusGigs { } {
+    return [check_no_compiler_messages TwoPlusGigs executable {
+	int dummy[0x80000000];
+	int main () { return 0; }
+    }]
+}
+
 # Return 1 if we're generating 32-bit code using default options, 0
 # otherwise.
 


-- 
Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
   Free Software Activist                       GNU Toolchain Engineer
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>

  reply	other threads:[~2022-06-22  5:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21  5:42 Alexandre Oliva
2022-06-21 10:06 ` Richard Sandiford
2022-06-22  5:14   ` Alexandre Oliva [this message]
2022-06-22  8:37     ` Richard Sandiford
2022-06-23 10:59       ` Alexandre Oliva
2022-06-24  2:33         ` Alexandre Oliva
2022-06-30 23:59         ` Hans-Peter Nilsson
2022-07-05  9:03           ` Alexandre Oliva

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=orh74db7pg.fsf@lxoliva.fsfla.org \
    --to=oliva@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.com \
    --cc=marcus.shawcroft@arm.com \
    --cc=richard.earnshaw@arm.com \
    --cc=richard.sandiford@arm.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).