public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8236] testsuite, jit, Darwin: Handle Mach-O in assembler tests.
@ 2024-01-18 14:01 Iain D Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2024-01-18 14:01 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:283e3a974bf08e4fb64d51d2062e1f7ed7482ff4

commit r14-8236-g283e3a974bf08e4fb64d51d2062e1f7ed7482ff4
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sat Jan 13 13:40:51 2024 +0000

    testsuite, jit, Darwin: Handle Mach-O in assembler tests.
    
    Several of the jit tests check for assembler-specific output
    which differs on Mach-O from ELF.
    
    This patch uses the facility to make the scans target-dependent
    and adds handling for darwin.
    
    gcc/testsuite/ChangeLog:
    
            * jit.dg/test-always_inline-attribute.c: Handle Darwin in
            jit-verify-assembler-output.
            * jit.dg/test-noinline-attribute.c: Likewise.
            * jit.dg/test-setting-alignment.c: Likewise.
            * jit.dg/test-used-attribute.c: Likewise.
            * jit.dg/test-variable-attribute.c: Likewise.
            * jit.dg/test-weak-attribute.c: Likewise.
    
    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

Diff:
---
 gcc/testsuite/jit.dg/test-always_inline-attribute.c | 10 +++++++---
 gcc/testsuite/jit.dg/test-noinline-attribute.c      | 10 +++++++---
 gcc/testsuite/jit.dg/test-setting-alignment.c       |  3 ++-
 gcc/testsuite/jit.dg/test-used-attribute.c          | 10 +++++++---
 gcc/testsuite/jit.dg/test-variable-attribute.c      | 10 ++++++----
 gcc/testsuite/jit.dg/test-weak-attribute.c          |  3 ++-
 6 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/gcc/testsuite/jit.dg/test-always_inline-attribute.c b/gcc/testsuite/jit.dg/test-always_inline-attribute.c
index 5c3f386663f..f7201a17140 100644
--- a/gcc/testsuite/jit.dg/test-always_inline-attribute.c
+++ b/gcc/testsuite/jit.dg/test-always_inline-attribute.c
@@ -148,6 +148,10 @@ int foo () {
 
 /* { dg-final { jit-verify-output-file-was-created "" } } */
 /* Check that the "removed" function was inlined, but not the others */
-/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed,\\s+@function" } } */
-/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed,\\s+@function" } } */
-/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" } } */
+/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed,\\s+@function" { target { ! *-*-darwin* } } } } */
+/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed,\\s+@function" { target { ! *-*-darwin* } } } } */
+/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" { target { ! *-*-darwin* } } } } */
+
+/* { dg-final { jit-verify-assembler-output-not "\\n_removed:" { target *-*-darwin* } } } */
+/* { dg-final { jit-verify-assembler-output "\\n_not_removed:" { target *-*-darwin* } } } */
+/* { dg-final { jit-verify-assembler-output "\\n_foo:" { target *-*-darwin* } } } */
diff --git a/gcc/testsuite/jit.dg/test-noinline-attribute.c b/gcc/testsuite/jit.dg/test-noinline-attribute.c
index eac6cae6b6a..acfea8fc55e 100644
--- a/gcc/testsuite/jit.dg/test-noinline-attribute.c
+++ b/gcc/testsuite/jit.dg/test-noinline-attribute.c
@@ -114,6 +114,10 @@ int foo () {
 
 /* { dg-final { jit-verify-output-file-was-created "" } } */
 /* Check that the "removed" function was inlined, but not the others */
-/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed.isra.0,\\s+@function" } } */
-/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed.isra.0,\\s+@function" } } */
-/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" } } */
+/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed.isra.0,\\s+@function" { target { ! *-*-darwin* } } } } */
+/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed.isra.0,\\s+@function" { target { ! *-*-darwin* } } } } */
+/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" { target { ! *-*-darwin* } } } } */
+
+/* { dg-final { jit-verify-assembler-output-not "\\n_removed.isra.0:" { target *-*-darwin* } } } */
+/* { dg-final { jit-verify-assembler-output "\\n_not_removed.isra.0:" { target *-*-darwin* } } } */
+/* { dg-final { jit-verify-assembler-output "\\n_foo:" { target *-*-darwin* } } } */
diff --git a/gcc/testsuite/jit.dg/test-setting-alignment.c b/gcc/testsuite/jit.dg/test-setting-alignment.c
index 8489df9c6b9..14edc723f61 100644
--- a/gcc/testsuite/jit.dg/test-setting-alignment.c
+++ b/gcc/testsuite/jit.dg/test-setting-alignment.c
@@ -62,5 +62,6 @@ create_code (gcc_jit_context *ctxt, void *user_data)
 }
 
 /* { dg-final { jit-verify-output-file-was-created "" } } */
-/* { dg-final { jit-verify-assembler-output ".comm	foo,4,8" } } */
+/* { dg-final { jit-verify-assembler-output ".comm	foo,4,8" { target { ! *-*-darwin* } } } } */
+/* { dg-final { jit-verify-assembler-output ".comm\\s_foo,4,3" { target *-*-darwin* } } } */
 /* { dg-final { jit-verify-assembler-output "movl	-16\\\(%rbp\\\), %eax" } } */
diff --git a/gcc/testsuite/jit.dg/test-used-attribute.c b/gcc/testsuite/jit.dg/test-used-attribute.c
index cb20952c687..446c5c5c31b 100644
--- a/gcc/testsuite/jit.dg/test-used-attribute.c
+++ b/gcc/testsuite/jit.dg/test-used-attribute.c
@@ -107,6 +107,10 @@ int foo() {
 
 /* { dg-final { jit-verify-output-file-was-created "" } } */
 /* Check that the "removed" function was inlined, but not the others */
-/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed,\\s+@function" } } */
-/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed,\\s+@function" } } */
-/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" } } */
+/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed,\\s+@function" { target { ! *-*-darwin* } } } } */
+/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed,\\s+@function" { target { ! *-*-darwin* } } } } */
+/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" { target { ! *-*-darwin* } } } } */
+
+/* { dg-final { jit-verify-assembler-output-not "\\n_removed:" { target *-*-darwin* } } } */
+/* { dg-final { jit-verify-assembler-output "\\n_not_removed:" { target *-*-darwin* } } } */
+/* { dg-final { jit-verify-assembler-output "\\n_foo:" { target *-*-darwin* } } } */
diff --git a/gcc/testsuite/jit.dg/test-variable-attribute.c b/gcc/testsuite/jit.dg/test-variable-attribute.c
index ea854ff4a9f..219a47d8817 100644
--- a/gcc/testsuite/jit.dg/test-variable-attribute.c
+++ b/gcc/testsuite/jit.dg/test-variable-attribute.c
@@ -40,7 +40,9 @@ int PUBLIC = 12;
 
 /* { dg-final { jit-verify-output-file-was-created "" } } */
 /* Check that the attribute was applied correctly */
-/* { dg-final { jit-verify-assembler-output ".hidden\\s+PRIVATE" } } */
-/* { dg-final { jit-verify-assembler-output ".globl\\s+PRIVATE" } } */
-/* { dg-final { jit-verify-assembler-output-not ".hidden\\s+PUBLIC" } } */
-/* { dg-final { jit-verify-assembler-output ".globl\\s+PUBLIC" } } */
+/* { dg-final { jit-verify-assembler-output ".hidden\\s+PRIVATE" { target { ! *-*-darwin* } } } } */
+/* { dg-final { jit-verify-assembler-output ".private_extern\\s+_PRIVATE" { target *-*-darwin* } } } */
+/* { dg-final { jit-verify-assembler-output ".globl\\s+_?PRIVATE" } } */
+/* { dg-final { jit-verify-assembler-output-not ".hidden\\s+PUBLIC" { target { ! *-*-darwin* } } } } */
+/* { dg-final { jit-verify-assembler-output-not ".private_extern\\s+_PUBLIC" { target *-*-darwin* } } } */
+/* { dg-final { jit-verify-assembler-output ".globl\\s+_?PUBLIC" } } */
diff --git a/gcc/testsuite/jit.dg/test-weak-attribute.c b/gcc/testsuite/jit.dg/test-weak-attribute.c
index 546ade1c3c4..3ca9485bf41 100644
--- a/gcc/testsuite/jit.dg/test-weak-attribute.c
+++ b/gcc/testsuite/jit.dg/test-weak-attribute.c
@@ -38,4 +38,5 @@ void f () {}
 
 /* { dg-final { jit-verify-output-file-was-created "" } } */
 /* Check that the attribute was applied correctly */
-/* { dg-final { jit-verify-assembler-output ".weak\\s+f" } } */
+/* { dg-final { jit-verify-assembler-output ".weak\\s+f" { target { ! *-*-darwin* } } } } */
+/* { dg-final { jit-verify-assembler-output ".weak_definition\\s+_f" { target *-*-darwin* } } } */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-18 14:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 14:01 [gcc r14-8236] testsuite, jit, Darwin: Handle Mach-O in assembler tests Iain D Sandoe

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