[BOLT][test] Fix cross-compilation tests after D151920

Fix tests that are failing in cross-compilation after D151920
(https://lab.llvm.org/buildbot/#/builders/221/builds/17715):

- instrumentation-ind-call, basic-instrumentation: add -mno-outline-atomics flag to runtime lib
- bolt-address-translation-internal-call, internal-call-instrument: add %cflags
- meta-merge-fdata: restrict to x86_64

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D159094
This commit is contained in:
Elvina Yakubova 2023-09-07 23:54:53 +03:00
parent e1cc299ec8
commit 6678f602c2
5 changed files with 33 additions and 5 deletions

View File

@ -32,6 +32,9 @@ set(BOLT_RT_FLAGS
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
set(BOLT_RT_FLAGS ${BOLT_RT_FLAGS} "-mno-sse")
endif()
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
set(BOLT_RT_FLAGS ${BOLT_RT_FLAGS} "-mno-outline-atomics")
endif()
# Don't let the compiler think it can create calls to standard libs
target_compile_options(bolt_rt_instr PRIVATE ${BOLT_RT_FLAGS})

View File

@ -9,7 +9,7 @@
# 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
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %clang %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt --enable-bat %t.exe --relocs -o %t.out | FileCheck %s
# CHECK: BOLT-INFO: Wrote {{.*}} BAT maps
@ -29,6 +29,7 @@ main:
push %rbx
sub $0x120,%rsp
mov $0x3,%rbx
movq rel(%rip), %rdi
.J1:
cmp $0x0,%rbx
je .J2
@ -49,4 +50,8 @@ main:
.J4:
pop %rbp
retq
end:
.size main, .-main
.data
rel: .quad end

View File

@ -1,7 +1,7 @@
// This test checks that .eh_frame_hdr address is in bounds of the last LOAD
// end address i.e. the section address is smaller then the LOAD end address.
// REQUIRES: system-linux,bolt-runtime
// REQUIRES: system-linux,bolt-runtime,target=x86_64{{.*}}
// RUN: %clangxx %cxxflags -static -Wl,-q %s -o %t.exe -Wl,--entry=_start
// RUN: llvm-bolt %t.exe -o %t.instr -instrument \

View File

@ -1,15 +1,23 @@
# This reproduces a bug with instrumentation crashes on internal call
# REQUIRES: x86_64-linux,bolt-runtime
# REQUIRES: x86_64-linux,bolt-runtime,target=x86_64{{.*}}
# 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
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %clang %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt --instrument %t.exe --relocs -o %t.out
.text
.globl _start
.type _start, %function
.p2align 4
_start:
call main
ret
.size _start, .-_start
.globl main
.type main, %function
.p2align 4
@ -20,6 +28,7 @@ main:
push %rbx
sub $0x120,%rsp
mov $0x3,%rbx
movq rel(%rip), %rdi
.J1:
cmp $0x0,%rbx
je .J2
@ -40,4 +49,15 @@ main:
.J4:
pop %rbp
retq
end:
.size main, .-main
.globl _fini
.type _fini, %function
.p2align 4
_fini:
hlt
.size _fini, .-_fini
.data
rel: .quad end

View File

@ -1,7 +1,7 @@
# Meta test using merge-fdata binary
UNSUPPORTED: asan
# Instrumentation currently only works on X86
REQUIRES: bolt-runtime
REQUIRES: x86_64-linux,bolt-runtime
# Instrumentation, should test:
# - Direct branches