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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libmudflap/] [testsuite/] [libmudflap.c/] [pass49-frag.c] - Blame information for rev 738

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 738 jeremybenn
#include <stdlib.h>
2
#include <ctype.h>
3
#include <stdarg.h>
4
 
5
int foo (int a, ...)
6
{
7
  va_list args;
8
  char *a1;
9
  int a2;
10
  int k;
11
 
12
  va_start (args, a);
13
  for (k = 0; k < a; k++)
14
    {
15
      if ((k % 2) == 0)
16
        {
17
          char *b = va_arg (args, char *);
18
          printf ("%s", b);
19
        }
20
      else
21
        {
22
          int b = va_arg (args, int);
23
          printf ("%d", b);
24
        }
25
    }
26
  va_end (args);
27
  return a;
28
}
29
 
30
int main ()
31
{
32
  foo (7, "hello ", 5, " ", 3, " world ", 9, "\n");
33
  return 0;
34
}
35
/* { dg-output "hello 5 3 world 9" } */

powered by: WebSVN 2.1.0

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