OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [va-arg-11.c] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* Test va_arg when the result is ignored and only the pointer increment
2
   side effect is used.  */
3
#include <stdarg.h>
4
 
5
static int
6
foo (int a, ...)
7
{
8
  va_list va;
9
  int i, res;
10
 
11
  va_start (va, a);
12
 
13
  for (i = 0; i < 4; ++i)
14
    (void) va_arg (va, int);
15
 
16
  res = va_arg (va, int);
17
 
18
  va_end (va);
19
 
20
  return res;
21
}
22
 
23
int
24
main (void)
25
{
26
  if (foo (5, 4, 3, 2, 1, 0))
27
    abort ();
28
  exit (0);
29
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.