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-23.c] - Diff between revs 297 and 338

Only display areas with differences | Details | Blame | View Log

Rev 297 Rev 338
/* PR 9700 */
/* PR 9700 */
/* Alpha got the base address for the va_list incorrect when there was
/* Alpha got the base address for the va_list incorrect when there was
   a structure that was passed partially in registers and partially on
   a structure that was passed partially in registers and partially on
   the stack.  */
   the stack.  */
 
 
#include <stdarg.h>
#include <stdarg.h>
 
 
struct two { long x, y; };
struct two { long x, y; };
 
 
void foo(int a, int b, int c, int d, int e, struct two f, int g, ...)
void foo(int a, int b, int c, int d, int e, struct two f, int g, ...)
{
{
  va_list args;
  va_list args;
  int h;
  int h;
 
 
  va_start(args, g);
  va_start(args, g);
  h = va_arg(args, int);
  h = va_arg(args, int);
  if (g != 1 || h != 2)
  if (g != 1 || h != 2)
    abort ();
    abort ();
}
}
 
 
int main()
int main()
{
{
  struct two t = { 0, 0 };
  struct two t = { 0, 0 };
  foo(0, 0, 0, 0, 0, t, 1, 2);
  foo(0, 0, 0, 0, 0, t, 1, 2);
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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