This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[testsuite patch] gcc-4.1 compat. [Re: [patch] More workarounds for gold/15021]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org, ccoutant at google dot com
- Date: Thu, 12 Sep 2013 09:31:46 +0200
- Subject: [testsuite patch] gcc-4.1 compat. [Re: [patch] More workarounds for gold/15021]
- Authentication-results: sourceware.org; auth=none
- References: <yjt2a9k2yff1 dot fsf at ruffy dot mtv dot corp dot google dot com>
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;
}