summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr48731.c
blob: 74b77f67c52cf638f03b58548c6b18f90501a183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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);
}