[BOLT][TEST] Remove dependence on host_cc and host_cxx

Summary: Add dependency on clang and clangxx instead.

(cherry picked from FBD31128140)
This commit is contained in:
Amir Ayupov 2021-09-22 15:53:38 -07:00 committed by Maksim Panchenko
parent 43fffff671
commit d4fdc98140
41 changed files with 45 additions and 44 deletions

View File

@ -5,7 +5,7 @@
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.bolt -adr-relaxation=true
# RUN: llvm-objdump -d --disassemble-symbols=main %t.bolt | FileCheck %s
# RUN: %t.bolt

View File

@ -25,9 +25,9 @@ int main() {
// REQUIRES: system-linux
// RUN: %host_cc %cflags -no-pie %s -o %t.exe -Wl,-q \
// RUN: %clang %cflags -no-pie %s -o %t.exe -Wl,-q \
// RUN: -Wl,--unresolved-symbols=ignore-all
// RUN: llvm-bolt %t.exe -o %t.bolt
// RUN: %host_cc %cflags -fPIC -pie -%s -o %t_pie.exe -Wl,-q \
// RUN: %clang %cflags -fPIC -pie -%s -o %t_pie.exe -Wl,-q \
// RUN: -Wl,--unresolved-symbols=ignore-all
// RUN: llvm-bolt %t_pie.exe -o %t.bolt

View File

@ -24,6 +24,8 @@ list(APPEND BOLT_TEST_DEPS
llvm-dwarfdump
llvm-mc
llvm-objcopy
clang
lld
)
add_custom_target(bolt-test-depends DEPENDS ${BOLT_TEST_DEPS})

View File

@ -7,7 +7,7 @@
# RUN: %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q -nostdlib
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
# RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -lite=0 -dyno-stats \
# RUN: -print-sctc 2>&1 | FileCheck %s
# CHECK-NOT: Assertion `BranchInfo.size() == 2 && "could only be called for blocks with 2 successors"' failed.

View File

@ -12,7 +12,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: %host_cc %t.o -falign-labels -march=native -o %t.exe -Wl,-q
# RUN: %clang %t.o -falign-labels -march=native -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.bolted -data %t.fdata \
# RUN: -reorder-blocks=cache+ -reorder-functions=hfsort \

View File

@ -8,7 +8,7 @@
# RUN: --split-dwarf-file=debug-fission-simple.dwo \
# RUN: %p/Inputs/debug-fission-simple.s \
# RUN: -o %t.o
# RUN: %host_cxx %cxxflags -g \
# RUN: %clangxx %cxxflags -g \
# RUN: -Wl,--gc-sections,-q,-nostdlib \
# RUN: -Wl,--undefined=_Z6_startv \
# RUN: -nostartfiles \

View File

@ -6,7 +6,7 @@
# RUN: %p/Inputs/file1.s -o %tfile1.o
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %p/Inputs/file2.s -o %tfile2.o
# RUN: %host_cxx %cxxflags %tmain.o %tfile1.o %tfile2.o -o %t.exe -Wl,-q
# RUN: %clangxx %cxxflags %tmain.o %tfile1.o %tfile2.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe --reorder-blocks=reverse -update-debug-sections -o %t.out
# RUN: llvm-dwarfdump --debug-types=0x000005f7 %t.out | grep DW_AT_stmt_list | FileCheck %s --check-prefix=CHECK-OUTPUT

View File

@ -5,7 +5,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -print-cfg \
# RUN: -print-only=inc_dup -o %t.out | FileCheck %s

View File

@ -53,7 +53,7 @@ define internal void @static_symb_backslash_b() #0 {
; REQUIRES: system-linux
; RUN: llc %s -o %t.s
; RUN: %host_cc %cflags -O0 %t.s -o %t.exe -Wl,-q
; RUN: %clang %cflags -O0 %t.s -o %t.exe -Wl,-q
; RUN: llvm-objcopy --redefine-syms=%p/Inputs/fdata-escape-chars-syms.txt %t.exe
;
; RUN: llvm-bolt %t.exe -o %t.exe.instrumented -instrument \

View File

@ -6,7 +6,7 @@
# RUN: %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -relocs=1 -reorder-blocks=cache+ -print-finalized \
# RUN: -o %t.out -data %t.fdata | FileCheck %s
# RUN: %t.out 1 2 3

View File

@ -9,7 +9,7 @@
# RUN: %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -relocs=1 -hot-text -reorder-functions=hfsort \
# RUN: -data %t.fdata -o %t.out | FileCheck %s

View File

@ -3,7 +3,7 @@
# REQUIRES: system-linux
# RUN: %host_cc %cflags -O1 -g %p/Inputs/icf-jump-tables.c -o %t.exe -Wl,-q
# RUN: %clang %cflags -O1 -g %p/Inputs/icf-jump-tables.c -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -icf -o %t.bolt |& FileCheck %s
## Check that BOLT successfully folded a function with jump table:

View File

@ -3,7 +3,7 @@
# REQUIRES: system-linux
# RUN: %host_cc %cflags -O1 -g %p/Inputs/inline-main.c %p/Inputs/inline-foo.c \
# RUN: %clang %cflags -O1 -g %p/Inputs/inline-main.c %p/Inputs/inline-foo.c \
# RUN: -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -update-debug-sections -print-debug-info \
# RUN: -print-only=main -print-after-lowering -force-inline=foo -o %t.bolt \

View File

@ -46,7 +46,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata \
# RUN: -o %t.instrumented

View File

@ -10,7 +10,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata \
# RUN: -o %t.instrumented

View File

@ -38,7 +38,7 @@ int main(int argc, char **argv) {
/*
REQUIRES: system-linux && lit-max-individual-test-time
RUN: %host_cc %cflags %s -o %t.exe -Wl,-q -pie -fpie
RUN: %clang %cflags %s -o %t.exe -Wl,-q -pie -fpie
RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata \
RUN: -instrumentation-wait-forks=1 -conservative-instrumentation \

View File

@ -21,7 +21,7 @@ int main(int argc, char **argv) {
/*
REQUIRES: system-linux
RUN: %host_cc %cflags %s -o %t.exe -Wl,-q -pie -fpie
RUN: %clang %cflags %s -o %t.exe -Wl,-q -pie -fpie
RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata \
RUN: -o %t.instrumented

View File

@ -49,8 +49,8 @@ int main(int argc, char **argv) {
/*
REQUIRES: system-linux
RUN: %host_cc %cflags %s -o %t.so -Wl,-q -fpie -fPIC -shared -DLIB
RUN: %host_cc %cflags %s -o %t.exe -Wl,-q -ldl
RUN: %clang %cflags %s -o %t.so -Wl,-q -fpie -fPIC -shared -DLIB
RUN: %clang %cflags %s -o %t.exe -Wl,-q -ldl
RUN: llvm-bolt %t.so -instrument -instrumentation-file=%t.so.fdata \
RUN: -o %t.so.instrumented

View File

@ -10,7 +10,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags -nostartfiles -nostdlib -lc %t.o -o %t.exe
# RUN: %clang %cflags -nostartfiles -nostdlib -lc %t.o -o %t.exe
# RUN: llvm-bolt %t.exe -o %t.exe.bolt -relocs=0 -lite=0 -reorder-blocks=reverse

View File

@ -18,7 +18,7 @@
# REQUIRES: system-linux
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: %host_cxx %cxxflags %t.o -o %t.exe -Wl,-q
# RUN: %clangxx %cxxflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.out -dump-dot-all -funcs=main.* 2>&1 | FileCheck %s
#
# CHECK-NOT: Assertion `isValid()' failed.

View File

@ -6,7 +6,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe
# RUN: %clang %cflags %t.o -o %t.exe
# RUN: llvm-bolt %t.exe -relocs=0 -jump-tables=move -print-finalized \
# RUN: -o %t.out | FileCheck %s

View File

@ -6,7 +6,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -relocs -print-cfg -o %t.out \
# RUN: | FileCheck %s

View File

@ -4,7 +4,7 @@
# RUN: %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: link_fdata %s %t.o %t.fdata2 "FDATA2"
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -data %t.fdata -reorder-blocks=cache+ -print-finalized \
# RUN: -loop-inversion-opt -o %t.out | FileCheck %s
# RUN: llvm-bolt %t.exe -data %t.fdata2 -reorder-blocks=cache+ -print-finalized \

View File

@ -6,7 +6,7 @@
# RUN: %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %t.o -o %t.exe -Wl,-q
# RUN: %clang %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -relocs=1 -print-profile-stats -o /dev/null \
# RUN: -data %t.fdata | FileCheck %s

View File

@ -11,7 +11,7 @@
# RUN: %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: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -relocs=1 -print-finalized -print-only=main -o %t.out

View File

@ -11,7 +11,7 @@
# RUN: link_fdata %s %t.o %t.fdata
# Delete our BB symbols so BOLT doesn't mark them as entry points
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -relocs=1 -frame-opt=all -print-finalized \
# RUN: -lite=0 -print-only=main -data %t.fdata -o %t.out | FileCheck %s

View File

@ -7,7 +7,7 @@
# RUN: %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q -nostdlib
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
# RUN: llvm-bolt %t.exe -relocs -o %t.out -data %t.fdata \
# RUN: -frame-opt=all -simplify-conditional-tail-calls=false \
# RUN: -eliminate-unreachable=false

View File

@ -6,7 +6,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q -nostdlib
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
# RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -frame-opt=all -lite=0 \
# RUN: -print-fop 2>&1 | FileCheck %s

View File

@ -9,7 +9,7 @@
# RUN: link_fdata %s %t.o %t.fdata
# Delete our BB symbols so BOLT doesn't mark them as entry points
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -relocs=1 -frame-opt=all -print-fop \
# RUN: -print-only=main -data %t.fdata -o %t.out | FileCheck %s

View File

@ -10,7 +10,7 @@
# RUN: link_fdata %s %t.o %t.fdata
# Delete our BB symbols so BOLT doesn't mark them as entry points
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -relocs=1 -frame-opt=all -print-finalized \
# RUN: -print-only=main -data %t.fdata -o %t.out | FileCheck %s

View File

@ -5,7 +5,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.out -lite=0 -v=1 2>&1 | FileCheck %s
# CHECK-NOT: unclaimed PC-relative relocations left in data

View File

@ -6,7 +6,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.out -lite=0 -v=1 2>&1 | FileCheck %s
# CHECK-NOT: unclaimed PC-relative relocations left in data

View File

@ -6,7 +6,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.out -lite=0 -v=1 2>&1 | FileCheck %s
# CHECK-NOT: unclaimed PC-relative relocations left in data

View File

@ -3,7 +3,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -data %t.fdata -print-finalized \
# RUN: -tail-duplication -tail-duplication-minimum-offset 1 -o %t.out | FileCheck %s

View File

@ -3,7 +3,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -data %t.fdata -reorder-blocks=cache+ -print-finalized \
# RUN: -tail-duplication -tail-duplication-minimum-offset 1 -o %t.out | FileCheck %s
# RUN: %t.exe; echo $?

View File

@ -3,7 +3,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -data %t.fdata -reorder-blocks=cache+ -print-finalized \
# RUN: -tail-duplication -tail-duplication-minimum-offset 1 -o %t.out | FileCheck %s

View File

@ -3,7 +3,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -data %t.fdata -print-finalized \
# RUN: -o %t.out -three-way-branch | FileCheck %s
# RUN: %t.exe

View File

@ -27,7 +27,7 @@ int main(int argc, char **argv) {
/*
REQUIRES: system-linux
RUN: %host_cc %cflags %s -o %t.exe -Wl,-q
RUN: %clang %cflags %s -o %t.exe -Wl,-q
RUN: llvm-bolt %t.exe -relocs=1 -lite -reorder-functions=user \
RUN: -hugify -function-order=%p/Inputs/user_func_order.txt -o %t

View File

@ -5,7 +5,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: %host_cc %cflags %t.o -o %t.exe -Wl,-q
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -print-cfg \
# RUN: -print-only=main -o %t.out | FileCheck %s

View File

@ -52,8 +52,8 @@ else:
llvm_config.use_default_substitutions()
config.substitutions.append(('%host_cc', config.host_cc))
config.substitutions.append(('%host_cxx', config.host_cxx))
llvm_config.use_clang()
llvm_config.use_lld()
config.substitutions.append(('%cflags', '-no-pie'))
config.substitutions.append(('%cxxflags', '-no-pie'))
@ -63,6 +63,7 @@ tool_dirs = [config.llvm_tools_dir,
tools = [
ToolSubst('llc', unresolved='fatal'),
ToolSubst('lld', unresolved='fatal'),
ToolSubst('llvm-dwarfdump', unresolved='fatal'),
ToolSubst('llvm-bolt', unresolved='fatal'),
ToolSubst('perf2bolt', unresolved='fatal'),

View File

@ -12,8 +12,6 @@ config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.host_cc = "@HOST_CC@"
config.host_cxx = "@CMAKE_CXX_COMPILER@"
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.enable_shared = @ENABLE_SHARED@
config.enable_backtrace = @ENABLE_BACKTRACES@