From: Matthias Braun Date: Wed, 25 Jul 2007 22:14:35 +0000 (+0000) Subject: fehler52: argv problems found in 176.gcc X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=f6c62755306e22774eac4503db8f17e9f9d41850;p=libfirm fehler52: argv problems found in 176.gcc [r15355] --- diff --git a/ir/be/test/fehler52.c b/ir/be/test/fehler52.c new file mode 100644 index 000000000..8ae32b5dd --- /dev/null +++ b/ir/be/test/fehler52.c @@ -0,0 +1,41 @@ +#include +#include +#include + +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; +}