summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-20000519-1.c
blob: 581c8c959743c18531f0c4bf0c5ae12b2d5525b1 (plain) (blame)
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
/*
   20000519-1.c from the execute part of the gcc torture tests.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

#include <stdarg.h>

int
bar (int a, va_list ap)
{
  int b;

  do
    b = va_arg (ap, int);
  while (b > 10);

  return a + b;
}

int
foo (int a, ...)
{
  va_list ap;

  va_start (ap, a);
  return bar (a, ap);
}

void
testTortureExecute (void)
{
  if (foo (1, 2, 3) != 3)
    ASSERT (0);
  return;
}