aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/sibcall-8.c
blob: 3ab3809036dd0a66cd4474125d77acb193014ff8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do run } */
/* { dg-options "-O2" } */

extern void abort (void);

static int __attribute__((regparm(1)))
bar(void *arg)
{
  return arg != bar;
}

static int __attribute__((noinline,noclone,regparm(1)))
foo(int (__attribute__((regparm(1))) **bar)(void*))
{
  return (*bar)(*bar);
}

int main()
{
  int (__attribute__((regparm(1))) *p)(void*) = bar;
  if (foo(&p))
    abort();
  return 0;
}