]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/testsuite] Compile infcall-nested-structs.exp with -O2
authorTom de Vries <tdevries@suse.de>
Mon, 21 Oct 2019 13:08:54 +0000 (15:08 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 21 Oct 2019 13:08:54 +0000 (15:08 +0200)
commit94cb3754118669d46c8ad87c986d8d9c59fac65a
tree854f019d56306ec76d180b79e1a352a6fbf4d183
parent95cc7c169c4bbb6f10e630184f527b20b83fc5c3
[gdb/testsuite] Compile infcall-nested-structs.exp with -O2

As mentioned in commit 745ff14e6e1 "[gdb/tdep] Fix 'Unexpected register class'
assert in amd64_push_arguments", of the 12 KFAILs added there, 3 are KPASSing
with g++ 4.8.5.

The KPASSes are due to:
- gdb incorrectly expecting the second half of the result of function
  rtn_str_struct_02_01 in register %rdx.
- rtn_str_struct_02_01 using %rdx as a temporary, thereby accidentally setting
  it to the expected value.

Reduce the chance of hiding errors due accidental register settings by
compiling the test-case with -O2.

This fixes the KPASSes when applied on top of commit 745ff14e6e1.

Tested on x86_64-linux.

Tested with g++ 4.8.5, 7.4.1, 8.3.1, 9.2.1.

gdb/testsuite/ChangeLog:

2019-10-21  Tom de Vries  <tdevries@suse.de>

* gdb.base/infcall-nested-structs.c: Add
__attribute__((noinline,noclone)) to all functions.
(call_all): Add missing variable initialization.  Simplify return value.
(breakpt): Increment volatile variable, to prevent call from being
optimized out.
* gdb.base/infcall-nested-structs.exp: Compile with -O2.

Change-Id: Ic027e1c957fecd6686345639db99f5eaee3cdf05
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/infcall-nested-structs.c
gdb/testsuite/gdb.base/infcall-nested-structs.exp