OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [builtin-apply2.c] - Rev 399

Compare with Previous | Blame | View Log

/* { dg-do run } */
/* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { "avr-*-*" "or32-*-*" } { "*" } { "" } } */
/* { dg-skip-if "Variadic funcs use Base AAPCS.  Normal funcs use VFP variant." { "arm*-*-*" } { "-mfloat-abi=hard" } { "" } } */
 
/* PR target/12503 */
/* Origin: <pierre.nguyen-tuong@asim.lip6.fr> */
 
/* Verify that __builtin_apply behaves correctly on targets
   with pre-pushed arguments (e.g. SPARC).  */
 
 
 
#define INTEGER_ARG  5
 
extern void abort(void);
 
void foo(char *name, double d, double e, double f, int g)
{
  if (g != INTEGER_ARG)
    abort();
}
 
void bar(char *name, ...)
{
  __builtin_apply(foo, __builtin_apply_args(), 64);
}
 
int main(void)
{
  char dummy[64]; /* Make sure we have 64 bytes of stack to copy.  */
 
  bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG);
 
  return 0;
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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