public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] i386, testsuite: adjust asm patterns
@ 2024-02-10 18:07 FX Coudert
  2024-02-11 19:12 ` Mike Stump
  0 siblings, 1 reply; 3+ messages in thread
From: FX Coudert @ 2024-02-10 18:07 UTC (permalink / raw)
  To: GCC Patches; +Cc: Fangrui Song, Iain Sandoe

[-- Attachment #1: Type: text/plain, Size: 679 bytes --]

The new testcase gcc.target/i386/asm-raw-symbol.c fails on darwin. This is partly because symbols are prefixed with underscore, and also because the order of operands in the addition is reversed (but I think it’s valid still). The code generated is this:

_func:
LFB0:
        pushq   %rbp
LCFI0:
        movq    %rsp, %rbp
LCFI1:
# 8 "/Users/fx/gcc-upstream/gcc/testsuite/gcc.target/i386/asm-raw-symbol.c" 1
        @ _func
# 0 "" 2
# 9 "/Users/fx/gcc-upstream/gcc/testsuite/gcc.target/i386/asm-raw-symbol.c" 1
        @ 4+_var
# 0 "" 2
        nop
        popq    %rbp
LCFI2:
        ret



I’m adjusting the pattern accordingly.
OK to push?

FX


[-- Attachment #2: 0001-i386-testsuite-adjust-asm-patterns.patch --]
[-- Type: application/octet-stream, Size: 1102 bytes --]

From bfafd28ce6736b033d126284fe30d9fe1ee783f0 Mon Sep 17 00:00:00 2001
From: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date: Sat, 10 Feb 2024 19:03:37 +0100
Subject: [PATCH] i386, testsuite: adjust asm patterns

On darwin, symbols are prefixed with underscore, and
the order of operands is reversed.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/asm-raw-symbol.c: Adjust asm patterns.
---
 gcc/testsuite/gcc.target/i386/asm-raw-symbol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/i386/asm-raw-symbol.c b/gcc/testsuite/gcc.target/i386/asm-raw-symbol.c
index b7854567dd9..001eb660ad7 100644
--- a/gcc/testsuite/gcc.target/i386/asm-raw-symbol.c
+++ b/gcc/testsuite/gcc.target/i386/asm-raw-symbol.c
@@ -9,5 +9,5 @@ func (void)
   __asm__ ("@ %p0" : : "Ws" (&var + 1));
 }
 
-/* { dg-final { scan-assembler "@ func" } } */
-/* { dg-final { scan-assembler "@ var\\+4" } } */
+/* { dg-final { scan-assembler "@ _?func" } } */
+/* { dg-final { scan-assembler "@ (_?var\\+4|4\\+_?var)" } } */
-- 
2.39.3 (Apple Git-145)


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

end of thread, other threads:[~2024-02-12 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-10 18:07 [PATCH] i386, testsuite: adjust asm patterns FX Coudert
2024-02-11 19:12 ` Mike Stump
2024-02-12 17:56   ` Fangrui Song

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