summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/va-arg-16.c
blob: f07972113f3596762cb34b50b9f48d8c281166d3 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <varargs.h>

typedef double TYPE;

void vafunction (dummy1, dummy2, va_alist)
  TYPE dummy1, dummy2;
  va_dcl
{
  va_list ap;

  va_start(ap);
  if (dummy1 != 888.)
    abort();
  if (dummy2 != 999.)
    abort();
  if (va_arg (ap, TYPE) != 1.)
    abort();
  if (va_arg (ap, TYPE) != 2.)
    abort();
  if (va_arg (ap, TYPE) != 3.)
    abort();
  if (va_arg (ap, TYPE) != 4.)
    abort();
  if (va_arg (ap, TYPE) != 5.)
    abort();
  if (va_arg (ap, TYPE) != 6.)
    abort();
  if (va_arg (ap, TYPE) != 7.)
    abort();
  if (va_arg (ap, TYPE) != 8.)
    abort();
  if (va_arg (ap, TYPE) != 9.)
    abort();
  va_end(ap);
}


int main (void)
{
  vafunction( 888., 999., 1., 2., 3., 4., 5., 6., 7., 8., 9. );
  exit(0);
  return 0;
}