1 // This test checks that the ifuncs works after bolt.
3 // RUN: %clang %cflags -no-pie %s -fuse-ld=lld \
4 // RUN: -o %t.exe -Wl,-q
5 // RUN: llvm-bolt %t.exe -o %t.bolt.exe --use-old-text=0 --lite=0
6 // RUN: %t.bolt.exe | FileCheck %s
13 static void foo() { printf("foo\n"); }
15 static void *resolver_foo(void) { return foo
; }
17 __attribute__((ifunc("resolver_foo"))) void ifoo();
19 static void *resolver_memcpy(void) { return memcpy
; }
21 __attribute__((ifunc("resolver_memcpy"))) void *
22 imemcpy(void *dest
, const void *src
, size_t n
);
25 int a
= 0xdeadbeef, b
= 0;
26 imemcpy(&b
, &a
, sizeof(b
));