Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.target / i386 / sibcall-5.c
blobd94750099fe91ee01e522dc34d4d07d9f0359f1b
1 /* Check that indirect sibcalls understand regparm. */
2 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
3 /* { dg-require-effective-target ilp32 } */
4 /* { dg-options "-O2" } */
6 extern void abort (void);
8 int (*f)(int, int) __attribute__((regparm(2)));
9 int (*g)(int, int, int) __attribute__((regparm(3)));
11 int __attribute__((noinline))
12 foo(void)
14 return f(1, 2);
17 int __attribute__((noinline))
18 bar(void)
20 return g(1, 2, 3);
23 int __attribute__((regparm(2)))
24 f1(int x, int y)
26 return x*3 + y;
29 int __attribute__((regparm(3)))
30 g1(int x, int y, int z)
32 return x*9 + y*3 + z;
35 int main()
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;