1/* { dg-do run } */
2/* { dg-require-effective-target ilp32 } */
3/* { dg-options "-O1 -foptimize-sibling-calls" } */
4
5void abort (void);
6
7struct S
8{
9  void (__attribute__((__stdcall__)) *f) (struct S *);
10  int i;
11};
12
13void __attribute__((__stdcall__))
14foo (struct S *s)
15{
16  s->i++;
17}
18
19void __attribute__((__stdcall__))
20bar (struct S *s)
21{
22  foo(s);
23  s->f(s);
24}
25
26int main (void)
27{
28  struct S s = { foo, 0 };
29
30  bar (&s);
31  if (s.i != 2)
32    abort ();
33
34  return 0;
35}
36
37