From: Iain Sandoe Date: Sat, 13 Jan 2024 13:40:51 +0000 (+0000) Subject: testsuite, jit, Darwin: Handle Mach-O in assembler tests. X-Git-Tag: basepoints/gcc-15~1903 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=283e3a974bf08e4fb64d51d2062e1f7ed7482ff4;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/testsuite/jit.dg/test-always_inline-attribute.c b/gcc/testsuite/jit.dg/test-always_inline-attribute.c index 5c3f386663f6..f7201a17140b 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 eac6cae6b6af..acfea8fc55e2 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 8489df9c6b93..14edc723f610 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 cb20952c687f..446c5c5c31b2 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 ea854ff4a9f1..219a47d88176 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 546ade1c3c41..3ca9485bf411 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* } } } */