PR middle-end/30262
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20031012-1.c
bloba1f3de8baeff37afeeebb551a4d02b67d3ea75ad
1 /* PR optimization/8750
2 Used to fail under Cygwin with
3 -O2 -fomit-frame-pointer
4 Testcase by David B. Trout */
6 #if defined(STACK_SIZE) && STACK_SIZE < 16000
7 #define ARRAY_SIZE (STACK_SIZE / 2)
8 #define STRLEN (ARRAY_SIZE - 9)
9 #else
10 #define ARRAY_SIZE 15000
11 #define STRLEN 13371
12 #endif
14 extern void *memset (void *, int, __SIZE_TYPE__);
15 extern void abort (void);
17 static void foo ()
19 char a[ARRAY_SIZE];
21 a[0]=0;
22 memset( &a[0], 0xCD, STRLEN );
23 a[STRLEN]=0;
24 if (strlen(a) != STRLEN)
25 abort ();
28 int main ( int argc, char* argv[] )
30 foo();
31 return 0;