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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [va-arg-13.c] - Blame information for rev 856

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* derived from mozilla source code */
2
 
3
#include <stdarg.h>
4
 
5
typedef struct {
6
  void *stream;
7
  va_list ap;
8
  int nChar;
9
} ScanfState;
10
 
11
void dummy (va_list vap)
12
{
13
  if (va_arg (vap, int) != 1234) abort();
14
  return;
15
}
16
 
17
void test (int fmt, ...)
18
{
19
  ScanfState state, *statep;
20
 
21
  statep = &state;
22
 
23
  va_start (statep->ap, fmt);
24
  dummy (statep->ap);
25
  va_end (statep->ap);
26
 
27
  va_start (state.ap, fmt);
28
  dummy (state.ap);
29
  va_end (state.ap);
30
 
31
  return;
32
}
33
 
34
int main (void)
35
{
36
  test (456, 1234);
37
  exit (0);
38
}

powered by: WebSVN 2.1.0

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