public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Powerpc, fix vla-optimized-out.exp test
@ 2022-03-24 21:41 Carl Love
  2022-03-24 22:46 ` will schmidt
  0 siblings, 1 reply; 7+ messages in thread
From: Carl Love @ 2022-03-24 21:41 UTC (permalink / raw)
  To: gdb-patches, cel; +Cc: Rogerio Alves, Will Schmidt

GDB maintainers:

The vla-optimized-out.exp test has a check to print the size of
variable a.  The test expects the size to be available even though the
use of the variable has been optimized out.  This is true on Intel. 
However, on Powerpc both the use and the size of the variable are
optimized out.

This patch adds to the test to check for the size or optimized out. The
change fixes the test failure on Powerpc.

The patch has been tested on a Power 10 system and on and Intel 64-bit
system.  No regressions were seen.

Please let me know if this patch is acceptable for gdb mainline. 
Thanks.

                    Carl Love

------------------------------------------
Powerpc, fix vla-optimized-out.exp test

The size of the variable vla is not optimized out on Intel inspite of the
use of the variable use being optimized out.

On Powerpc, the use of vla and the size of vla are both optimized out.

The output on Powerpc is:

p sizeof (a)
$2 = <optimized out>
(gdb) FAIL: gdb.base/vla-optimized-out.exp: o1: printed size of optimized out vla

This patch changes the gdb_test to check for the size of vla being
available or optimized out.  In either case, the test now passes.
---
 gdb/testsuite/gdb.base/vla-optimized-out.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/vla-optimized-out.exp b/gdb/testsuite/gdb.base/vla-optimized-out.exp
index b16142ee329..9a83b7ff81b 100644
--- a/gdb/testsuite/gdb.base/vla-optimized-out.exp
+++ b/gdb/testsuite/gdb.base/vla-optimized-out.exp
@@ -40,8 +40,10 @@ proc vla_optimized_out {exe_suffix options} {
 	" = <optimized out>" \
 	"printed optimized out vla"
 
+    # On Intel the variable use of variable vla is optimized out but the size
+    # is available.  On Powerpc, the variable and the size are optimized out.
     gdb_test "p sizeof (a)" \
-	" = ($sizeof_result)" \
+	"( = ($sizeof_result)| = <optimized out>)" \
 	"printed size of optimized out vla"
 
     # At lower optimisation levels, the upper bound of the array is
-- 
2.31.1




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-23 14:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-24 21:41 [PATCH] Powerpc, fix vla-optimized-out.exp test Carl Love
2022-03-24 22:46 ` will schmidt
2022-03-25 15:26   ` Carl Love
2022-03-28 15:34     ` Carl Love
2022-04-17 15:19       ` Joel Brobecker
2022-06-09 17:23         ` Carl Love
2022-06-23 14:19           ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).