]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: fix `asm.c` tests
authorKarl Meakin <karl.meakin@arm.com>
Thu, 11 Dec 2025 16:49:14 +0000 (16:49 +0000)
committerKarl Meakin <karl.meakin@arm.com>
Mon, 26 Jan 2026 15:57:21 +0000 (15:57 +0000)
The assembly functions declared in `asm_1.c` and `asm_3` were not marked
global, so they could not be found by the linker, and would cause the
`asm_2.c` and `asm_4.c` test to fail. Fix by marking the functions with
`.globl`.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sve/pcs/asm_1.c
* gcc.target/aarch64/sve/pcs/asm_3.c: Fix tests.

gcc/testsuite/gcc.target/aarch64/sve/pcs/asm_1.c
gcc/testsuite/gcc.target/aarch64/sve/pcs/asm_3.c

index 8be2094dc96d4d4e38e0298f7cc31dae64d95901..9c42b7873bf29b76e1fcab61ae8fe4b2cad804f3 100644 (file)
@@ -6,11 +6,13 @@
 #define ASM_FUNCTION(NAME, RET_TYPE, ARG_TYPE, INSN) \
 extern RET_TYPE NAME (svbool_t, ARG_TYPE);     \
   asm(                                         \
-"      .type   " #NAME ", %function\n"         \
-#NAME ":\n"                                    \
+"      .type   %cc0,   %%function\n"           \
+"      .globl  %cc0\n"                         \
+"%cc0:\n"                                      \
 "      " INSN "\n"                             \
 "      ret\n"                                  \
-"      .size   " #NAME ", .-" #NAME "\n"       \
+"      .size   %cc0, .-%cc0\n"                 \
+: :":"(NAME ) \
 )
 
 ASM_FUNCTION (u8_callee, uint64_t, svuint8_t,
index d5a36e52eab1f71c90b00997d45abf8760624dc7..bcfa2c4c5418e57c53e56dfa68ee4372e0638a59 100644 (file)
@@ -6,11 +6,13 @@
 #define ASM_FUNCTION(NAME, RET_TYPE, ARG_TYPE, INSN) \
 extern RET_TYPE NAME (svbool_t, ARG_TYPE);     \
   asm(                                         \
-"      .type   " #NAME ", %function\n"         \
-#NAME ":\n"                                    \
+"      .type   %cc0,   %%function\n"           \
+"      .globl  %cc0\n"                         \
+"%cc0:\n"                                      \
 "      " INSN "\n"                             \
 "      ret\n"                                  \
-"      .size   " #NAME ", .-" #NAME "\n"       \
+"      .size   %cc0, .-%cc0\n"                 \
+: :":"(NAME ) \
 )
 
 ASM_FUNCTION (u8_callee, svuint8_t, svuint8x2_t,