PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20031012-1.c
blobe02baf55cbc774e4155f00a8b6fc4f8f5dd782ec
1 /* { dg-add-options stack_size } */
3 /* PR optimization/8750
4 Used to fail under Cygwin with
5 -O2 -fomit-frame-pointer
6 Testcase by David B. Trout */
8 #if defined(STACK_SIZE) && STACK_SIZE < 16000
9 #define ARRAY_SIZE (STACK_SIZE / 2)
10 #define STRLEN (ARRAY_SIZE - 9)
11 #else
12 #define ARRAY_SIZE 15000
13 #define STRLEN 13371
14 #endif
16 extern void *memset (void *, int, __SIZE_TYPE__);
17 extern void abort (void);
19 static void foo ()
21 char a[ARRAY_SIZE];
23 a[0]=0;
24 memset( &a[0], 0xCD, STRLEN );
25 a[STRLEN]=0;
26 if (strlen(a) != STRLEN)
27 abort ();
30 int main ( int argc, char* argv[] )
32 foo();
33 return 0;