From: kcook Date: Sun, 12 Oct 2003 17:10:12 +0000 (+0000) Subject: PR optimization/8750 X-Git-Tag: upstream/4.9.2~76091 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=785dd4e1ea45669f4c424c0391370df71b0e4565;p=platform%2Fupstream%2Flinaro-gcc.git PR optimization/8750 * gcc.c-torture/execute/20031012-1.c: New Test Case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72402 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 92b96a2..14e13ef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-10-12 Kelley Cook + + PR optimization/8750 + * gcc.c-torture/execute/20031012-1.c: New test case. + 2003-10-11 Roger Sayle * gcc.c-torture/execute/string-opt-8.c: Don't test optimizations @@ -16,7 +21,7 @@ * gcc.c-torture/compile/20031011-1.c: New test. -Sat Oct 11 12:26:16 CEST 2003 Jan Hubicka +2003-10-11 Jan Hubicka * g++.dg/other/first-global.C: New test. @@ -12876,12 +12881,12 @@ Mon 18-Sep-2000 19:23:11 BST Neil Booth * gcc.c-torture/execute/20000917-1.c: New test. * gcc.c-torture/execute/20000917-1.x: XFAIL. -Sat 16-Sep-2000 08:14:58 BST Neil Booth +2000-09-16 Neil Booth * gcc.dg/cpp/macro2.c: Testcase for multi-context arguments in nested macro bug. -Fri 15-Sep-2000 06:50:11 BST Neil Booth +2000-09-15 Neil Booth * gcc.dg/cpp/paste10.c: Testcase for PASTE_LEFT buglet. diff --git a/gcc/testsuite/gcc.c-torture/execute/20031012-1.c b/gcc/testsuite/gcc.c-torture/execute/20031012-1.c new file mode 100644 index 0000000..5411822 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20031012-1.c @@ -0,0 +1,32 @@ +/* PR optimization/8750 + Used to fail under Cygwin with + -O2 -fomit-frame-pointer + Testcase by David B. Trout */ + +#if defined(STACK_SIZE) && STACK_SIZE < 16000 +#define ARRAY_SIZE (STACK_SIZE / 2) +#define STRLEN (ARRAY_SIZE - 9) +#else +#define ARRAY_SIZE 15000 +#define STRLEN 13371 +#endif + +extern void *memset (void *, int, __SIZE_TYPE__); +extern void abort (void); + +static void foo () +{ + char a[ARRAY_SIZE]; + + a[0]=0; + memset( &a[0], 0xCD, STRLEN ); + a[STRLEN]=0; + if (strlen(a) != STRLEN) + abort (); +} + +int main ( int argc, char* argv[] ) +{ + foo(); + return 0; +}