]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite, jit, Darwin: Handle Mach-O in assembler tests.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 13 Jan 2024 13:40:51 +0000 (13:40 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 18 Jan 2024 14:01:21 +0000 (14:01 +0000)
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>
gcc/testsuite/jit.dg/test-always_inline-attribute.c
gcc/testsuite/jit.dg/test-noinline-attribute.c
gcc/testsuite/jit.dg/test-setting-alignment.c
gcc/testsuite/jit.dg/test-used-attribute.c
gcc/testsuite/jit.dg/test-variable-attribute.c
gcc/testsuite/jit.dg/test-weak-attribute.c

index 5c3f386663f66f8da9e9239dd1c0642b4183dcbd..f7201a17140ba90e7e5e1c70a7a1f247f7718614 100644 (file)
@@ -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* } } } */
index eac6cae6b6af91b310dcc44be0293d5031efbf65..acfea8fc55e2f3ae269b82e27335e34517cf32e4 100644 (file)
@@ -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* } } } */
index 8489df9c6b9366d1ab92d959c3b1b2a31a569611..14edc723f610614080b45c38a81c213296af65e3 100644 (file)
@@ -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" } } */
index cb20952c687ff5b59d4668ce2ad1a1d3584c5a99..446c5c5c31b2f22bb01afa20db03c992818a8f96 100644 (file)
@@ -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* } } } */
index ea854ff4a9f18d0b07dc0431a9c7f52d8ab936af..219a47d88176db402db6161a71c8617d3ce230d2 100644 (file)
@@ -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" } } */
index 546ade1c3c41ef91ebe4a56dd0c04162f9a8626c..3ca9485bf4117ce8b72b0d890a1fd67c22ddf562 100644 (file)
@@ -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* } } } */