| 1 |
/* { dg-do compile { target { ! ia32 } } } */ |
| 2 |
/* { dg-require-ifunc "" } */ |
| 3 |
/* { dg-options "-O2 -fpic" } */ |
| 4 |
|
| 5 |
static void |
| 6 |
my_foo (void) |
| 7 |
{ |
| 8 |
} |
| 9 |
|
| 10 |
static void (*resolve_foo (void)) (void) |
| 11 |
{ |
| 12 |
return my_foo; |
| 13 |
} |
| 14 |
|
| 15 |
extern void foo (void) __attribute__((ifunc("resolve_foo"), visibility("hidden"))); |
| 16 |
|
| 17 |
void * |
| 18 |
bar(void) |
| 19 |
{ |
| 20 |
return foo; |
| 21 |
} |
| 22 |
|
| 23 |
/* { dg-final { scan-assembler {lea(?:l|q)[ \t]foo\(%rip\),[ \t]%(?:e|r)ax} } } */ |
| 24 |
/* { dg-final { scan-assembler-not "foo@GOTPCREL\\\(" } } */ |