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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [libmudflap/] [testsuite/] [libmudflap.c/] [pass49-frag.c] - Blame information for rev 17

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

Line No. Rev Author Line
1 14 jlechner
#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.