Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sibcall-5.c
blobf4127b975151a81d4a9325b9bef37a817b267a2d
1 /* Check that indirect sibcalls understand regparm. */
2 /* { dg-do run } */
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;