1 # Test that BOLT errs when trying to instrument a binary with a different
2 # architecture than the one BOLT is built for.
4 # REQUIRES: x86_64-linux,bolt-runtime,target=x86_64{{.*}}
6 # RUN: llvm-mc -triple aarch64 -filetype=obj %s -o %t.o
7 # RUN: ld.lld -q -pie -o %t.exe %t.o
8 # RUN: not llvm-bolt --instrument -o %t.out %t.exe 2>&1 | FileCheck %s
10 # CHECK: BOLT-ERROR: linking object with arch x86_64 into context with arch aarch64
14 .type _start, %function
16 # BOLT errs when instrumenting without relocations; create a dummy one.
17 .reloc 0, R_AARCH64_NONE
19 .size _start, .-_start
22 .type _fini, %function
23 # Force DT_FINI to be created (needed for instrumentation).