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


> A test case would probably help.

What about this?  It's "obviously" a good test because it FAILs on 
hppa2.0w-hp-hpux11.11 with the current mainline.  On the PA with main,
struct blah  function foo are missing in the assembler output for some
reason.  It passes on the PA with 3.0.2.

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

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

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

// { 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]