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.target/] [i386/] [sibcall-5.c] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* Check that indirect sibcalls understand regparm.  */
2
/* { dg-do run } */
3
/* { dg-require-effective-target ilp32 } */
4
/* { dg-options "-O2" } */
5
 
6
extern void abort (void);
7
 
8
int (*f)(int, int) __attribute__((regparm(2)));
9
int (*g)(int, int, int) __attribute__((regparm(3)));
10
 
11
int __attribute__((noinline))
12
foo(void)
13
{
14
  return f(1, 2);
15
}
16
 
17
int __attribute__((noinline))
18
bar(void)
19
{
20
  return g(1, 2, 3);
21
}
22
 
23
int __attribute__((regparm(2)))
24
f1(int x, int y)
25
{
26
  return x*3 + y;
27
}
28
 
29
int __attribute__((regparm(3)))
30
g1(int x, int y, int z)
31
{
32
  return x*9 + y*3 + z;
33
}
34
 
35
int main()
36
{
37
  f = f1;
38
  g = g1;
39
  if (foo() != 1*3 + 2)
40
    abort ();
41
  if (bar() != 1*9 + 2*3 + 3)
42
    abort ();
43
  return 0;
44
}

powered by: WebSVN 2.1.0

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