Add a run-time testcase for PR tree-optimization/43904.

2010-04-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR tree-optimization/43904
	* gcc.dg/tree-ssa/tailcall-6.c: New.

From-SVN: r158757
This commit is contained in:
H.J. Lu 2010-04-27 00:25:18 +00:00 committed by H.J. Lu
parent f4213ac497
commit 6a07739dee
2 changed files with 38 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2010-04-26 H.J. Lu <hongjiu.lu@intel.com>
PR tree-optimization/43904
* gcc.dg/tree-ssa/tailcall-6.c: New.
2010-04-26 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
PR testsuite/35165

View File

@ -0,0 +1,33 @@
/* PR tree-optimization/43904. */
/* { dg-do run } */
/* { dg-options "-O1 -foptimize-sibling-calls" } */
typedef __SIZE_TYPE__ size_t;
extern void abort(void);
void *memcpy(void *dest, const void *src, size_t n);
void
buggy_init(void *ptr, size_t size)
{
const char *str = "Hello world!";
memcpy(ptr, &str, size);
}
void
expose_bug(void *ptr, size_t size)
{
const char *str;
memcpy(&str, ptr, size);
if (*str != 'H')
abort ();
}
int
main()
{
const char *ptr;
buggy_init(&ptr, sizeof(ptr));
expose_bug(&ptr, sizeof(ptr));
return 0;
}