From: Carl Love Date: Wed, 13 Oct 2021 22:32:06 +0000 (+0000) Subject: Fix test step-and-next-inline.cc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e3e4224e79906a518a1446049de9924a60d05e7c;p=binutils-gdb.git Fix test step-and-next-inline.cc The test expect the runto_main to stop at the first line of the function. Depending on the optimization level, gdb may stop in the prolog or after the prolog at the first line. To ensure the test stops at the first line of main, have it explicitly stop at a break point on the first line of the function. On PowerPC, the test passes when compiled with no optimization but fails with all levels of optimization due to gdb stopping in the prolog. --- diff --git a/gdb/testsuite/gdb.cp/step-and-next-inline.cc b/gdb/testsuite/gdb.cp/step-and-next-inline.cc index 26b29d01777..71b93e844f4 100644 --- a/gdb/testsuite/gdb.cp/step-and-next-inline.cc +++ b/gdb/testsuite/gdb.cp/step-and-next-inline.cc @@ -61,6 +61,6 @@ tree xx; int main() { - get_alias_set (&xx); + get_alias_set (&xx); /* Beginning of main */ return 0; } // main diff --git a/gdb/testsuite/gdb.cp/step-and-next-inline.exp b/gdb/testsuite/gdb.cp/step-and-next-inline.exp index 4997abb9b1b..9f30f537bd3 100644 --- a/gdb/testsuite/gdb.cp/step-and-next-inline.exp +++ b/gdb/testsuite/gdb.cp/step-and-next-inline.exp @@ -58,7 +58,9 @@ proc do_test { use_header } { with_test_prefix $prefix { - if ![runto_main] { + set main_location [gdb_get_line_number "Beginning of main" $srcfile] + + if ![runto $main_location qualified] { return }