From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20594 invoked by alias); 4 Feb 2004 00:06:47 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20587 invoked from network); 4 Feb 2004 00:06:46 -0000 Received: from unknown (HELO localhost.redhat.com) (216.129.200.20) by sources.redhat.com with SMTP; 4 Feb 2004 00:06:46 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id B9C3C2B92; Tue, 3 Feb 2004 19:06:47 -0500 (EST) Message-ID: <40203797.8010607@gnu.org> Date: Wed, 04 Feb 2004 00:06:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [patch/rfc] Test struct0 Content-Type: multipart/mixed; boundary="------------060500070403000300070603" X-SW-Source: 2004-02/txt/msg00058.txt.bz2 This is a multi-part message in MIME format. --------------060500070403000300070603 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 547 Hello, This adds a test for: struct foo0 { }; to the structs.exp testcase (I'm assuming that this is legal ISO-C), it passes on PPC with stabs with: > (gdb) PASS: gdb.base/structs.exp: ptype foo1; structs-tc > p/c fun0() > $1 = {} Tt was intended for completness, however with a dwarf2 compiler: amd64$ gcc --version gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-24) > (gdb) PASS: gdb.base/structs.exp: ptype foo1; structs-tc > p/c fun0() > $1 = I guess I should file a bug report and kfail it? Andrew --------------060500070403000300070603 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 2696 2004-02-03 Andrew Cagney * gdb.base/structs.c (struct struct0): Define. (foo0, L0): New variables. (fun0, Fun0): New functions. (main): Call fun0 and Fun0. * gdb.base/structs.exp: Test zero sized structure. (foo): Add output from an empty struct. Index: testsuite/gdb.base/structs.c =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/structs.c,v retrieving revision 1.5 diff -u -r1.5 structs.c --- testsuite/gdb.base/structs.c 20 Nov 2003 17:11:55 -0000 1.5 +++ testsuite/gdb.base/structs.c 3 Feb 2004 23:34:47 -0000 @@ -86,6 +86,7 @@ typedef tQ tR; #endif +struct struct0 {}; struct struct1 {tA a;}; struct struct2 {tA a; tB b;}; struct struct3 {tA a; tB b; tC c; }; @@ -105,6 +106,7 @@ struct struct17 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; tJ j; tK k; tL l; tM m; tN n; tO o; tP p; tQ q; }; struct struct18 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; tJ j; tK k; tL l; tM m; tN n; tO o; tP p; tQ q; tR r; }; +struct struct0 foo0 = {}, L0; struct struct1 foo1 = {'1'}, L1; struct struct2 foo2 = {'a','2'}, L2; struct struct3 foo3 = {'1','b','3'}, L3; @@ -124,6 +126,10 @@ struct struct17 foo17 = {'1','b','3','d','5','f','7','h','9','j','B','l','D','n','F','p','H'}, L17; struct struct18 foo18 = {'a','2','c','4','e','6','g','8','i','A','k','C','m','E','o','G','q','I'}, L18; +struct struct0 fun0() +{ + return foo0; +} struct struct1 fun1() { return foo1; @@ -198,6 +204,15 @@ } #ifdef PROTOTYPES +void Fun0(struct struct0 foo0) +#else +void Fun0(foo0) + struct struct0 foo0; +#endif +{ + L0 = foo0; +} +#ifdef PROTOTYPES void Fun1(struct struct1 foo1) #else void Fun1(foo1) @@ -408,6 +423,7 @@ #endif int i; + Fun0(foo0); Fun1(foo1); Fun2(foo2); Fun3(foo3); @@ -435,6 +451,7 @@ while (1) { zed (); + L0 = fun0(); L1 = fun1(); L2 = fun2(); L3 = fun3(); Index: testsuite/gdb.base/structs.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/structs.exp,v retrieving revision 1.17 diff -u -r1.17 structs.exp --- testsuite/gdb.base/structs.exp 4 Jan 2004 15:04:41 -0000 1.17 +++ testsuite/gdb.base/structs.exp 3 Feb 2004 23:34:47 -0000 @@ -118,7 +118,7 @@ proc foo { n } { return [lindex { - "{}" + "{}" "{a = 49 '1'}" "{a = 97 'a', b = 50 '2'}" "{a = 49 '1', b = 98 'b', c = 51 '3'}" @@ -481,6 +481,7 @@ # original "structs" test was doing. start_structs_test { tc } +test_struct_calls 0 test_struct_calls 1 test_struct_calls 2 test_struct_calls 3 --------------060500070403000300070603--