[committed,gdb/testsuite] Fix gdb.dwarf2/entry-value-typedef.exp with -m32

Message ID 20221013080322.GA8133@delia.home
State Committed
Commit 927b2f4caf46e5ca49684c9a52a9786425c60fa2
Headers
Series [committed,gdb/testsuite] Fix gdb.dwarf2/entry-value-typedef.exp with -m32 |

Commit Message

Tom de Vries Oct. 13, 2022, 8:03 a.m. UTC
  Hi,

With test-case gdb.dwarf2/entry-value-typedef.exp and target board unix/-m32,
I run into:
...
builtin_spawn -ignore SIGHUP g++ -fno-stack-protector \
  gdb/testsuite/gdb.dwarf2/entry-value-typedef-amd64.S \
  -fdiagnostics-color=never -Lbuild/libiberty -lm -m32 \
  -o outputs/gdb.dwarf2/entry-value-typedef/entry-value-typedef^M
entry-value-typedef.cpp: Assembler messages:^M
entry-value-typedef.cpp:38: Error: bad register name `%rbp'^M
...

The problem is that the test-cases selects an amd64 .S file based on the check:
...
if { [istarget "x86_64-*-linux*"] } {
...
which is also true for target board unix/-m32 on x86_64-linux.

Fix this by adding the missing is_lp64_target check.

Tested on x86_64-linux, using native and target board unix/-m32.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix gdb.dwarf2/entry-value-typedef.exp with -m32

---
 gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp b/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp
index db09cd2915d..6f196b71dc8 100644
--- a/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp
+++ b/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp
@@ -16,7 +16,7 @@ 
 # The program associated to this test case uncovered a bug in GDB (PR 29374)
 # where a typedef type was used before it was resolved.
 
-if { [istarget "x86_64-*-linux*"] } {
+if { [istarget "x86_64-*-linux*"] && [is_lp64_target] } {
     set suffix amd64
 } elseif { [istarget "aarch64-*-linux*"] } {
     set suffix aarch64