diff test/tmp8.c @ 172:096559f07a70

some check
author kono
date Tue, 25 Nov 2003 11:47:41 +0900
parents fdbf2fbc8140
children a93e619cf772
line wrap: on
line diff
--- a/test/tmp8.c	Mon Nov 24 20:28:19 2003 +0900
+++ b/test/tmp8.c	Tue Nov 25 11:47:41 2003 +0900
@@ -1,7 +1,32 @@
 
+int asize = 100;
+
+int f(int i,int j,int k,int *l);
+int g();
+
+int
+main()
+{
+    int a[0] ;
+   printf("%d %d\n",g(),f(0,1,2,a));
+   return 0; 
+}
 
 int
-f(int i,int j,int k,void *l)
+g()
 {
-    return f(i,j,k,alloca(i));
+   int k = 0,i;
+
+   char *p = alloca(asize);
+   for(i=0;i<100;i++) p[i]=i;
+   for(i=0;i<100;i++) k += p[i];
+   return k;
 }
+
+int
+f(int i,int j,int k,int *l)
+{
+    *l = 3;
+    if (i++ >20) return *l;
+    return f(i,j,k,(int*)alloca(asize));
+}