brintos

brintos / llvm-project-archived public Read only

0
0
Text · 951 B · fa40d43 Raw
35 lines · plain
1# Test that BOLT errs when trying to instrument a binary with a different2# architecture than the one BOLT is built for.3 4# REQUIRES: system-linux,bolt-runtime5# REQUIRES: aarch64-registered-target6 7# RUN: llvm-mc -triple aarch64 -filetype=obj %s -o %t.o8# RUN: ld.lld -q -pie -o %t.exe %t.o9# RUN: not llvm-bolt --instrument -o %t.out %t.exe 2>&1 | FileCheck %s10 11# CHECK: BOLT-ERROR: linking object with arch x86_64 into context with arch aarch6412 13    .text14    .globl _start15    .type _start, %function16_start:17    # BOLT errs when instrumenting without relocations; create a dummy one.18    .reloc 0, R_AARCH64_NONE19    ret20    .size _start, .-_start21 22    .globl _init23    .type _init, %function24    # Force DT_INIT to be created (needed for instrumentation).25_init:26    ret27    .size _init, .-_init28 29    .globl _fini30    .type _fini, %function31    # Force DT_FINI to be created (needed for instrumentation).32_fini:33    ret34    .size _fini, .-_fini35