diff --git a/bolt/runtime/CMakeLists.txt b/bolt/runtime/CMakeLists.txt --- a/bolt/runtime/CMakeLists.txt +++ b/bolt/runtime/CMakeLists.txt @@ -23,7 +23,8 @@ -ffreestanding -fno-exceptions -fno-rtti - -fno-stack-protector) + -fno-stack-protector + -mno-sse) # Don't let the compiler think it can create calls to standard libs target_compile_options(bolt_rt_instr PRIVATE ${BOLT_RT_FLAGS} -fPIE) diff --git a/bolt/test/runtime/X86/instrumentation-xmm.c b/bolt/test/runtime/X86/instrumentation-xmm.c new file mode 100644 --- /dev/null +++ b/bolt/test/runtime/X86/instrumentation-xmm.c @@ -0,0 +1,25 @@ +#include + +void foo(float a) { + printf("a = %f\n", a); +} + +typedef void (*fptr_t)(float); +fptr_t func = foo; + +int main() { + func(42); + return 0; +} + +/* +## Check that BOLT instrumentation runtime preserves xmm registers. + +REQUIRES: system-linux,bolt-runtime + +RUN: %clang %cflags %s -o %t.exe -fno-inline -Wl,-q +RUN: llvm-bolt %t.exe --instrument -o %t.instrumented +RUN: %t.instrumented | FileCheck %s + +CHECK: a = 42.000000 +*/