This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[testsuite patch] gcc-4.1 compat. [Re: [patch] More workarounds for gold/15021]


On Tue, 27 Aug 2013 23:47:30 +0200, Doug Evans wrote:
> 	testsuite/
> 	* gdb.base/enumval.c (ZERO): New enum value.
> 	(main): Use it
> 	* gdb.base/enumval.exp: Test ability to print ZERO.

CentOS-5.9 both x86_64 and i386, using gcc-4.1.2-54.el5:
	p ZERO
	No symbol "ZERO" in current context.
	(gdb) FAIL: gdb.base/enumval.exp: p ZERO

But would it still FAIL on the gold case?  I guess not so I will rather have
to skip the test on gcc-4.1 I guess.

I do not have FSF GCC 4.1 (unpatched) but the problem is not reproducible with
FSF GCC 4.2.5 20090330.


Thanks,
Jan


gdb/testsuite/
2013-09-12  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix compatibility with gcc-4.1.
	* gdb.base/enumval.c (zero_var): New variable.
	(main): Return just 0.

diff --git a/gdb/testsuite/gdb.base/enumval.c b/gdb/testsuite/gdb.base/enumval.c
index 44d4fd0..bc3e7bf 100644
--- a/gdb/testsuite/gdb.base/enumval.c
+++ b/gdb/testsuite/gdb.base/enumval.c
@@ -17,7 +17,8 @@
 
 enum e { I, J = 0xffffffffU, K = 0xf000000000000000ULL } e = J, f = K;
 
-enum { ZERO };
+enum { ZERO }
+zero_var; /* This is here to ensure it survives into the debug info.  */
 
 void
 dummy()
@@ -28,5 +29,5 @@ int
 main(void)
 {
   dummy();
-  return ZERO; /* This is here to ensure it survives into the debug info.  */
+  return 0;
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]