Projet_SETI_RISC-V/riscv-gnu-toolchain/gdb/ld/testsuite/ld-ifunc/pr18808b.c

27 lines
299 B
C
Raw Normal View History

2023-03-06 14:48:14 +01:00
int foo (int) __attribute__ ((ifunc ("resolve_foo")));
extern void abort (void);
static int
foo_impl (int x)
{
return x;
}
void
bar (void)
{
int (*f)(int) = foo;
if (foo (5) != 5)
abort ();
if (f (42) != 42)
abort ();
}
void *
resolve_foo (void)
{
return (void *) foo_impl;
}