This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: C++ pcc struct return fix


> >>>>> "John" == John David Anglin <dave@hiauly1.hia.nrc.ca> writes:
> 
> >> Did we ever reach resolution on this issue?
> > No.

The only issue remaining in this thread is the testcase.  Is this OK for
the main?  There is no change in the test from what I sent previously.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2001-12-08  John David Anglin  <dave@hiauly1.hia.nrc.ca>

        * g++.dg/init/struct-ret1.C: New file.

--- /dev/null	Sat Dec  8 11:40:02 2001
+++ g++.dg/init/struct-ret1.C	Tue Dec  4 14:15:38 2001
@@ -0,0 +1,19 @@
+// { dg-do run }
+
+struct blah { int a[6]; };
+
+inline struct blah foo()
+{
+  struct blah r = { { 12, 24, 36, 48, 60, 72 } };
+  return r;
+}
+
+int
+main()
+{
+  struct blah x = foo();
+
+  if (x.a[0] != 12 || x.a[1] != 24 || x.a[2] != 36 || x.a[3] != 48
+      || x.a[4] != 60 || x.a[5] != 72)
+    return 1;
+}


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