Index: bolt/test/X86/asm-dump.c =================================================================== --- bolt/test/X86/asm-dump.c +++ bolt/test/X86/asm-dump.c @@ -1,7 +1,7 @@ /** * Test for asm-dump functionality. * - * REQUIRES: system-linux,bolt-runtime + * REQUIRES: x86_64-linux,bolt-runtime * * Compile the source * RUN: %clang -fPIC %s -o %t.exe -Wl,-q Index: bolt/test/X86/bolt-address-translation-internal-call.test =================================================================== --- bolt/test/X86/bolt-address-translation-internal-call.test +++ bolt/test/X86/bolt-address-translation-internal-call.test @@ -4,7 +4,7 @@ # internal calls) might create new blocks without a mapping to an # input block. -# REQUIRES: system-linux,bolt-runtime +# REQUIRES: x86_64-linux,bolt-runtime # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o # Delete our BB symbols so BOLT doesn't mark them as entry points Index: bolt/test/X86/internal-call-instrument.s =================================================================== --- bolt/test/X86/internal-call-instrument.s +++ bolt/test/X86/internal-call-instrument.s @@ -1,6 +1,6 @@ # This reproduces a bug with instrumentation crashes on internal call -# REQUIRES: system-linux,bolt-runtime +# REQUIRES: x86_64-linux,bolt-runtime # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o # Delete our BB symbols so BOLT doesn't mark them as entry points Index: bolt/test/runtime/AArch64/Inputs/basic-instrumentation.s =================================================================== --- /dev/null +++ bolt/test/runtime/AArch64/Inputs/basic-instrumentation.s @@ -0,0 +1,9 @@ + .globl main + .type main, %function +main: + sub sp, sp, #16 + mov w0, wzr + str wzr, [sp, #12] + add sp, sp, #16 + ret +.size main, .-main Index: bolt/test/runtime/AArch64/basic-instrumentation.test =================================================================== --- /dev/null +++ bolt/test/runtime/AArch64/basic-instrumentation.test @@ -0,0 +1,22 @@ +# Try to instrument a very fast test. Input bin will not execute any code during +# runtime besides returning zero in main, so it is a good trivial case. +REQUIRES: system-linux,bolt-runtime + +RUN: %clang %p/Inputs/basic-instrumentation.s -Wl,-q -o %t.exe +RUN: llvm-bolt %t.exe -o %t --instrument \ +RUN: --instrumentation-file=%t \ +RUN: --instrumentation-file-append-pid + +# Execute program to collect profile +RUN: rm %t.*.fdata || echo Nothing to remove +RUN: %t + +# Profile should be written to %t.PID.fdata, check it +RUN: mv %t.*.fdata %t.fdata +RUN: cat %t.fdata | FileCheck -check-prefix=CHECK %s + +# Check BOLT works with this profile +RUN: llvm-bolt %t.exe --data %t.fdata -o %t.2 --reorder-blocks=cache + +# The instrumented profile should at least say main was called once +CHECK: main 0 0 1{{$}}