va_start did not work with fastcall yet
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 28 Jun 2007 12:16:51 +0000 (12:16 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 28 Jun 2007 12:16:51 +0000 (12:16 +0000)
[r14809]

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

diff --git a/ir/be/test/fehler28.c b/ir/be/test/fehler28.c
new file mode 100644 (file)
index 0000000..02d9dff
--- /dev/null
@@ -0,0 +1,17 @@
+/* fmt and all further parameters must be passed on the stack even for regparams */
+#include <stdarg.h>
+
+static void f(const char* fmt, ...)
+{
+  va_list va;
+  va_start(va, fmt);
+  vprintf(fmt, va);
+  va_end(va);
+}
+
+
+int main(void)
+{
+  f("Hallo, %s!\n", "Welt");
+  return 0;
+}