[libc] Deprecate LLVM_ENABLE_PROJECTS in favor of LLVM_ENABLE_RUNTIMES. (#117265)
[llvm-project.git] / bolt / test / runtime / X86 / instrument-wrong-target.s
blob343d93a89ed13064c1484bf83da7b85965df8ad1
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
13 .text
14 .globl _start
15 .type _start, %function
16 _start:
17 # BOLT errs when instrumenting without relocations; create a dummy one.
18 .reloc 0, R_AARCH64_NONE
19 ret
20 .size _start, .-_start
22 .globl _fini
23 .type _fini, %function
24 # Force DT_FINI to be created (needed for instrumentation).
25 _fini:
26 ret
27 .size _fini, .-_fini