Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr57459.c
blob75101145afc0584988b02f6c258de023aa63591d
1 /* PR rtl-optimization/57459 */
2 /* { dg-do run } */
3 /* { dg-options "-fno-inline -O2 -minline-all-stringops -fno-omit-frame-pointer" } */
5 int total1[10], total2[10], total3[10], total4[10], total5[10], a[20];
6 int len;
8 void stackclean() {
9 void *ptr = __builtin_alloca(20000);
10 __builtin_memset(ptr, 0, 20000);
13 void foo(const char *s) {
14 int r1 = a[1];
15 int r2 = a[2];
16 int r3 = a[3];
17 int r4 = a[4];
18 int r5 = a[5];
20 len = __builtin_strlen(s);
22 if (s != 0)
23 return;
25 while (r1) {
26 total1[r1] = r1;
27 r1--;
30 while (r2) {
31 total2[r2] = r2;
32 r2--;
35 while (r3) {
36 total3[r3] = r3;
37 r3--;
40 while (r4) {
41 total4[r4] = r4;
42 r4--;
45 while (r5) {
46 total5[r5] = r5;
47 r5--;
51 extern void abort (void);
53 int main() {
54 stackclean();
55 foo("abcdefgh");
56 if (len != 8)
57 abort ();
58 return 0;