public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] aarch64: testsuite: symbol-range fallback to compile
@ 2022-06-22  5:22 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2022-06-22  5:22 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c8fff73c4558250940030aeaf293318a07f56de6

commit c8fff73c4558250940030aeaf293318a07f56de6
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Mon Jun 20 19:43:45 2022 -0300

    aarch64: testsuite: symbol-range fallback to compile
    
    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.

Diff:
---
 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 d8e82fa1b28..f9a916c7ae2 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 d1f4eb7641f..0507d6e617f 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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] aarch64: testsuite: symbol-range fallback to compile
@ 2022-06-23  5:10 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2022-06-23  5:10 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:81029fc334518e05e08f4ddb5c2b4437c900b2ef

commit 81029fc334518e05e08f4ddb5c2b4437c900b2ef
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Mon Jun 20 19:43:45 2022 -0300

    aarch64: testsuite: symbol-range fallback to compile
    
    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 two_plus_gigs effective
    target, that checks for the ability to link a program with 2GiB 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_two_plus_gigs): New.
            * doc/sourcebuild.exp (Environment attributes): Document it.
            * gcc.target/aarch64/symbol-range.c: Link only on
            two_plus_gigs targets, compile otherwise.

Diff:
---
 gcc/doc/sourcebuild.texi                        | 3 +++
 gcc/testsuite/gcc.target/aarch64/symbol-range.c | 3 ++-
 gcc/testsuite/lib/target-supports.exp           | 9 +++++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 606ab85a116..3696a58fbf2 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2681,6 +2681,9 @@ Target supports @code{sysconf}.
 @item trampolines
 Target supports trampolines.
 
+@item two_plus_gigs
+Target supports linking programs with 2+GiB of data.
+
 @item uclibc
 Target supports uClibc.
 
diff --git a/gcc/testsuite/gcc.target/aarch64/symbol-range.c b/gcc/testsuite/gcc.target/aarch64/symbol-range.c
index d8e82fa1b28..6b15f087202 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 two_plus_gigs } } */
+/* { dg-do compile { target { ! two_plus_gigs } } } */
 /* { 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 d1f4eb7641f..20171f9d985 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_two_plus_gigs { } {
+    return [check_no_compiler_messages two_plus_gigs executable {
+	int dummy[0x80000000];
+	int main () { return 0; }
+    }]
+}
+
 # Return 1 if we're generating 32-bit code using default options, 0
 # otherwise.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-23  5:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22  5:22 [gcc(refs/users/aoliva/heads/testme)] aarch64: testsuite: symbol-range fallback to compile Alexandre Oliva
2022-06-23  5:10 Alexandre Oliva

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).