fehler52: argv problems found in 176.gcc
authorMatthias Braun <matze@braunis.de>
Wed, 25 Jul 2007 22:14:35 +0000 (22:14 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 25 Jul 2007 22:14:35 +0000 (22:14 +0000)
[r15355]

ir/be/test/fehler52.c [new file with mode: 0644]

diff --git a/ir/be/test/fehler52.c b/ir/be/test/fehler52.c
new file mode 100644 (file)
index 0000000..8ae32b5
--- /dev/null
@@ -0,0 +1,41 @@
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
+union foo {
+       float blop;
+       int bla;
+       struct {
+               int a, b, c;
+       } jup;
+       const char *str;
+};
+
+typedef union foo *tree;
+
+enum bla {
+       BLA_1,
+       BLA_2,
+       BLA_3,
+       BLA_4
+};
+
+const char* foo(enum bla type, tree dummy, ...) {
+     va_list     ap;
+        const char *s1;
+
+     va_start(ap, dummy);
+        s1 = va_arg(ap, const char*);
+        va_end(ap);
+
+     return s1;
+}
+
+union foo bla = { .str = "bla" };
+
+int main()
+{
+       srand(1234);
+       printf("%s\n", foo(BLA_2, &bla, "foop"));
+       return 0;
+}