From da0e236d30473eea91766e124d49a2256b7cf398 Mon Sep 17 00:00:00 2001 From: Aditya Vidyadhar Kamath Date: Mon, 1 Apr 2024 03:12:29 -0500 Subject: [PATCH] Fix max-depth test case for AIX. In AIX, if in the main program the variables are unused then the linker optimises these variables and the dwarf will not have proper address to the same. Hence we cannot access these variables. This patch is a fix to the same so that all the test case of max-depth can passs in AIX as well. --- gdb/testsuite/gdb.base/max-depth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/testsuite/gdb.base/max-depth.c b/gdb/testsuite/gdb.base/max-depth.c index fee5de5af34..e4b4459eed5 100644 --- a/gdb/testsuite/gdb.base/max-depth.c +++ b/gdb/testsuite/gdb.base/max-depth.c @@ -228,5 +228,9 @@ struct V7 : virtual V4, virtual V5, virtual V6 { int v7 = 1; } v7; int main () { + #ifdef _AIX + s1.x = 0; + #endif + return 0; } -- 2.41.0