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: [RFA:] Test-cases for sibling calls.


On Sat, Sep 28, 2002 at 10:01:04AM -0400, Hans-Peter Nilsson wrote:
> 	* gcc.dg/sibcall-1.c, gcc.dg/sibcall-2.c, gcc.dg/sibcall-3.c,
> 	gcc.dg/sibcall-4.c: New tests.

Ok.

Another way to have checked this is to verify that the
return address was the same.  I.e.

	static void f1(void) __attribute__((noinline));
	static void f2(void) __attribute__((noinline));
	void *ra[2];

	int main()
	{
	  f1();
	  if (ra[0] != ra[1])
	    abort();
	  return 0;
	}

	static void f1()
	{
	  ra[0] = __builtin_return_address (0);
	  f2();
	}

	static void f2()
	{
	  ra[1] = __builtin_return_address (0);
	}

Perhaps that would work better for the targets you say
don't fail the test properly.


r~


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