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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [x86_64/] [abi/] [callabi/] [vaarg-4b.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 691 jeremybenn
/* Test for cross x86_64<->w64 abi va_list calls.  */
2
/* { dg-options "-O2 -mabi=ms -std=gnu99 -fno-builtin" } */
3
 
4
#include <stdarg.h>
5
 
6
extern __SIZE_TYPE__ __attribute__ ((sysv_abi)) strlen (const char *);
7
extern int __attribute__ ((sysv_abi)) sprintf (char *, const char *, ...);
8
 
9
static void
10
vdo_cpy (char *s, va_list argp)
11
{
12
  __SIZE_TYPE__ len;
13
  char *r = s;
14
  char *e;
15
  *r = 0;
16
  for (;;) {
17
    e = va_arg (argp, char *);
18
    if (*e == 0) break;
19
    sprintf (r,"%s", e);
20
    r += strlen (r);
21
  }
22
}
23
 
24
void
25
do_cpy (char *s, ...)
26
{
27
  va_list argp;
28
  va_start (argp, s);
29
  vdo_cpy (s, argp);
30
  va_end (argp);
31
}

powered by: WebSVN 2.1.0

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