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: system-linux,bolt-runtime
5 # REQUIRES: aarch64-registered-target
7 # RUN: llvm-mc -triple aarch64 -filetype=obj %s -o %t.o
8 # RUN: ld.lld -q -pie -o %t.exe %t.o
9 # RUN: not llvm-bolt --instrument -o %t.out %t.exe 2>&1 | FileCheck %s
11 # CHECK: BOLT-ERROR: linking object with arch x86_64 into context with arch aarch64
15 .type _start, %function
17 # BOLT errs when instrumenting without relocations; create a dummy one.
18 .reloc 0, R_AARCH64_NONE
20 .size _start, .-_start
23 .type _fini, %function
24 # Force DT_FINI to be created (needed for instrumentation).