aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-ifunc/pr18808b.c
blob: 0e189f448fe83a80e0495e3d38225c0a96664942 (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
25
26
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;
}