On Fri, May 15, 2026 at 11:50:57AM +0100, Richard Earnshaw (foss) wrote:
> On 11/05/2026 08:51, Torbjörn SVENSSON wrote:
> > Ok for trunk and releases/gcc-16?
> >
> > --
> >
> > The fix applied to toplevel-extended-asm-1_0.c in r16-7892-gb02f9495dcf635,
> > also needs to be applied to toplevel-simple-asm-1_0.c.
> >
> > gcc/testsuite/ChangeLog:
> >
> > * gcc.dg/lto/toplevel-simple-asm-1_0.c: Adjust inline assembler
> > for arm-none-eabi.
>
> LGTM, but please give Jakub until Monday to comment.
This change is wrong. The point of toplevel-simple-asm*
tests is to test the simple toplevel asms, the point of
toplevel-extended-asm* is to test extended asms.
So, by turning the simple test into extended one, it duplicates the
toplevel-extended-asm-1_0.c test, making it useless.
If arm-none-gnueabi can't handle .global without .type directive
(why?), then you should adjust your changes so that it still
uses simple asm, so something like
#ifdef __ELF__
#ifdef __sparc__
#define TYPE_PFX "#"
#elif defined (__arm__) || defined (__aarch64__)
#define TYPE_PFX "%"
#else
#define TYPE_PFX "@"
#endif
#endif
#ifdef TYPE_PFX
asm(".global asm_fn\n.type asm_fn, " TYPE_PFX "function\nasm_fn:");
asm(".global asm_fn_used\n.type asm_fn_used, " TYPE_PFX
"function\nasm_fn_used:");
#else
asm(".global asm_fn\nasm_fn:");
asm(".global asm_fn_used\nasm_fn_used:");
#endif
Jakub