testsuite: fix is_aarch32_target

Commit

   c221b2f770 Testsuite: Add gdb_can_simple_compile

changed the source file name extension of the test program from .s to .c
resulting in compile fails.  This, in turn, causes is_aarch32_target
checks to fail.

Change the test source from an assembly program to a C program using
inline assembly.

is_amd64_regs_target had a similar problem, which was fixed by commit

    224d30d393 testsuite: fix is_amd64_regs_target

This fix — and commit message — are mostly copied from it.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Thiago Jung Bauermann
2025-03-28 01:03:20 -03:00
parent a93f60043a
commit 01e4635523

View File

@@ -3937,13 +3937,16 @@ gdb_caching_proc is_aarch32_target {} {
return 0 return 0
} }
set list {} return [gdb_can_simple_compile aarch32 {
foreach reg \ int main (void) {
{r0 r1 r2 r3} { asm ("\tmov r0, r0");
lappend list "\tmov $reg, $reg" asm ("\tmov r1, r1");
} asm ("\tmov r2, r2");
asm ("\tmov r3, r3");
return [gdb_can_simple_compile aarch32 [join $list \n]] return 0;
}
}]
} }
# Return 1 if this target is an aarch64, either lp64 or ilp32. # Return 1 if this target is an aarch64, either lp64 or ilp32.