PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sibcall-5.c
blobec003c9962e7a6b060ce52e70480646273c071e5
1 /* Check that indirect sibcalls understand regparm. */
2 /* { dg-do run { target ia32 } } */
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;