OSDN Git Service

2011-04-26 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Apr 2011 13:00:53 +0000 (13:00 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Apr 2011 13:00:53 +0000 (13:00 +0000)
PR tree-optimization/48731
* gcc.dg/torture/pr48731.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172964 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr48731.c [new file with mode: 0644]

index 8b44671..03af544 100644 (file)
@@ -1,5 +1,10 @@
 2011-04-26  Richard Guenther  <rguenther@suse.de>
 
+       PR tree-optimization/48731
+       * gcc.dg/torture/pr48731.c: New testcase.
+
+2011-04-26  Richard Guenther  <rguenther@suse.de>
+
        PR testsuite/48753
        * gcc.dg/tree-prof/val-prof-2.c: Adjust.
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr48731.c b/gcc/testsuite/gcc.dg/torture/pr48731.c
new file mode 100644 (file)
index 0000000..74b77f6
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+#include <stdarg.h>
+
+int blah(int a, ...)
+{
+  va_list va;
+  va_start(va,a);
+  if (a == 0)
+    return -1;
+  else 
+    {
+      int i;
+      for (i = 0; i < a; i++)
+       va_arg(va,int);
+      return va_arg(va,int);
+    }
+}
+
+__attribute((flatten))
+int blah2(int b, int c)
+{
+  return blah(2, b, c);
+}