* gcc.dg/const-elim-1.c: Remove xfail for xtensa-*-*.
[official-gcc.git] / gcc / testsuite / gcc.dg / sibcall-5.c
blobda95f13e25c4e9501bdbc84b398f3803ccf42a6f
1 /* Check that indirect sibcalls understand regparm. */
2 /* { dg-do run { target i?86-*-* } } */
3 /* { dg-options "-O2" } */
5 extern void abort (void);
7 int (*f)(int, int) __attribute__((regparm(2)));
8 int (*g)(int, int, int) __attribute__((regparm(3)));
10 int __attribute__((noinline))
11 foo(void)
13 return f(1, 2);
16 int __attribute__((noinline))
17 bar(void)
19 return g(1, 2, 3);
22 int __attribute__((regparm(2)))
23 f1(int x, int y)
25 return x*3 + y;
28 int __attribute__((regparm(3)))
29 g1(int x, int y, int z)
31 return x*9 + y*3 + z;
34 int main()
36 f = f1;
37 g = g1;
38 if (foo() != 1*3 + 2)
39 abort ();
40 if (bar() != 1*9 + 2*3 + 3)
41 abort ();
42 return 0;