fixed a bunch of warnings
[libfirm] / ir / be / test / alloca.c
index ecdd0f6..54ff025 100644 (file)
@@ -1,21 +1,39 @@
+#ifdef _WIN32
+#include <malloc.h>
+#else
 #include <alloca.h>
+#endif
+
 #include <stdio.h>
 
 struct x {
-  int a, b;
+       int a, b;
 };
 
 static void t(struct x *p)
 {
-  printf("%d\n", p->a + p->b);
+       printf("%d\n", p->a + p->b);
+}
+
+static void t2()
+{
+       char *mem;
+
+       printf("hallo\n");
+       mem = alloca(23);
+
+       printf("%.0s", mem);
 }
 
 int main(int argc, char *argv[])
 {
-  struct x *p = alloca(sizeof(*p));
+       struct x *p = alloca(sizeof(*p));
+
+       p->a = argc;
+       p->b = 3;
 
-  p->a = argc;
-  p->b = 3;
+       t(p);
+       t2();
 
-  t(p);
+       return 0;
 }