* Jit testsuite updates for Darwin
@ 2024-01-13 13:57 Iain Sandoe
2024-01-13 13:57 ` [PATCH 1/4] testsuite, jit: test-alias-attribute.c requires alias support Iain Sandoe
0 siblings, 1 reply; 9+ messages in thread
From: Iain Sandoe @ 2024-01-13 13:57 UTC (permalink / raw)
To: dmalcolm, gcc-patches
This is a short series of patches to support non-ELF targets in
the jit tests where these use target-specific capabilities (e.g.
alias support, or scanning for assembler directives.)
An alternative would be to skip these tests for Darwin.
Tested on x86_64 Darwin, and about to test Linux,
OK for trunk if testing is also sucessful on Linux?
thanks
Iain
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/4] testsuite, jit: test-alias-attribute.c requires alias support.
2024-01-13 13:57 Jit testsuite updates for Darwin Iain Sandoe
@ 2024-01-13 13:57 ` Iain Sandoe
2024-01-13 13:57 ` [PATCH 2/4] testsuite, jit: Handle whitespace in test-link-section-assembler.c Iain Sandoe
2024-01-16 19:39 ` [PATCH 1/4] testsuite, jit: test-alias-attribute.c requires alias support David Malcolm
0 siblings, 2 replies; 9+ messages in thread
From: Iain Sandoe @ 2024-01-13 13:57 UTC (permalink / raw)
To: dmalcolm, gcc-patches
Add a dg-require-alias to cover this.
gcc/testsuite/ChangeLog:
* jit.dg/test-alias-attribute.c: Require target alias
support.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
---
gcc/testsuite/jit.dg/test-alias-attribute.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/testsuite/jit.dg/test-alias-attribute.c b/gcc/testsuite/jit.dg/test-alias-attribute.c
index eb29003dfc9..4741aba5011 100644
--- a/gcc/testsuite/jit.dg/test-alias-attribute.c
+++ b/gcc/testsuite/jit.dg/test-alias-attribute.c
@@ -1,4 +1,5 @@
/* { dg-do compile { target x86_64-*-* } } */
+/* { dg-require-alias "" } */
#include <stdlib.h>
#include <stdio.h>
--
2.39.2 (Apple Git-143)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/4] testsuite, jit: Handle whitespace in test-link-section-assembler.c.
2024-01-13 13:57 ` [PATCH 1/4] testsuite, jit: test-alias-attribute.c requires alias support Iain Sandoe
@ 2024-01-13 13:57 ` Iain Sandoe
2024-01-13 13:57 ` [PATCH 3/4] testsuite, jit: Allow for target-specific assembler scans Iain Sandoe
2024-01-16 19:40 ` [PATCH 2/4] testsuite, jit: Handle whitespace in test-link-section-assembler.c David Malcolm
2024-01-16 19:39 ` [PATCH 1/4] testsuite, jit: test-alias-attribute.c requires alias support David Malcolm
1 sibling, 2 replies; 9+ messages in thread
From: Iain Sandoe @ 2024-01-13 13:57 UTC (permalink / raw)
To: dmalcolm, gcc-patches
Darwin has a different .section directive that has more fields and
uses different whitespace. Amend the whitespace in the scan-asm to
be more flexible.
gcc/testsuite/ChangeLog:
* jit.dg/test-link-section-assembler.c: Accept any whitespace
between the .section directive and its arguments.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
---
gcc/testsuite/jit.dg/test-link-section-assembler.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/testsuite/jit.dg/test-link-section-assembler.c b/gcc/testsuite/jit.dg/test-link-section-assembler.c
index a90b00e9a82..a78e9fd26ef 100644
--- a/gcc/testsuite/jit.dg/test-link-section-assembler.c
+++ b/gcc/testsuite/jit.dg/test-link-section-assembler.c
@@ -34,4 +34,4 @@ create_code (gcc_jit_context *ctxt, void *user_data)
}
/* { dg-final { jit-verify-output-file-was-created "" } } */
-/* { dg-final { jit-verify-assembler-output ".section .my_section" } } */
+/* { dg-final { jit-verify-assembler-output ".section\\s.my_section" } } */
--
2.39.2 (Apple Git-143)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/4] testsuite, jit: Allow for target-specific assembler scans.
2024-01-13 13:57 ` [PATCH 2/4] testsuite, jit: Handle whitespace in test-link-section-assembler.c Iain Sandoe
@ 2024-01-13 13:57 ` Iain Sandoe
2024-01-13 13:57 ` [PATCH 4/4] testsuite,jit: Handle Darwin/Mach-O in assembler tests Iain Sandoe
2024-01-16 19:43 ` [PATCH 3/4] testsuite, jit: Allow for target-specific assembler scans David Malcolm
2024-01-16 19:40 ` [PATCH 2/4] testsuite, jit: Handle whitespace in test-link-section-assembler.c David Malcolm
1 sibling, 2 replies; 9+ messages in thread
From: Iain Sandoe @ 2024-01-13 13:57 UTC (permalink / raw)
To: dmalcolm, gcc-patches
If we want to support multiple object formats and to allow for
scan-assembler tests, we need to make it possible to adjust the
tests on a per-target basis.
This adds similar mechamisms to jit-verify-assembler-output{,-not}
to those used for the general scan-assembler dg directives.
As an aside; it would, perhaps, be possible to integrate this more
with scanasm.exp (which would also give access to function body
scanning) but I did not attempt that for this patch.
After this, we can accept things like:
... { jit-verify-assembler-output-not "......" { target { ! *-*-darwin* } } } }
or
... { jit-verify-assembler-output "......" { target *-*-darwin* } } }
gcc/testsuite/ChangeLog:
* jit.dg/jit.exp: Accept target clauses in jit-verify-assembler
handling.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
---
gcc/testsuite/jit.dg/jit.exp | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/gcc/testsuite/jit.dg/jit.exp b/gcc/testsuite/jit.dg/jit.exp
index 56972064d30..286cfa8192a 100644
--- a/gcc/testsuite/jit.dg/jit.exp
+++ b/gcc/testsuite/jit.dg/jit.exp
@@ -875,9 +875,23 @@ proc jit-verify-assembler { args } {
proc jit-verify-assembler-output { args } {
verbose "jit-verify-assembler: $args"
+ if { [llength $args] > 3 } {
+ error "jit-verify-assembler-output: too many arguments"
+ return
+ }
+
set dg-output-text [lindex $args 0]
verbose "dg-output-text: ${dg-output-text}"
+ if { [llength $args] >= 2 } {
+ switch [dg-process-target [lindex $args 1]] {
+ "S" { }
+ "N" { return }
+ "F" { setup_xfail "*-*-*" }
+ "P" { }
+ }
+ }
+
upvar 2 name name
verbose "name: $name"
@@ -907,9 +921,23 @@ proc jit-verify-assembler-output { args } {
proc jit-verify-assembler-output-not { args } {
verbose "jit-verify-assembler: $args"
+ if { [llength $args] > 3 } {
+ error "jit-verify-assembler-output-not: too many arguments"
+ return
+ }
+
set dg-output-text [lindex $args 0]
verbose "dg-output-text: ${dg-output-text}"
+ if { [llength $args] >= 2 } {
+ switch [dg-process-target [lindex $args 1]] {
+ "S" { }
+ "N" { return }
+ "F" { setup_xfail "*-*-*" }
+ "P" { }
+ }
+ }
+
upvar 2 name name
verbose "name: $name"
--
2.39.2 (Apple Git-143)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 4/4] testsuite,jit: Handle Darwin/Mach-O in assembler tests.
2024-01-13 13:57 ` [PATCH 3/4] testsuite, jit: Allow for target-specific assembler scans Iain Sandoe
@ 2024-01-13 13:57 ` Iain Sandoe
2024-01-16 19:52 ` David Malcolm
2024-01-16 19:43 ` [PATCH 3/4] testsuite, jit: Allow for target-specific assembler scans David Malcolm
1 sibling, 1 reply; 9+ messages in thread
From: Iain Sandoe @ 2024-01-13 13:57 UTC (permalink / raw)
To: dmalcolm, gcc-patches
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 targer-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>
---
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* } } } */
--
2.39.2 (Apple Git-143)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] testsuite, jit: test-alias-attribute.c requires alias support.
2024-01-13 13:57 ` [PATCH 1/4] testsuite, jit: test-alias-attribute.c requires alias support Iain Sandoe
2024-01-13 13:57 ` [PATCH 2/4] testsuite, jit: Handle whitespace in test-link-section-assembler.c Iain Sandoe
@ 2024-01-16 19:39 ` David Malcolm
1 sibling, 0 replies; 9+ messages in thread
From: David Malcolm @ 2024-01-16 19:39 UTC (permalink / raw)
To: iain, gcc-patches
On Sat, 2024-01-13 at 13:57 +0000, Iain Sandoe wrote:
> Add a dg-require-alias to cover this.
Sorry about the breakage; LGTM for trunk.
Thanks
Dave
>
> gcc/testsuite/ChangeLog:
>
> * jit.dg/test-alias-attribute.c: Require target alias
> support.
>
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
> ---
> gcc/testsuite/jit.dg/test-alias-attribute.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/gcc/testsuite/jit.dg/test-alias-attribute.c
> b/gcc/testsuite/jit.dg/test-alias-attribute.c
> index eb29003dfc9..4741aba5011 100644
> --- a/gcc/testsuite/jit.dg/test-alias-attribute.c
> +++ b/gcc/testsuite/jit.dg/test-alias-attribute.c
> @@ -1,4 +1,5 @@
> /* { dg-do compile { target x86_64-*-* } } */
> +/* { dg-require-alias "" } */
>
> #include <stdlib.h>
> #include <stdio.h>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/4] testsuite, jit: Handle whitespace in test-link-section-assembler.c.
2024-01-13 13:57 ` [PATCH 2/4] testsuite, jit: Handle whitespace in test-link-section-assembler.c Iain Sandoe
2024-01-13 13:57 ` [PATCH 3/4] testsuite, jit: Allow for target-specific assembler scans Iain Sandoe
@ 2024-01-16 19:40 ` David Malcolm
1 sibling, 0 replies; 9+ messages in thread
From: David Malcolm @ 2024-01-16 19:40 UTC (permalink / raw)
To: iain, gcc-patches
On Sat, 2024-01-13 at 13:57 +0000, Iain Sandoe wrote:
> Darwin has a different .section directive that has more fields and
> uses different whitespace. Amend the whitespace in the scan-asm to
> be more flexible.
LGTM for trunk, assuming your testing was successful.
Thanks
Dave
>
> gcc/testsuite/ChangeLog:
>
> * jit.dg/test-link-section-assembler.c: Accept any whitespace
> between the .section directive and its arguments.
>
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
> ---
> gcc/testsuite/jit.dg/test-link-section-assembler.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/testsuite/jit.dg/test-link-section-assembler.c
> b/gcc/testsuite/jit.dg/test-link-section-assembler.c
> index a90b00e9a82..a78e9fd26ef 100644
> --- a/gcc/testsuite/jit.dg/test-link-section-assembler.c
> +++ b/gcc/testsuite/jit.dg/test-link-section-assembler.c
> @@ -34,4 +34,4 @@ create_code (gcc_jit_context *ctxt, void
> *user_data)
> }
>
> /* { dg-final { jit-verify-output-file-was-created "" } } */
> -/* { dg-final { jit-verify-assembler-output ".section .my_section"
> } } */
> +/* { dg-final { jit-verify-assembler-output ".section\\s.my_section"
> } } */
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/4] testsuite, jit: Allow for target-specific assembler scans.
2024-01-13 13:57 ` [PATCH 3/4] testsuite, jit: Allow for target-specific assembler scans Iain Sandoe
2024-01-13 13:57 ` [PATCH 4/4] testsuite,jit: Handle Darwin/Mach-O in assembler tests Iain Sandoe
@ 2024-01-16 19:43 ` David Malcolm
1 sibling, 0 replies; 9+ messages in thread
From: David Malcolm @ 2024-01-16 19:43 UTC (permalink / raw)
To: iain, gcc-patches
On Sat, 2024-01-13 at 13:57 +0000, Iain Sandoe wrote:
> If we want to support multiple object formats and to allow for
> scan-assembler tests, we need to make it possible to adjust the
> tests on a per-target basis.
>
> This adds similar mechamisms to jit-verify-assembler-output{,-not}
> to those used for the general scan-assembler dg directives.
>
> As an aside; it would, perhaps, be possible to integrate this more
> with scanasm.exp (which would also give access to function body
> scanning) but I did not attempt that for this patch.
>
> After this, we can accept things like:
> ... { jit-verify-assembler-output-not "......" { target { ! *-*-
> darwin* } } } }
> or
> ... { jit-verify-assembler-output "......" { target *-*-darwin* } } }
Thanks; LGTM for trunk, assuming your testing was successful
Dave
>
> gcc/testsuite/ChangeLog:
>
> * jit.dg/jit.exp: Accept target clauses in jit-verify-
> assembler
> handling.
>
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
> ---
> gcc/testsuite/jit.dg/jit.exp | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
>
> diff --git a/gcc/testsuite/jit.dg/jit.exp
> b/gcc/testsuite/jit.dg/jit.exp
> index 56972064d30..286cfa8192a 100644
> --- a/gcc/testsuite/jit.dg/jit.exp
> +++ b/gcc/testsuite/jit.dg/jit.exp
> @@ -875,9 +875,23 @@ proc jit-verify-assembler { args } {
> proc jit-verify-assembler-output { args } {
> verbose "jit-verify-assembler: $args"
>
> + if { [llength $args] > 3 } {
> + error "jit-verify-assembler-output: too many arguments"
> + return
> + }
> +
> set dg-output-text [lindex $args 0]
> verbose "dg-output-text: ${dg-output-text}"
>
> + if { [llength $args] >= 2 } {
> + switch [dg-process-target [lindex $args 1]] {
> + "S" { }
> + "N" { return }
> + "F" { setup_xfail "*-*-*" }
> + "P" { }
> + }
> + }
> +
> upvar 2 name name
> verbose "name: $name"
>
> @@ -907,9 +921,23 @@ proc jit-verify-assembler-output { args } {
> proc jit-verify-assembler-output-not { args } {
> verbose "jit-verify-assembler: $args"
>
> + if { [llength $args] > 3 } {
> + error "jit-verify-assembler-output-not: too many arguments"
> + return
> + }
> +
> set dg-output-text [lindex $args 0]
> verbose "dg-output-text: ${dg-output-text}"
>
> + if { [llength $args] >= 2 } {
> + switch [dg-process-target [lindex $args 1]] {
> + "S" { }
> + "N" { return }
> + "F" { setup_xfail "*-*-*" }
> + "P" { }
> + }
> + }
> +
> upvar 2 name name
> verbose "name: $name"
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] testsuite,jit: Handle Darwin/Mach-O in assembler tests.
2024-01-13 13:57 ` [PATCH 4/4] testsuite,jit: Handle Darwin/Mach-O in assembler tests Iain Sandoe
@ 2024-01-16 19:52 ` David Malcolm
0 siblings, 0 replies; 9+ messages in thread
From: David Malcolm @ 2024-01-16 19:52 UTC (permalink / raw)
To: iain, gcc-patches
On Sat, 2024-01-13 at 13:57 +0000, Iain Sandoe wrote:
> 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 targer-dependent
> and adds handling for darwin.
Sorry about the issues with the tests.
Thanks for the patch. I wonder if there's a better way to express ELF
vs Mach-O, and if these tests should really be rewritten to e.g. use
dumpfiles from an earlier point in the optimizer where the results
might be less target-specific.
In the meantime, LGTM for trunk, assuming your testing was successful.
Thanks again for the patch
Dave
>
> 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>
> ---
> 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] 9+ messages in thread
end of thread, other threads:[~2024-01-16 19:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-13 13:57 Jit testsuite updates for Darwin Iain Sandoe
2024-01-13 13:57 ` [PATCH 1/4] testsuite, jit: test-alias-attribute.c requires alias support Iain Sandoe
2024-01-13 13:57 ` [PATCH 2/4] testsuite, jit: Handle whitespace in test-link-section-assembler.c Iain Sandoe
2024-01-13 13:57 ` [PATCH 3/4] testsuite, jit: Allow for target-specific assembler scans Iain Sandoe
2024-01-13 13:57 ` [PATCH 4/4] testsuite,jit: Handle Darwin/Mach-O in assembler tests Iain Sandoe
2024-01-16 19:52 ` David Malcolm
2024-01-16 19:43 ` [PATCH 3/4] testsuite, jit: Allow for target-specific assembler scans David Malcolm
2024-01-16 19:40 ` [PATCH 2/4] testsuite, jit: Handle whitespace in test-link-section-assembler.c David Malcolm
2024-01-16 19:39 ` [PATCH 1/4] testsuite, jit: test-alias-attribute.c requires alias support David Malcolm
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).