diff options
author | no-author <no-author@gcc.gnu.org> | 2003-10-19 00:02:23 +0000 |
---|---|---|
committer | no-author <no-author@gcc.gnu.org> | 2003-10-19 00:02:23 +0000 |
commit | 9a463ba2983fa033adf7ad58c969e7100fb69c24 (patch) | |
tree | 9bb4f073ce0c679af318a373cce2150710bdd6ff /gcc/testsuite/gcc.c-torture | |
parent | 39c2a77efda76c5e2855bcccf20f7679ec74a211 (diff) |
This commit was manufactured by cvs2svn to create branch
'tree-ssa-20020619-branch'.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@72662 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20031012-1.c | 32 |
1 files changed, 32 insertions, 0 deletions
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 00000000000..a1f3de8baef --- /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; +} |