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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [stackalign/] [builtin-apply-2.c] - Blame information for rev 698

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

Line No. Rev Author Line
1 689 jeremybenn
/* PR target/12503 */
2
/* Origin: <pierre.nguyen-tuong@asim.lip6.fr> */
3
 
4
/* Verify that __builtin_apply behaves correctly on targets
5
   with pre-pushed arguments (e.g. SPARC).  */
6
 
7
/* { dg-do run } */
8
 
9
 
10
#define INTEGER_ARG  5
11
 
12
#if defined(__ARM_PCS) || defined(__epiphany__)
13
/* For Base AAPCS, NAME is passed in r0.  D is passed in r2 and r3.
14
   E, F and G are passed on stack.  So the size of the stack argument
15
   data is 20.  */
16
#define STACK_ARGUMENTS_SIZE  20
17
#else
18
#define STACK_ARGUMENTS_SIZE  64
19
#endif
20
 
21
extern void abort(void);
22
 
23
void foo(char *name, double d, double e, double f, int g)
24
{
25
  if (g != INTEGER_ARG)
26
    abort();
27
}
28
 
29
void bar(char *name, ...)
30
{
31
  __builtin_apply(foo, __builtin_apply_args(), STACK_ARGUMENTS_SIZE);
32
}
33
 
34
int main(void)
35
{
36
  bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG);
37
 
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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